bam2plot


Namebam2plot JSON
Version 0.3.6 PyPI version JSON
download
home_pagehttps://github.com/willros/bam2plot
SummaryPlot of coverage from bam file
upload_time2024-09-05 04:54:49
maintainerNone
docs_urlNone
authorWilliam Rosenbaum
requires_python>=3.10
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # BAM2PLOT

Plot your bam files!

## UPDATE
`bam2plot` no longer depends on `perbase`. Now, `bam2plot` depends on [mosdepth](https://github.com/brentp/mosdepth)

## Subcommands
```bash
You must call bam2plot with the following subcommands:
   [1]: 'from_bam'
   [2]: 'from_reads'
   [3]: 'guci'
```

### bam2plot from_bam
```bash
usage: bam2plot [-h] -b BAM -o OUTPATH [-w WHITELIST] [-t THRESHOLD] [-r ROLLING_WINDOW]
                [-i | --index | --no-index] [-s | --sort_and_index | --no-sort_and_index]
                [-z ZOOM] [-c | --cum_plot | --no-cum_plot] [-p {png,svg,both}]
                [-n NUMBER_OF_REFS]
                sub_command

Plot your bam files!

positional arguments:
  sub_command

options:
  -h, --help            show this help message and exit
  -b BAM, --bam BAM     bam file
  -o OUTPATH, --outpath OUTPATH
                        Where to save the plots.
  -w WHITELIST, --whitelist WHITELIST
                        Only include these references/chromosomes.
  -t THRESHOLD, --threshold THRESHOLD
                        Threshold of mean coverage depth
  -r ROLLING_WINDOW, --rolling_window ROLLING_WINDOW
                        Rolling window size
  -i, --index, --no-index
                        Index bam file
  -s, --sort_and_index, --no-sort_and_index
                        Index and sort bam file
  -z ZOOM, --zoom ZOOM  Zoom into this region. Example: -z='100 2000'
  -c, --cum_plot, --no-cum_plot
                        Generate cumulative plots of all chromosomes
  -p {png,svg,both}, --plot_type {png,svg,both}
                        How to save the plots
  -n NUMBER_OF_REFS, --number_of_refs NUMBER_OF_REFS
                        How many references (chromosomes) to plot
```

bam2plot from_bam generates coverage plots:
![plot](example/normal.png)

... and if `-c` is added, cumulative coverage plots for each reference (*e.g.* chromosomes) for each sample:
![plot](example/cumplot.png)

If the flag `--highlight` is given, the regions with a coverage below the `--treshold` are highlighted:
![plot](example/highlight.png)

Below is an example of how bam2plot looks when runned in the terminal:
![plot](example/running.png)

#### Examples

Here's an example of how to use the bam2plot from_bam:

```bash
bam2plot from_bam --bam input.bam --outpath output_folder --rolling_window 50 --threshold 5 -s -c
```

### bam2plot from_reads

```bash
usage: bam2plot [-h] -r1 READ_1 [-r2 READ_2] -ref REFERENCE [-gc | --guci | --no-guci] -o OUT_FOLDER
                [-r ROLLING_WINDOW] [-p {png,svg,both}]
                sub_command

Align your reads and plot the coverage!

positional arguments:
  sub_command

options:
  -h, --help            show this help message and exit
  -r1 READ_1, --read_1 READ_1
                        Fastq file 1
  -r2 READ_2, --read_2 READ_2
                        Fastq file 2
  -ref REFERENCE, --reference REFERENCE
                        Reference fasta
  -gc, --guci, --no-guci
                        Plot GC content? (default: False)
  -o OUT_FOLDER, --out_folder OUT_FOLDER
                        Where to save the plots.
  -r ROLLING_WINDOW, --rolling_window ROLLING_WINDOW
                        Rolling window size
  -p {png,svg,both}, --plot_type {png,svg,both}
                        How to save the plots
```

### bam2plot guci

```bash
usage: bam2plot [-h] -ref REFERENCE -w WINDOW -o OUT_FOLDER [-p {png,svg,both}] sub_command

Plot GC content of your reference fasta!

positional arguments:
  sub_command

options:
  -h, --help            show this help message and exit
  -ref REFERENCE, --reference REFERENCE
                        Reference fasta
  -w WINDOW, --window WINDOW
                        Rolling window size
  -o OUT_FOLDER, --out_folder OUT_FOLDER
                        Where to save the plots.
  -p {png,svg,both}, --plot_type {png,svg,both}
                        How to save the plots
```


## Dependencies
`bam2plot` depends on [mosdepth](https://github.com/brentp/mosdepth), which you can install via:
```bash
conda install -c bioconda mosdepth
```
## Installation

You can install `bam2plot` using the following pip command:

```bash
pip install bam2plot
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/willros/bam2plot",
    "name": "bam2plot",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": null,
    "author": "William Rosenbaum",
    "author_email": "william.rosenbaum@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/d4/fe/b8eba94b023bf3eb9bb9c47080bd4aca84d6407e85d716cd42917a97ddf7/bam2plot-0.3.6.tar.gz",
    "platform": null,
    "description": "# BAM2PLOT\n\nPlot your bam files!\n\n## UPDATE\n`bam2plot` no longer depends on `perbase`. Now, `bam2plot` depends on [mosdepth](https://github.com/brentp/mosdepth)\n\n## Subcommands\n```bash\nYou must call bam2plot with the following subcommands:\n   [1]: 'from_bam'\n   [2]: 'from_reads'\n   [3]: 'guci'\n```\n\n### bam2plot from_bam\n```bash\nusage: bam2plot [-h] -b BAM -o OUTPATH [-w WHITELIST] [-t THRESHOLD] [-r ROLLING_WINDOW]\n                [-i | --index | --no-index] [-s | --sort_and_index | --no-sort_and_index]\n                [-z ZOOM] [-c | --cum_plot | --no-cum_plot] [-p {png,svg,both}]\n                [-n NUMBER_OF_REFS]\n                sub_command\n\nPlot your bam files!\n\npositional arguments:\n  sub_command\n\noptions:\n  -h, --help            show this help message and exit\n  -b BAM, --bam BAM     bam file\n  -o OUTPATH, --outpath OUTPATH\n                        Where to save the plots.\n  -w WHITELIST, --whitelist WHITELIST\n                        Only include these references/chromosomes.\n  -t THRESHOLD, --threshold THRESHOLD\n                        Threshold of mean coverage depth\n  -r ROLLING_WINDOW, --rolling_window ROLLING_WINDOW\n                        Rolling window size\n  -i, --index, --no-index\n                        Index bam file\n  -s, --sort_and_index, --no-sort_and_index\n                        Index and sort bam file\n  -z ZOOM, --zoom ZOOM  Zoom into this region. Example: -z='100 2000'\n  -c, --cum_plot, --no-cum_plot\n                        Generate cumulative plots of all chromosomes\n  -p {png,svg,both}, --plot_type {png,svg,both}\n                        How to save the plots\n  -n NUMBER_OF_REFS, --number_of_refs NUMBER_OF_REFS\n                        How many references (chromosomes) to plot\n```\n\nbam2plot from_bam generates coverage plots:\n![plot](example/normal.png)\n\n... and if `-c` is added, cumulative coverage plots for each reference (*e.g.* chromosomes) for each sample:\n![plot](example/cumplot.png)\n\nIf the flag `--highlight` is given, the regions with a coverage below the `--treshold` are highlighted:\n![plot](example/highlight.png)\n\nBelow is an example of how bam2plot looks when runned in the terminal:\n![plot](example/running.png)\n\n#### Examples\n\nHere's an example of how to use the bam2plot from_bam:\n\n```bash\nbam2plot from_bam --bam input.bam --outpath output_folder --rolling_window 50 --threshold 5 -s -c\n```\n\n### bam2plot from_reads\n\n```bash\nusage: bam2plot [-h] -r1 READ_1 [-r2 READ_2] -ref REFERENCE [-gc | --guci | --no-guci] -o OUT_FOLDER\n                [-r ROLLING_WINDOW] [-p {png,svg,both}]\n                sub_command\n\nAlign your reads and plot the coverage!\n\npositional arguments:\n  sub_command\n\noptions:\n  -h, --help            show this help message and exit\n  -r1 READ_1, --read_1 READ_1\n                        Fastq file 1\n  -r2 READ_2, --read_2 READ_2\n                        Fastq file 2\n  -ref REFERENCE, --reference REFERENCE\n                        Reference fasta\n  -gc, --guci, --no-guci\n                        Plot GC content? (default: False)\n  -o OUT_FOLDER, --out_folder OUT_FOLDER\n                        Where to save the plots.\n  -r ROLLING_WINDOW, --rolling_window ROLLING_WINDOW\n                        Rolling window size\n  -p {png,svg,both}, --plot_type {png,svg,both}\n                        How to save the plots\n```\n\n### bam2plot guci\n\n```bash\nusage: bam2plot [-h] -ref REFERENCE -w WINDOW -o OUT_FOLDER [-p {png,svg,both}] sub_command\n\nPlot GC content of your reference fasta!\n\npositional arguments:\n  sub_command\n\noptions:\n  -h, --help            show this help message and exit\n  -ref REFERENCE, --reference REFERENCE\n                        Reference fasta\n  -w WINDOW, --window WINDOW\n                        Rolling window size\n  -o OUT_FOLDER, --out_folder OUT_FOLDER\n                        Where to save the plots.\n  -p {png,svg,both}, --plot_type {png,svg,both}\n                        How to save the plots\n```\n\n\n## Dependencies\n`bam2plot` depends on [mosdepth](https://github.com/brentp/mosdepth), which you can install via:\n```bash\nconda install -c bioconda mosdepth\n```\n## Installation\n\nYou can install `bam2plot` using the following pip command:\n\n```bash\npip install bam2plot\n```\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Plot of coverage from bam file",
    "version": "0.3.6",
    "project_urls": {
        "Homepage": "https://github.com/willros/bam2plot"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "67878e8ff6525c4b8ffe988e917ee7e8c62d3ba31f37d6aecceab8547e04b442",
                "md5": "7ccb477172a4352b7eda0ac8d57bd015",
                "sha256": "19e6c72cd31318c43f511c926090136b748923151ff0c37a9da782ea4dc1359e"
            },
            "downloads": -1,
            "filename": "bam2plot-0.3.6-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "7ccb477172a4352b7eda0ac8d57bd015",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 22036,
            "upload_time": "2024-09-05T04:54:47",
            "upload_time_iso_8601": "2024-09-05T04:54:47.529591Z",
            "url": "https://files.pythonhosted.org/packages/67/87/8e8ff6525c4b8ffe988e917ee7e8c62d3ba31f37d6aecceab8547e04b442/bam2plot-0.3.6-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d4feb8eba94b023bf3eb9bb9c47080bd4aca84d6407e85d716cd42917a97ddf7",
                "md5": "f21dc294e6b48a62b59b6babec46fca3",
                "sha256": "7be991b42db59d0c06ca2f354f906238be3c4f4d0588d85dd1cfd1ec7752a541"
            },
            "downloads": -1,
            "filename": "bam2plot-0.3.6.tar.gz",
            "has_sig": false,
            "md5_digest": "f21dc294e6b48a62b59b6babec46fca3",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 22810,
            "upload_time": "2024-09-05T04:54:49",
            "upload_time_iso_8601": "2024-09-05T04:54:49.486049Z",
            "url": "https://files.pythonhosted.org/packages/d4/fe/b8eba94b023bf3eb9bb9c47080bd4aca84d6407e85d716cd42917a97ddf7/bam2plot-0.3.6.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-05 04:54:49",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "willros",
    "github_project": "bam2plot",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "bam2plot"
}
        
Elapsed time: 0.59075s