Skip to main content

Plot of coverage from bam file

Project description

BAM2PLOT

Plot your bam files!

UPDATE

bam2plot no longer depends on perbase. Now, bam2plot depends on mosdepth

Subcommands

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

bam2plot from_bam

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

... and if -c is added, cumulative coverage plots for each reference (e.g. chromosomes) for each sample: plot

If the flag --highlight is given, the regions with a coverage below the --treshold are highlighted: plot

Below is an example of how bam2plot looks when runned in the terminal: plot

Examples

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

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

bam2plot from_reads

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

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, which you can install via:

conda install -c bioconda mosdepth

Installation

You can install bam2plot using the following pip command:

pip install bam2plot

Project details


Download files

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

Source Distribution

bam2plot-0.3.6.tar.gz (22.8 kB view details)

Uploaded Source

Built Distribution

bam2plot-0.3.6-py3-none-any.whl (22.0 kB view details)

Uploaded Python 3

File details

Details for the file bam2plot-0.3.6.tar.gz.

File metadata

  • Download URL: bam2plot-0.3.6.tar.gz
  • Upload date:
  • Size: 22.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for bam2plot-0.3.6.tar.gz
Algorithm Hash digest
SHA256 7be991b42db59d0c06ca2f354f906238be3c4f4d0588d85dd1cfd1ec7752a541
MD5 f21dc294e6b48a62b59b6babec46fca3
BLAKE2b-256 d4feb8eba94b023bf3eb9bb9c47080bd4aca84d6407e85d716cd42917a97ddf7

See more details on using hashes here.

File details

Details for the file bam2plot-0.3.6-py3-none-any.whl.

File metadata

  • Download URL: bam2plot-0.3.6-py3-none-any.whl
  • Upload date:
  • Size: 22.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for bam2plot-0.3.6-py3-none-any.whl
Algorithm Hash digest
SHA256 19e6c72cd31318c43f511c926090136b748923151ff0c37a9da782ea4dc1359e
MD5 7ccb477172a4352b7eda0ac8d57bd015
BLAKE2b-256 67878e8ff6525c4b8ffe988e917ee7e8c62d3ba31f37d6aecceab8547e04b442

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page