anvi-script-get-coverage-from-bam

Get nucleotide-level, contig-level, or bin-level coverage values from a BAM file very rapidly. For other anvi'o programs that are designed to profile BAM files, see anvi-profile and anvi-profile-blitz.

🔙 To the main page of anvi’o programs and artifacts.

Authors

Requires

bam-file

Can use

collection-txt

Provides

coverages-txt

Usage

This program gets the coverage values from a bam-file, and puts them into a coverages-txt.

You must provide a BAM file, but there are three ways you can choose contigs to analyze within that file:

  1. Give a contig name. Here, you can only report coverage per nucleotide position (In this example, the user is specifically asking for this anyway with the -m flag)

    anvi-script-get-coverage-from-bam -b bam-file \ -c NAME_OF_CONTIG \ -m pos

  2. Give a file that contains a list of contigs (one per line; same format as the --contigs-of-interest tag for anvi-profile). Here, you can ask for the contig averages (as in this example) or nucleotide position coverage.

    anvi-script-get-coverage-from-bam -b bam-file \ -l NAME_OF_FILE \ -m contig

  3. Give a collection-txt file for the program to determine the coverage for all contigs in those bins. Here, you can ask for the contig averages, nucleotide position coverage or coverage per bin (as in this example).

    anvi-script-get-coverage-from-bam -b bam-file \ -C collection-txt \ -m bin

Edit this file to update this information.

Command line interface

The following is the list of parameters and their descriptions in the latest version of anvi-script-get-coverage-from-bam.

The code that generates this web page ensures that this information is the latest available in 9-dev (eunice). Which means, in some cases the information in this section (generated automatically) might be more comprehensive or up-to-date compared to the descriptions above (written by humans).


Command line usage

anvi-script-get-coverage-from-bam [-h] -b BAM_FILE [-c CONTIG_NAME] [-l CONTIGS_OF_INTEREST] [-C COLLECTION_TXT] -m {pos,contig,bin} -o OUTPUT [--skip-contigs-check]

Parameters and their descriptions

REQUIRED Declare your BAM file here
-b, --bam-file BAM_FILE required
Sorted and indexed BAM file to analyze.
OPTION #1 This is the first and simplest option. Provide a contig name
-c, --contig-name CONTIG_NAME
The name of a single contig
OPTION #2 Use this to characterize coverage for a list of contigs
-l, --contigs-of-interest CONTIGS_OF_INTEREST
Provide here a file where each line is a contig name.
OPTION #3 Use this to characterize coverage for a collection of contig sets (bins)
-C, --collection-txt COLLECTION_TXT
Provide a collection text file. The first column should be contig names and the second column should be the bin to which the contig belongs. If you have a collection from a profile database, you can export it in this format with anvi-export-collection.
METHOD Do you want to report coverage at a nucleotide level? Contig averages? Bin averages? Pick the method here.
-m, --method METHOD required
If pos, each nucleotide position will be reported (valid for OPTION #1, #2, #3). If contig, report contains contig averages (valid for OPTION #2, #3). If bin, report contains bin averages (valid for OPTION #3). Choices: pos contig bin
OUTPUT Your output file is decided here. Keep in mind if you use --method pos, this file will contain as many lines as there are nucleotides defined by your input option
-o, --output OUTPUT required
Output tab-delimited file path. Will overwrite existing files.
EXTRAS All the misfits
--skip-contigs-check
Checking to see that your collection text or contigs of interest file has correct names can take a really long time if you have a large enough number of contigs. Use this flag to forego checking, and find out the hard way.

Additional Resources

Are you aware of resources that may help users better understand the utility of this program? Please feel free to edit this file on GitHub. If you are not sure how to do that, find the __resources__ tag in this file to see an example.