anvi-script-filter-hmm-hits-table

Filter weak HMM hits from a given contigs database using a domain hits table reported by anvi-run-hmms..

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

Authors

Requires

contigs-db

Can use

hmm-source hmm-hits

Provides

hmm-hits

Usage

This program allows you to remove low quality HMM alignments from a hmm-source in a contigs-db with HMM alignment parameters such as model-coverage (query-coverage) and gene-coverage (target-coverage), or by removing partial genes (i.e., genes that are not partial and that start with a start codon and end with a stop codon). Briefly, the program will remove all records from an hmm-source in the hmm-hits, then import a new hmm-hits table into the contigs-db that was filtered to your specifications.

Filter with HMM alignment parameters

Similar to query coverage in BLAST, we can also use HMM alignment coverage to help determine if an hmm-hit is homologous. A small alignment coverage value means only a small proportion of the query/target is aligning. Before anvi’o can filter out hmm-hits with alignment coverage, you must run anvi-run-hmms and report a domain hits table by including --domain-hits-table flag in your command. This will write the domtblout file from hmmsearch:

anvi-run-hmms -c contigs-db \ -I Bacteria_71 \ --hmmer-output-dir path/to/dir --domain-hits-table

After the command above, your hmm-hits will be stored in your contigs-db as usual. However, with the domain hits table, you can filter out hits from your contigs-db using thresholds for --min-model-coverage or --min-model-coverage of each hit i.e. you can filter out hmm-hits where the profile HMM and gene align well to each other.

For example, following the command above, the command below will remove hmm-hits from your contigs-db for profile HMMs that had less than 90% model coverage and 50% gene coverage:

anvi-script-filter-hmm-hits-table -c contigs-db \ --hmm-source Bacteria_71 \ --domain-hits-table path/to/dir/hmm.domtable \ --min-model-coverage 0.9 \ --min-gene-coverage 0.5

HMMs with multiple hits to one gene

Some HMM profiles align multiple times to the same gene at different coordinates. The program anvi-script-filter-hmm-hits-table by default will use only one of those domain hits table records which could represent very little alignment coverage. To combine the domain hits table records into one hit and thus increasing alignment coverage, use the parameter --merge-partial-hits-within-X-nts. Briefly, if you give the parameter --merge-partial-hits-within-X-nts 300, anvi-script-filter-hmm-hits-table will merge all hits to the same gene in the domain hits table that have coordinates within 300 nucleotides of each other.

anvi-script-filter-hmm-hits-table -c contigs-db \ --hmm-source Bacteria_71 \ --domain-hits-table path/to/dir/hmm.domtable \ --merge-partial-hits-within-X-nts

The input domtblout file for anvi-script-filter-hmm-hits-table will be saved as hmm.domtable.orig and the output, filtered version will be saved as hmm.domtable. If you decide to change the coverage filtering threshold or --merge-partial-hits-within-X-nts, be sure to change the path for --domain-hits-table to hmm.domtable.orig.

Filter out hmm-hits from partial genes

HMMs are able to detect partial genes (i.e., genes that do not contain start and/or stop codons) with good alignment coverage and homology statistics. However, partial genes can lead to spurious phylogenetic branches and/or inflate the number of observed populations or functions in a given set of genomes/metagenomes. Using --filter-out-partial-gene-calls, you can remove partial gene hmm-hits.

anvi-script-filter-hmm-hits-table -c contigs-db \ --hmm-source Bacteria_71 \ --domain-hits-table path/to/dir/hmm.domtable \ --filter-out-partial-gene-calls

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-filter-hmm-hits-table.

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-filter-hmm-hits-table [-h] -c CONTIGS_DB [--hmm-source HMM_ANNOTATION_SOURCE] [-l] [-H HMM PROFILE PATH] [--domain-hits-table PATH] [--min-gene-coverage MIN_GENE_COVERAGE] [--min-model-coverage MIN_MODEL_COVERAGE] [--merge-partial-hits-within-X-nts LENGTH] [--filter-out-partial-gene-calls]

Parameters and their descriptions

options
-c, --contigs-db CONTIGS_DB required
Anvi'o contigs database generated by 'anvi-gen-contigs-database'
--hmm-source HMM_ANNOTATION_SOURCE
Use a specific HMM source. You can use '--list-hmm-sources' flag to see a list of available resources. The default is 'None'.
-l, --list-hmm-sources
List available HMM sources in the contigs database and quit.
-H, --hmm-profile-dir HMM PROFILE PATH
You can use this parameter you can specify a directory path that contain an HMM profile. This way you can run HMM profiles that are not included in anvi'o. See the online to find out about the specifics of this directory structure .
--domain-hits-table PATH
Please provide the path to the domain-table-output. You can get this file from running anvi-run-hmms with the flag --domain-hits-table.
--min-gene-coverage MIN_GENE_COVERAGE
The minimum percent of the gene that is covered by the profile HMM after hmmsearch. This is the formula using the domtblout from hmmsearch: (ali_coord_to - ali_coord_from)/target_length
--min-model-coverage MIN_MODEL_COVERAGE
The minimum percent of the profile HMM model that is covered by the gene after hmmsearch. This is the formula using the domtblout from hmmsearch: (hmm_coord_to - hmm_coord_from)/hmm_length
--merge-partial-hits-within-X-nts LENGTH
Filtering HMM hits based on target or query coverage can be difficult when a gene is covered by multiple independent hits of a single model. In these cases, the best way forward is to merge independent hits if they are close enough (for instance, if model X covers a gene A between nucleotide positions 0 and 100, and then again between nucleotide positions 105 and 200, one would like to merge those two hits into a single one before calculating the approximate coverage of the gene by the model). If you set this parameter to any distance, anvi'o will first merge independent hits for the same gene/model that are closer to each other than that distance. Default: 0
--filter-out-partial-gene-calls
Partial genes can lead to spurious branches and/or inflate the number of observed populations or functions in a given set of genomes/metagenomes. Using this flag you can instruct anvi'o to only keep HMM hits from open reading frames that represent complete genes (i.e., genes that are not partial and that start with a start codon and end with a stop codon).

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.