anvi-get-short-reads-mapping-to-a-gene

Recover short reads from BAM files that were mapped to genes you are interested in. It is possible to work with a single gene call, or a bunch of them. Similarly, you can get short reads from a single BAM file, or from many of them.

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

Authors

Requires

contigs-db bam-file

Provides

short-reads-fasta

Usage

This program finds all short reads from (bam-file) that align to a specific gene and returns them as a short-reads-fasta.

If instead you want to extract these short reads from a FASTQ file, get your gene sequence with anvi-export-gene-calls and take a look at anvi-search-primers.

To run this program, just specify the bam files you’re looking at and the gene of interest. To do this, name the contigs-db containing your gene and the gene caller ID (either directly through the parameter --gene-caller-id or through a file). Here is an example:

anvi-get-short-reads-mapping-to-a-gene -c contigs-db \ --gene-caller-id 2 \ -i BAM_FILE_ONE.bam \ -O GENE_2_MATCHES

The output of this will be a file named GENE_2_MATCHES_BAM_FILE_ONE.fasta (prefix + bam file name), which will contain all short reads that aligned to gene 2 with more than 100 nucleotides.

You also have the option to provide multiple bam files; in this case, there will be an output files for each bam file inputted.

Additionally, you can change the number of nucleotides required to map to a short read for it to be reported. For example, to expand your search, you could decrease the required mapping length to 50 nucleotides, as so:

anvi-get-short-reads-mapping-to-a-gene -c contigs-db \ --gene-caller-id 2 \ -i Bam_file_one.bam Bam_file_two.bam \ -O GENE_2_MATCHES \ --leeway 50

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-get-short-reads-mapping-to-a-gene.

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-get-short-reads-mapping-to-a-gene [-h] -c CONTIGS_DB -i INPUT_BAM(S) [INPUT_BAM(S) ...] [--gene-caller-id GENE_CALLER_ID] [--genes-of-interest FILE] [--leeway LEEWAY_NTs] [-O FILENAME_PREFIX]

Parameters and their descriptions

INPUT FILES An anvi'o contigs database and one or more BAM files.
-c, --contigs-db CONTIGS_DB required
Anvi'o contigs database generated by 'anvi-gen-contigs-database'
-i, --input-files INPUT_BAM(S) required
Sorted and indexed BAM files to analyze. It is essential that all BAM files must be the result of mappings against the same contigs.
GENES Gene calls you want to work with
--gene-caller-id GENE_CALLER_ID
A single gene id.
--genes-of-interest FILE
A file with anvi'o gene caller IDs. There should be only one column in the file, and each line should correspond to a unique gene caller id (without a column header).
--leeway LEEWAY_NTS
The minimum number of nucleotides for a given short read mapping into the gene context for it to be reported. You must consider the length of your short reads, as well as the length of the gene you are targeting. The default is 100 nts. Default: 100
OUTPUT How should results be stored.
-O, --output-file-prefix FILENAME_PREFIX
A prefix to be used while naming the output files. No file type extensions please; just a prefix -- all ouptut file names and extensions will be appended to this prefix.

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.