Skip to main content
# ngsindex

Support for reading various NGS-related index formats:

* [BAI](https://samtools.github.io/hts-specs/SAMv1.pdf)
* [TBI](https://samtools.github.io/hts-specs/tabix.pdf)
* [CSI](https://samtools.github.io/hts-specs/CSIv2.pdf)

# Installation

```bash
pip install ngsindex
```

# Usage

```python
from ngsindex import IndexType, resolve_index_file, parse_index
from pathlib import Path

bam_file = Path('/path/to/reads.bam')

# Resolve the location of the BAM index file.
index_file = resolve_index_file(bam_file, IndexType.BAI)

# Load the index
index = parse_index(index_file)

# Loop through chromosome indexes
for refidx in index.ref_indexes:
...
```

# Limitations

* CRAM files are not yet supported (neither .crai nor .bai index files).

# Todo

* Add support for splitting BAI:
* https://github.com/samtools/hts-specs/pull/321
* https://github.com/tomwhite/hts-specs/blob/sbi/SAMv1.tex

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ngsindex-0.1.7.tar.gz (43.3 kB view details)

Uploaded Source

File details

Details for the file ngsindex-0.1.7.tar.gz.

File metadata

  • Download URL: ngsindex-0.1.7.tar.gz
  • Upload date:
  • Size: 43.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Python-urllib/3.6

File hashes

Hashes for ngsindex-0.1.7.tar.gz
Algorithm Hash digest
SHA256 8996c6e762df0814631e2e5f5b97733ebcf30cd7ac0884f149b6422a9a1eb38a
MD5 887b971ba7ce356a2ea4ca13fa3f55ca
BLAKE2b-256 32551838a41dda1d46e74319453f234354166164abcbcb9b0fe46a707c33cc29

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.7 This release

1 file

0.1.6

1 file

0.1.5

1 file

0.1.4

1 file

0.1.3

1 file

0.1.2

1 file

0.1.1

1 file

0.1.0

1 file

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page