Skip to content

yhoogstrate/bam-lorenz-coverage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

60 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bam-lorenz-coverage

Python 3 License: GPL-3.0 DOI: 10.1093/gigascience/giab080

A tool to generate Lorenz plots and coverage plots directly from a BAM file, using Python3, Matplotlib, Pysam and Click. Raw data tables can be exported for custom plotting, and analysis can be restricted to specific regions via a region string or BED file.

How it works

Citing bam-lorenz-coverage

When using bam-lorenz-coverage for scientific applications, please cite the following manuscript:

10.1093/gigascience/giab080

Hoogstrate Y; Komor MA; Böttcher R; van Riet J; van de Werken HJG;
van Lieshout S; Hoffmann R; van den Broek E; Bolijn AS; Dits N; Sie D;
van der Meer D; Pepers F; Bangma CH; van Leenders GJLH; Smid M;
French PJ; Martens JWM; van Workum W; van der Spek PJ; Janssen B;
Caldenhoven E; Rausch C; de Jong M; Stubbs AP; Meijer GA; Fijneman RJA;
Jenster GW:

Fusion transcripts and their genomic breakpoints in poly(A)+ and
rRNA-minus RNA sequencing data. GigaScience (2021).

http://dx.doi.org/10.1093/gigascience/giab080

This will indirectly help me further maintaining this software package. Thank you in advance, Youri

Installation

$ git clone https://github.com/yhoogstrate/bam-lorenz-coverage.git
$ cd bam-lorenz-coverage
$ ./scripts/install.sh

$ bam-lorenz-coverage --help

Possible issues:

  • python3-venv may need to be installed separately on Debian/Ubuntu: sudo apt install python3-venv
  • matplotlib depends on Tk but does not throw an error if it is missing during installation, only at runtime
    • debian/ubuntu: sudo apt-get install python3-tk
    • arch: pacman -Sy tk

Usage:

Usage: bam-lorenz-coverage [OPTIONS] INPUT_ALIGNMENT_FILE

Options:
  --version                  Show the version and exit.
  -l, --lorenz-table TEXT    Output table Lorenz-curve (for stdout use: -)
  -c, --coverage-table TEXT  Output table Coverage-graph (for stdout use: -)
  -L, --lorenz-svg TEXT      Output figure Lorenz-curve (SVG).
  -C, --coverage-svg TEXT    Output figure Coverage-graph (SVG).
  -s, --stats TEXT           Output additional stats to text-file
  -r, --region TEXT          Scan depth only in selected region <chr:from-to>
                             (all positions: 1-based)
  -b, --bed-regions TEXT     Scan depth only in selected positions or regions
                             (BED file: start: 0-based & end: 1-based)
  --help                     Show this message and exit.

The lowercase arguments (-l, -c) allow extraction of the raw data tables for custom plotting. The uppercase arguments (-L, -C) directly generate a plot. The implemented plot only contains one sample per plot. For multi-sample plots, use the column tables and your imagination.

Examples:

Default:

The default SVG output figures (-C, -L) show one sample per figure, and look as follows:

Default Lorenz plot

Default Coverage plot

Custom, using the tables:

Using the output tables (-l, -c) you can also create custom plots, for instance:

Custom multi-sample plots of the tables

About

Generate Lorenz plots and Coverage plots directly from BAM files

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors