anvi-analyze-synteny

Extract ngrams, as in 'co-occurring genes in synteny', from genomes.

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

Authors

Requires

genomes-storage-db pan-db

Can use

functions

Provides

ngrams

Usage

Briefly, anvi-analyze-synteny counts ngrams by converting contigs into strings of annotations for a given user-defined source of gene annotation. A source annotation for functions must be provided to create ngrams, upon which anvi’o will use a sliding window of size N to deconstruct the loci of interest into ngrams and count their frequencies.

Run for a given function annotation source

anvi-analyze-synteny -g genomes-storage-db \ --annotation-source functions \ --ngram-window-range 2:3 \ -o ngrams

For instance, if you have run anvi-run-ncbi-cogs on each contigs-db you have used to generate your genomes-storage-db, your --annotation-source can be NCBI_COGS:

anvi-analyze-synteny -g genomes-storage-db \ --annotation-source NCBI_COGS \ --ngram-window-range 2:3 \ -o ngrams

Handling genes with unknown functions

By default, anvi-analyze-synteny will ignore genes with unknown functions based on the annotation source of interest. However, this can be circumvented either by providing a pan-db, so the program would use gene cluster identities as function names:

anvi-analyze-synteny -g genomes-storage-db \ -p pan-db \ --ngram-window-range 2:3 \ -o ngrams

or by explicitly asking the program to consider unknown functions, in which case the program would not discard ngrams that include genes without functions:

anvi-analyze-synteny -g genomes-storage-db \ --annotation-source functions \ --ngram-window-range 2:3 \ -o ngrams \ --analyze-unknown-functions

The disadvantage of the latter strategy is that since all genes with unknown functions will be considered the same, the frequency of ngrams that contain genes with unknown functions may be inflated in your final results.

Run with multiple annotations

If multiple gene annotation sources are provided (i.e., a pangenome for gene clusters identities as well as a functional annotation source), the user must define which annotation source will be used to create the ngrams using the parameter --ngram-source. The resulting ngrams will then be re-annotated with the second annotation source and also reported.

anvi-analyze-synteny -g genomes-storage-db \ -p pan-db \ --annotation-source functions \ --ngram-source gene_clusters \ --ngram-window-range 2:3 \ -o ngrams

Test cases for developers

If you are following the anvi’o master branch on your computer, you can create a test case for this program.

First, go to any work directory, and run the following commands:

anvi-self-test --suite metagenomics-full \
               --output-dir TEST_OUTPUT

Run one or more alternative scenarios and check output files:

anvi-analyze-synteny -g TEST_OUTPUT/TEST-GENOMES.db \
                     --annotation-source COG20_FUNCTION \
                     --ngram-window-range 2:3 \
                     -o TEST_OUTPUT/synteny_output_no_unknowns.tsv

anvi-analyze-synteny -g TEST_OUTPUT/TEST-GENOMES.db \
                     --annotation-source COG20_FUNCTION \
                     --ngram-window-range 2:3 \
                     -o TEST_OUTPUT/synteny_output_with_unknowns.tsv \
                     --analyze-unknown-functions

anvi-analyze-synteny -g TEST_OUTPUT/TEST-GENOMES.db \
                     --annotation-source COG20_FUNCTION \
                     --ngram-window-range 2:3 \
                     -o TEST_OUTPUT/tsv.txt \
                     --analyze-unknown-functions

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-analyze-synteny.

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-analyze-synteny [-h] -g GENOMES_STORAGE [--ngram-window-range NGRAM_WINDOW_RANGE] [-o FILE_PATH] [--annotation-source FUNCTION_ANNOTATION_SOURCE] [-p PAN_DB] [-n NGRAM_SOURCE] [-l] [--analyze-unknown-functions] [-G GENOME_NAMES] [--first-functional-hit-only]

Parameters and their descriptions

Essential INPUT
-g, --genomes-storage GENOMES_STORAGE required
Anvi'o genomes storage file
--ngram-window-range NGRAM_WINDOW_RANGE
The range of window sizes of Ngrams to analyze for synteny patterns.Please format the window-range as x:y (e.g. Window sizes 2 to 4 would be denoted as: 2:4) Default: 2:3
-o, --output-file FILE_PATH
File path to store results.
Annotation sources for Ngrams Choose one source of annotations for your Ngrams.
--annotation-source FUNCTION_ANNOTATION_SOURCE
Get functional annotations for a specific annotation source. You can use the flag '--list-annotation-sources' to learn about what sources are available.
-p, --pan-db PAN_DB
Anvi'o pan database
-n, --ngram-source NGRAM_SOURCE
If two annotation sources are provided, please choose one annotation source that will be used to calcuate Ngrams (e.g. gene_clusters, COG_FUNCTION)
Optional arguments
-l, --list-annotation-sources
List available functional annotation sources.
--analyze-unknown-functions
Provide this flag if you want anvi-analyze-synteny to report Ngrams that contain gene calls that have no annotation.
-G, --genome-names GENOME_NAMES
Genome names to 'focus'. You can use this parameter to limit the genomes included in your analysis. You can provide these names as a comma-separated list of names, or you can put them in a file, where you have a single genome name in each line, and provide the file path.
--first-functional-hit-only
Use this flag if you want to use on the first functional annotation when making ngrams and assigning annotations. In some cases, anvio reports more than one annotation when there are multiple good hits to the gene. When this happens, all annotations will be reported in order of alignment score and delimited by '!!!' e.g. 'COG123!!!COG456!!!COG789'. This flag will report 'COG123!!!COG456!!!COG789' as 'COG123'.

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.