Coverage graph creator from BAM files.
SSV-Coverage is a python 3 script developed to create coverage graph from BAM files containing read alignments.
Depth can be performed using bedtools genomecov or pysam.
The coverages can be normalized to represent samples with very distant sequencing depths.
- A configuration file containing all program parameters is parsed and verified.
- BAM files are used to determine the depth of coverage at each position in the sequence, using bedtools genomecov or pysam. This depth is written in a depth file.
- The depth of coverage can be normalized by dividing the depth at each position by the total number of sequenced bases along the sequence.
- The graph of coverage is created.
Only a part of the sequence can be represented in the graph.
- From the BAM file, reads must be aligned against only one sequence.
- Sequence must be in .fa.gz format.
The following dependencies are required for proper program execution:
- matplotlib
- bedtools and/or pysam
- biopython
Standard library imports: sys, os, argparse, subprocess, pathlib, time, gzip, datetime, configparser
Clone the repository
$ git clone https://github.com/emlec/SSV-Coverage.git
Prepare the configuration file including files and settings as indicated in the template Conf.txt.
usage: SSV-Coverage.py -c Conf.txt [-i -h]
Coverage graph creator from BAM files.
optional arguments:
-h, --help show this help message and exit
--version show program's version number and exit
-i BAM_NUMBER Generate an empty configuration file adapted to the number of
bam files to create coverage graph and exit. [Mandatory]
-c CONF_FILE Path to the configuration file [Mandatory]
An empty configuration file can be generated by running the program with the option -i
.
All options are extensively described in the configuration file.
The test files present in the folder /test/dataset/ can be used to control the installation of the SSV-Coverage program.
$ cd ./test/dataset/
SSV-Coverage.py -c example_conf_file.txt
The expected results are presents in the folder expected_results.
- Emilie Lecomte [email protected] @emlec
- Mathieu Bolteau [email protected] @mablt