Metadata-Version: 2.1
Name: camembert-bri
Version: 0.0.1
Summary: Python interface to BRI (Bam Read Index)
Home-page: https://github.com/usajusaj/camembertpy
Author: Matej Usaj
Author-email: m.usaj@utoronto.ca
License: UNKNOWN
Download-URL: https://github.com/usajusaj/camembertpy/archive/master.zip
Keywords: bri samtools htslib read index
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Science/Research
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Description-Content-Type: text/markdown
Requires-Dist: pysam

![Python package](https://github.com/usajusaj/camembertpy/workflows/Python%20package/badge.svg)

# camembertpy

Cython wrapper for https://github.com/jts/bri with pysam integration.

# Installation
## From source
### conda approach (recommended)
```bash
conda env create -f environment.yml
conda activate camembert
python setup.py install
```
### pip approach
```bash
# optional virtualenv:
virtualenv camembert
source camembert/bin/activate

# Installation
pip install -r requirements.txt
python setup.py install
```

# Examples
## API
### build read index
```python
from camembert import Bri
b = Bri(bam_file)
b.create()
```

### retrieve reads
```python
from camembert import Bri
b = Bri(bam_file)
b.load()
for read in b.get(read_name):
    print(read.to_string())  # read is of type pysam.AligmentSegment
```
## CLI
A command line interface is included and mimics the original bri CLI command. For usage, refer to
```bash
camembert --help
camembert <subcommand> --help
```

### build read index
```bash
camembert index bam_file.bam
```

### retrieve reads
```bash
camembert get bam_file.bam read_name
```


