Skip to content

Coverage graph creator from BAM files (included in the SSV-Conta package)

Notifications You must be signed in to change notification settings

emlec/SSV-Coverage

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 

Repository files navigation

SSV-Coverage

Coverage graph creator from BAM files.

Motivation

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.

Principle

  1. A configuration file containing all program parameters is parsed and verified.
  2. 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.
  3. The depth of coverage can be normalized by dividing the depth at each position by the total number of sequenced bases along the sequence.
  4. The graph of coverage is created.

Only a part of the sequence can be represented in the graph.

Pre-requisites

  1. From the BAM file, reads must be aligned against only one sequence.
  2. Sequence must be in .fa.gz format.

Dependencies

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

Get SSV-Coverage

Clone the repository

$ git clone https://github.com/emlec/SSV-Coverage.git

Usage

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.

Authors and Contacts

About

Coverage graph creator from BAM files (included in the SSV-Conta package)

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%