amplicov


Nameamplicov JSON
Version 0.3.4 PyPI version JSON
download
home_pagehttps://github.com/chienchi/amplicon_coverage_plot
Summaryscript to generate amplicon coverage plot
upload_time2024-12-05 20:59:27
maintainerNone
docs_urlNone
authorChienchi Lo
requires_pythonNone
licenseLICENSE.txt
keywords amplicon genome coverage
VCS
bugtrack_url
requirements subprocess defaultdict csv numpy plotly pysam pathlib
Travis-CI
coveralls test coverage No coveralls.
            # amplicon_coverage_plot
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.7531741.svg)](https://doi.org/10.5281/zenodo.7531741)
[![Anaconda-Server Badge](https://anaconda.org/bioconda/amplicon_coverage_plot/badges/version.svg)](https://anaconda.org/bioconda/amplicon_coverage_plot)
[![Build Status](https://travis-ci.org/chienchi/amplicon_coverage_plot.svg?branch=master)](https://travis-ci.org/chienchi/amplicon_coverage_plot)
[![codecov](https://codecov.io/gh/chienchi/amplicon_coverage_plot/branch/master/graph/badge.svg)](https://codecov.io/gh/chienchi/amplicon_coverage_plot)
[![PyPI version](https://badge.fury.io/py/amplicov.svg)](https://badge.fury.io/py/amplicov)

The script will generate an [interactive barplot](https://chienchi.github.io/amplicon_coverage_plot/index.html) given amplicon info in [bed6/bedpe](https://bedtools.readthedocs.io/en/latest/content/general-usage.html) format and coverage information in cov/bam file.

## Dependencies

### Programming/Scripting languages
- [Python >=v3.8](https://www.python.org/)
    - The pipeline has been tested in v3.8.10

### Python packages
- [numpy >=1.15.1](http://www.numpy.org/) 
- [plotly >=4.7.1](https://plotly.com/python/)
- [pysam >= 0.15.4](https://github.com/pysam-developers/pysam)

### Third party softwares/packages
- [samtools >=1.9](http://www.htslib.org) - process bam file

## Installation

### Install by pip

```
pip install amplicov
```

### Install by conda

```
conda install -c bioconda amplicon_coverage_plot 
```

### Install from source
Clone the `amplicon_coverage_plot` repository.

```
git clone https://github.com/chienchi/amplicon_coverage_plot
```

Then change directory to `amplicon_coverage_plot` and install.

```
cd amplicon_coverage_plot
python setup.py install
```

If the installation was succesful, you should be able to type `amplicov -h` and get a help message on how to use the tool.

```
amplicov -h
```


## Usage
```
usage: amplicov [-h] (--bed [FILE] | --bedpe [FILE])
                (--bam [FILE] | --cov [FILE]) [-o [PATH]] [-p [STR]] [--pp]
                [--mincov [INT]] [--version]

Script to parse amplicon region coverage and generate barplot in html

optional arguments:
  -h, --help            show this help message and exit
  --pp                  process proper paired only reads from bam file
                        (illumina)
  --count_primer        count overlapped primer region to unqiue coverage
  --mincov [INT]        minimum coverage to count as ambiguous N site
                        [default:10]
  -r [STR], --refID [STR]
                        reference accession (bed file first field)
  --depth_lines DEPTH_LINES [DEPTH_LINES ...]
                        Add option to display lines at these depths (provide depths as a list of integers) [default:5 10 20 50]
  --gff [FILE]          gff file for data hover info annotation
  --version             show program's version number and exit

Amplicon Input (required, mutually exclusive):
  --bed [FILE]          amplicon bed file (bed6 format)
  --bedpe [FILE]        amplicon bedpe file

Coverage Input (required, mutually exclusive):
  --bam [FILE]          sorted bam file (ex: samtools sort input.bam -o
                        sorted.bam)
  --cov [FILE]          coverage file [position coverage]

Output:
  -o [PATH], --outdir [PATH]
                        output directory
  -p [STR], --prefix [STR]
                        output prefix
```

## Test

```
cd tests
./runTest.sh
```

## Outputs 

-- prefix_amplicon_coverage.txt

| ID          | Whole_Amplicon | Unique  | Whole_Amplicon_Ns(cov<10) | Unique_Amplicon_Ns(cov<10) |
|-------------|----------------|---------|---------------------------|----------------------------|
| nCoV-2019_1 | 217.74         | 53.00   | 0.00                      | 0.00                       |
| nCoV-2019_2 | 1552.83        | 1235.50 | 0.00                      | 0.00                       |
| nCoV-2019_3 | 3164.22        | 2831.73 | 0.00                      | 0.00                       |
| nCoV-2019_4 | 2005.16        | 1658.00 | 0.00                      | 0.00                       |
| etc...      |                |         |                           |                            |

#### Table Header Definition in the amplicon_coverage.txt 

<img width="465" alt="Screen Shot 2020-06-15 at 3 29 53 PM" src="https://user-images.githubusercontent.com/737589/84708117-1fc2e480-af1d-11ea-8411-35210a8dd6fa.png">

* Whole_Amplicon_Ns(cov<10): The number of aligned position with coverage < 10 or (--mincov) in the Whole Amplicon region

* Unique_Amplicon_Ns(cov<10): The number of aligned position with coverage < 10 or (--mincov) in the Unique region

-- prefix_amplicon_coverage.html

```color black for < 5x and blue for <20x```

<a href="https://chienchi.github.io/amplicon_coverage_plot/index.html">![html](https://user-images.githubusercontent.com/737589/105805303-f2ccba80-5f5e-11eb-8338-63bd51bd426d.png)</a>


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/chienchi/amplicon_coverage_plot",
    "name": "amplicov",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "amplicon genome coverage",
    "author": "Chienchi Lo",
    "author_email": "chienchi@lanl.gov",
    "download_url": null,
    "platform": null,
    "description": "# amplicon_coverage_plot\n[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.7531741.svg)](https://doi.org/10.5281/zenodo.7531741)\n[![Anaconda-Server Badge](https://anaconda.org/bioconda/amplicon_coverage_plot/badges/version.svg)](https://anaconda.org/bioconda/amplicon_coverage_plot)\n[![Build Status](https://travis-ci.org/chienchi/amplicon_coverage_plot.svg?branch=master)](https://travis-ci.org/chienchi/amplicon_coverage_plot)\n[![codecov](https://codecov.io/gh/chienchi/amplicon_coverage_plot/branch/master/graph/badge.svg)](https://codecov.io/gh/chienchi/amplicon_coverage_plot)\n[![PyPI version](https://badge.fury.io/py/amplicov.svg)](https://badge.fury.io/py/amplicov)\n\nThe script will generate an [interactive barplot](https://chienchi.github.io/amplicon_coverage_plot/index.html) given amplicon info in [bed6/bedpe](https://bedtools.readthedocs.io/en/latest/content/general-usage.html) format and coverage information in cov/bam file.\n\n## Dependencies\n\n### Programming/Scripting languages\n- [Python >=v3.8](https://www.python.org/)\n    - The pipeline has been tested in v3.8.10\n\n### Python packages\n- [numpy >=1.15.1](http://www.numpy.org/) \n- [plotly >=4.7.1](https://plotly.com/python/)\n- [pysam >= 0.15.4](https://github.com/pysam-developers/pysam)\n\n### Third party softwares/packages\n- [samtools >=1.9](http://www.htslib.org) - process bam file\n\n## Installation\n\n### Install by pip\n\n```\npip install amplicov\n```\n\n### Install by conda\n\n```\nconda install -c bioconda amplicon_coverage_plot \n```\n\n### Install from source\nClone the `amplicon_coverage_plot` repository.\n\n```\ngit clone https://github.com/chienchi/amplicon_coverage_plot\n```\n\nThen change directory to `amplicon_coverage_plot` and install.\n\n```\ncd amplicon_coverage_plot\npython setup.py install\n```\n\nIf the installation was succesful, you should be able to type `amplicov -h` and get a help message on how to use the tool.\n\n```\namplicov -h\n```\n\n\n## Usage\n```\nusage: amplicov [-h] (--bed [FILE] | --bedpe [FILE])\n                (--bam [FILE] | --cov [FILE]) [-o [PATH]] [-p [STR]] [--pp]\n                [--mincov [INT]] [--version]\n\nScript to parse amplicon region coverage and generate barplot in html\n\noptional arguments:\n  -h, --help            show this help message and exit\n  --pp                  process proper paired only reads from bam file\n                        (illumina)\n  --count_primer        count overlapped primer region to unqiue coverage\n  --mincov [INT]        minimum coverage to count as ambiguous N site\n                        [default:10]\n  -r [STR], --refID [STR]\n                        reference accession (bed file first field)\n  --depth_lines DEPTH_LINES [DEPTH_LINES ...]\n                        Add option to display lines at these depths (provide depths as a list of integers) [default:5 10 20 50]\n  --gff [FILE]          gff file for data hover info annotation\n  --version             show program's version number and exit\n\nAmplicon Input (required, mutually exclusive):\n  --bed [FILE]          amplicon bed file (bed6 format)\n  --bedpe [FILE]        amplicon bedpe file\n\nCoverage Input (required, mutually exclusive):\n  --bam [FILE]          sorted bam file (ex: samtools sort input.bam -o\n                        sorted.bam)\n  --cov [FILE]          coverage file [position coverage]\n\nOutput:\n  -o [PATH], --outdir [PATH]\n                        output directory\n  -p [STR], --prefix [STR]\n                        output prefix\n```\n\n## Test\n\n```\ncd tests\n./runTest.sh\n```\n\n## Outputs \n\n-- prefix_amplicon_coverage.txt\n\n| ID          | Whole_Amplicon | Unique  | Whole_Amplicon_Ns(cov<10) | Unique_Amplicon_Ns(cov<10) |\n|-------------|----------------|---------|---------------------------|----------------------------|\n| nCoV-2019_1 | 217.74         | 53.00   | 0.00                      | 0.00                       |\n| nCoV-2019_2 | 1552.83        | 1235.50 | 0.00                      | 0.00                       |\n| nCoV-2019_3 | 3164.22        | 2831.73 | 0.00                      | 0.00                       |\n| nCoV-2019_4 | 2005.16        | 1658.00 | 0.00                      | 0.00                       |\n| etc...      |                |         |                           |                            |\n\n#### Table Header Definition in the amplicon_coverage.txt \n\n<img width=\"465\" alt=\"Screen Shot 2020-06-15 at 3 29 53 PM\" src=\"https://user-images.githubusercontent.com/737589/84708117-1fc2e480-af1d-11ea-8411-35210a8dd6fa.png\">\n\n* Whole_Amplicon_Ns(cov<10): The number of aligned position with coverage < 10 or (--mincov) in the Whole Amplicon region\n\n* Unique_Amplicon_Ns(cov<10): The number of aligned position with coverage < 10 or (--mincov) in the Unique region\n\n-- prefix_amplicon_coverage.html\n\n```color black for < 5x and blue for <20x```\n\n<a href=\"https://chienchi.github.io/amplicon_coverage_plot/index.html\">![html](https://user-images.githubusercontent.com/737589/105805303-f2ccba80-5f5e-11eb-8338-63bd51bd426d.png)</a>\n\n",
    "bugtrack_url": null,
    "license": "LICENSE.txt",
    "summary": "script to generate amplicon coverage plot",
    "version": "0.3.4",
    "project_urls": {
        "Homepage": "https://github.com/chienchi/amplicon_coverage_plot"
    },
    "split_keywords": [
        "amplicon",
        "genome",
        "coverage"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "057d5306aff2d071ab644b6e7f0147527a63d35cd0399b328133663cab848f90",
                "md5": "082d7be3c312bd91d69591ca34df1b69",
                "sha256": "1c787bb4a536e75bfc4ccbf30c62094420a527ba033070631e477b055017a8e4"
            },
            "downloads": -1,
            "filename": "amplicov-0.3.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "082d7be3c312bd91d69591ca34df1b69",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 20789,
            "upload_time": "2024-12-05T20:59:27",
            "upload_time_iso_8601": "2024-12-05T20:59:27.422253Z",
            "url": "https://files.pythonhosted.org/packages/05/7d/5306aff2d071ab644b6e7f0147527a63d35cd0399b328133663cab848f90/amplicov-0.3.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-05 20:59:27",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "chienchi",
    "github_project": "amplicon_coverage_plot",
    "travis_ci": true,
    "coveralls": false,
    "github_actions": false,
    "requirements": [
        {
            "name": "subprocess",
            "specs": []
        },
        {
            "name": "defaultdict",
            "specs": []
        },
        {
            "name": "csv",
            "specs": []
        },
        {
            "name": "numpy",
            "specs": []
        },
        {
            "name": "plotly",
            "specs": []
        },
        {
            "name": "pysam",
            "specs": []
        },
        {
            "name": "pathlib",
            "specs": []
        }
    ],
    "lcname": "amplicov"
}
        
Elapsed time: 1.47151s