[![PyPI version](https://badge.fury.io/py/aligncov.svg)](https://badge.fury.io/py/aligncov)
# AlignCov
AlignCov is a bioinformatics tool which can be used to obtain a) alignment summary statistics and b) read depths from sorted BAM files in tidy tab-separated tables.
## Future plans
- [ ] Create a Bioconda recipe
- [ ] Create a Docker image
## Introduction
This script takes a sorted BAM file as input and uses [SAMtools](http://samtools.sourceforge.net/) and Python [Pandas](https://pandas.pydata.org/) to generate two tables:
- `_stats.tsv`: A table of alignment summary statistics, including fold-coverages (fold_cov) and proportions of target lengths covered by mapped reads (prop_cov).
- target: Name of the target.
- seqlen: Length of the target sequence (bp).
- depth: Total number of base pairs mapped to the target.
- len_cov: Total number of base pairs within the target that are covered by at least one mapped read.
- prop_cov: Proportion of the target length covered by at least one mapped read (len_cov / seqlen).
- fold_cov: Fold-coverage of mapped reads to the target (i.e. the number of times the target is completely covered by mapped reads) (depth / seqlen).
- `_depth.tsv`: A table of read depths for each bp position of each target.
- target: Name of the target.
- position: Base pair position within the target.
- depth: Total number of reads aligned to the base pair position within the target.
## Dependencies
- `samtools>=1.15`
## Installation
AlignCov can be installed using Pip with the following command:
```bash
pip install aligncov
```
## Usage
### Quick start
For a sorted BAM file named 'bacillus.bam', compute alignment statistics and read depths, and save results to files named 'subtilis_stats.tsv' and 'subtilis_depth.tsv':
```bash
$ aligncov -i bacillus.bam -o subtilis
```
### More options
To show the program's help message:
```
$ aligncov -h
usage: aligncov [-h] -i INPUT [-o OUTPUT]
Parse a sorted BAM file to generate two tables: a table of alignment summary statistics ('_stats.tsv'), including fold-coverages (fold_cov) and proportions of target lengths covered by mapped reads (prop_cov), and a table of read
depths ('_depth.tsv') for each bp position of each target.
options:
-h, --help show this help message and exit
Required:
-i INPUT, --input INPUT
Path to sorted BAM file to process.
Optional:
-o OUTPUT, --output OUTPUT
Path and base name of files to save as tab-separated tables ('[output]_stats.tsv', '[output]_depth.tsv'). Default: 'sample'
```
## Credits
### Packages
- [Pandas](https://pandas.pydata.org/): McKinney W. 2011. Pandas: A foundation python library for data analysis and statistics. Python for High Performance and Scientific Computing 1–9.
### Dependencies
- [SAMtools](http://www.htslib.org/): Danecek P, Bonfield JK, Liddle J, Marshall J, Ohan V, Pollard MO, Whitwham A, Keane T, McCarthy SA, Davies RM, Li H. 2021. Twelve years of SAMtools and BCFtools. GigaScience 10(2) giab008. doi: [10.1093/gigascience/giab008](doi.org/10.1093/gigascience/giab008)
### Project structure
This package was created with [Cookiecutter](https://github.com/audreyr/cookiecutter) and the [`audreyr/cookiecutter-pypackage`](https://github.com/audreyr/cookiecutter-pypackage) project template.
=======
History
=======
0.0.2 (2023-08-13)
------------------
* Improved/fixed documentation on GitHub and PyPI.
0.0.1 (2023-08-12)
------------------
* First release on PyPI.
Raw data
{
"_id": null,
"home_page": "https://github.com/pcrxn/aligncov",
"name": "aligncov",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": "",
"keywords": "aligncov",
"author": "Liam Brown",
"author_email": "pcrxn@proton.me",
"download_url": "https://files.pythonhosted.org/packages/36/73/ef19f7f6999d59275301fac96f7f37eb8a20ecafc678a1d7ced25d6f26cd/aligncov-0.0.2.tar.gz",
"platform": null,
"description": "[![PyPI version](https://badge.fury.io/py/aligncov.svg)](https://badge.fury.io/py/aligncov)\n\n# AlignCov\n\nAlignCov is a bioinformatics tool which can be used to obtain a) alignment summary statistics and b) read depths from sorted BAM files in tidy tab-separated tables.\n\n## Future plans\n\n- [ ] Create a Bioconda recipe\n- [ ] Create a Docker image\n\n## Introduction\n\nThis script takes a sorted BAM file as input and uses [SAMtools](http://samtools.sourceforge.net/) and Python [Pandas](https://pandas.pydata.org/) to generate two tables:\n\n- `_stats.tsv`: A table of alignment summary statistics, including fold-coverages (fold_cov) and proportions of target lengths covered by mapped reads (prop_cov).\n - target: Name of the target.\n - seqlen: Length of the target sequence (bp).\n - depth: Total number of base pairs mapped to the target.\n - len_cov: Total number of base pairs within the target that are covered by at least one mapped read.\n - prop_cov: Proportion of the target length covered by at least one mapped read (len_cov / seqlen).\n - fold_cov: Fold-coverage of mapped reads to the target (i.e. the number of times the target is completely covered by mapped reads) (depth / seqlen).\n- `_depth.tsv`: A table of read depths for each bp position of each target.\n - target: Name of the target.\n - position: Base pair position within the target.\n - depth: Total number of reads aligned to the base pair position within the target.\n\n## Dependencies\n\n- `samtools>=1.15`\n\n## Installation\n\nAlignCov can be installed using Pip with the following command:\n\n```bash\npip install aligncov\n```\n\n## Usage\n\n### Quick start\n\nFor a sorted BAM file named 'bacillus.bam', compute alignment statistics and read depths, and save results to files named 'subtilis_stats.tsv' and 'subtilis_depth.tsv':\n\n```bash\n$ aligncov -i bacillus.bam -o subtilis\n```\n\n### More options\n\nTo show the program's help message:\n\n```\n$ aligncov -h\nusage: aligncov [-h] -i INPUT [-o OUTPUT]\n\nParse a sorted BAM file to generate two tables: a table of alignment summary statistics ('_stats.tsv'), including fold-coverages (fold_cov) and proportions of target lengths covered by mapped reads (prop_cov), and a table of read\ndepths ('_depth.tsv') for each bp position of each target.\n\noptions:\n -h, --help show this help message and exit\n\nRequired:\n -i INPUT, --input INPUT\n Path to sorted BAM file to process.\n\nOptional:\n -o OUTPUT, --output OUTPUT\n Path and base name of files to save as tab-separated tables ('[output]_stats.tsv', '[output]_depth.tsv'). Default: 'sample'\n```\n\n## Credits\n\n### Packages\n\n- [Pandas](https://pandas.pydata.org/): McKinney W. 2011. Pandas: A foundation python library for data analysis and statistics. Python for High Performance and Scientific Computing 1\u20139.\n\n### Dependencies\n\n- [SAMtools](http://www.htslib.org/): Danecek P, Bonfield JK, Liddle J, Marshall J, Ohan V, Pollard MO, Whitwham A, Keane T, McCarthy SA, Davies RM, Li H. 2021. Twelve years of SAMtools and BCFtools. GigaScience 10(2) giab008. doi: [10.1093/gigascience/giab008](doi.org/10.1093/gigascience/giab008)\n\n### Project structure\n\nThis package was created with [Cookiecutter](https://github.com/audreyr/cookiecutter) and the [`audreyr/cookiecutter-pypackage`](https://github.com/audreyr/cookiecutter-pypackage) project template.\n\n\n=======\nHistory\n=======\n\n0.0.2 (2023-08-13)\n------------------\n\n* Improved/fixed documentation on GitHub and PyPI.\n\n0.0.1 (2023-08-12)\n------------------\n\n* First release on PyPI.\n",
"bugtrack_url": null,
"license": "MIT license",
"summary": "Obtain tidy alignment coverage info from sorted BAM files",
"version": "0.0.2",
"project_urls": {
"Homepage": "https://github.com/pcrxn/aligncov"
},
"split_keywords": [
"aligncov"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "b2abd19f3b17187c6b0cb1c30a7a3551c56e49a0d0ab69596177118cb8a2c03e",
"md5": "efda6fb96221af1a597abbb8af12ba5e",
"sha256": "d0f2460fe5d32bfce9d6bb3233759595221d924211cef4ebae4926cbd0317995"
},
"downloads": -1,
"filename": "aligncov-0.0.2-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "efda6fb96221af1a597abbb8af12ba5e",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": ">=3.6",
"size": 6742,
"upload_time": "2023-08-13T18:19:00",
"upload_time_iso_8601": "2023-08-13T18:19:00.887637Z",
"url": "https://files.pythonhosted.org/packages/b2/ab/d19f3b17187c6b0cb1c30a7a3551c56e49a0d0ab69596177118cb8a2c03e/aligncov-0.0.2-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "3673ef19f7f6999d59275301fac96f7f37eb8a20ecafc678a1d7ced25d6f26cd",
"md5": "8a6d838a8ed836272f4164e89c711d62",
"sha256": "47ded440daebad7bdfa1e5e3a75925f3bf6e730e7de5b3f50060bf35e5ad0f43"
},
"downloads": -1,
"filename": "aligncov-0.0.2.tar.gz",
"has_sig": false,
"md5_digest": "8a6d838a8ed836272f4164e89c711d62",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 6158,
"upload_time": "2023-08-13T18:19:02",
"upload_time_iso_8601": "2023-08-13T18:19:02.036716Z",
"url": "https://files.pythonhosted.org/packages/36/73/ef19f7f6999d59275301fac96f7f37eb8a20ecafc678a1d7ced25d6f26cd/aligncov-0.0.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-08-13 18:19:02",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "pcrxn",
"github_project": "aligncov",
"travis_ci": true,
"coveralls": false,
"github_actions": false,
"tox": true,
"lcname": "aligncov"
}