5.4. Coverage module exampleΒΆ

from sequana import GenomeCov
from sequana import sequana_data
bedfile = sequana_data("JB409847.bed")

Reading input BED file

gc = GenomeCov(bedfile)

Select a chromosome (first and only one in that example)

chrom = gc[0]
print(chrom)

Out:

  Genome length: 19795
Sequencing depth (DOC):   931.31
Sequencing depth (median):   988.00
Breadth of coverage (BOC) (percent): 96.60
Genome coverage standard deviation :   237.15
Genome coverage coefficient variation :     0.25

Compute running median and zscore telling the algorithm that the chromosome is circular.

chrom.running_median(n=5001, circular=True)
chrom.compute_zscore()
print(chrom.get_centralness())

Out:

0.868451629199

Plotting

chrom.plot_coverage()
../_images/sphx_glr_plot_coverage_001.png

Total running time of the script: (0 minutes 1.343 seconds)

Download Python source code: plot_coverage.py
Download IPython notebook: plot_coverage.ipynb