anvi-export-locus

This program helps you cut a 'locus' from a larger genetic context (e.g., contigs, genomes). By default, anvi'o will locate a user-defined anchor gene, extend its selection upstream and downstream based on the –num-genes argument, then extract the locus to create a new contigs database. The anchor gene must be provided as –search-term, –gene-caller-ids, or –hmm-sources. If –flank-mode is designated, you MUST provide TWO flanking genes that define the locus region (Please see –flank-mode help for more information). If everything goes as plan, anvi'o will give you individual locus contigs databases for every matching anchor gene found in the original contigs database provided. Enjoy your mini contigs databases!.

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

Authors

Requires

contigs-db

Provides

locus-fasta

Usage

This program lets you export selections of your contigs-db around all occurances of a user-defined anchor gene.

The output of this is a folder that contains a separate contigs-db for the region around each hit of the anchor gene. (In fact, you’ll get a FASTA file, contigs-db, profile-db, and a copy of the runlog).

For example, you could specify the recognition site for a specific enzyme and use this program to pull out all potential sites where that enzyme could bind.

Required Parameters

You’ll need to provide a contigs-db (of course), as well as the name of the output directory and a prefix to use when naming all of the output databases.

You can define the region of interest either by defining the two flanking genes or by searching for an anchor gene and defining a number of genes around this gene that you want to look at. For example, if you set num-genes as 1, then each locus will contain the gene of interest, a gene upstream of it, and a gene downstream of it, for a total of three genes.

Defining the region of interest

There are four ways to indicate the desired anchor gene:

  1. Provide a search term in the functional annotations of all of your genes. (If you’re trying to find a gene with a vague function, you might want to use anvi-search-functions to find out which genes will show up first. Alternatively, you can you anvi-export-functions to look at a full list of the functional annotaitons in this database).

    anvi-export-locus -c contigs-db \ --num-genes 2 \ -o GLYCO_DIRECTORY \ -O Glyco \ --search-term “Glycosyltransferase involved in cell wall bisynthesis” \

    You also have the option to specify an annotation source with the flag --annotation source

  2. Provide a specific gene caller ID.

    anvi-export-locus -c contigs-db \ --num-genes 2 \ -o output_directory \ -O GENE_1 \ --gene-caller-ids 1

  3. Provide a search term for the HMM source annotations. To do this, you must also specify an hmm-source. (You can use the flag --list-hmm-sources to list the available sources).

    anvi-export-locus -c contigs-db \ --num-genes 2 \ -o Ribosomal_S20p \ -O Ribosomal_S20p \ --use-hmm \ --hmm-source Bacteria_71 \ --search-term Ribosomal_S20p

    1. Run in flank-mode and provide two flanking genes that define the locus region.

    anvi-export-locus -c contigs-db \ --flank-mode \ -o locus_output \ -O gyclo_to_acyl \ --search-term “Glycosyltransferase involved in cell wall bisynthesis”,”Acyl carrier protein” \

Additional Options

You can also remove partial hits, ignore reverse complement hits, or overwrite all files in a pre-existing output.

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-export-locus.

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-export-locus [-h] -c CONTIGS_DB [-s SEARCH_TERM] [--case-sensitive] [--exact-match] [--hmm-sources HMM_ANNOTATION_SOURCE[S]] [--annotation-sources FUNCTION_ANNOTATION_SOURCE[S]] [--use-hmm] [-l] [--gene-caller-ids GENE_CALLER_IDS] [-o DIR_PATH] -O FILENAME_PREFIX [--flank-mode] [-n NUM_GENES] [--remove-partial-hits] [--delimiter CHAR] [--never-reverse-complement]

Parameters and their descriptions

INPUT DATABASE
-c, --contigs-db CONTIGS_DB required
Anvi'o contigs database generated by 'anvi-gen-contigs-database'
ANCHOR GENE IDENTIFICATION OPTION #1 Search based on gene function annotations or HMMs
-s, --search-term SEARCH_TERM
Search term to be found in function annotation sources.
--case-sensitive
When declared, anvi'o will perform a search that is case sensitive.
--exact-match
By default, anvi'o will search for a given string in anywhere within function description or accession IDs. If you declare this flag, then anvi'o will look for 'exact' matches of the search string in its entirety in a given field. This can be very useful if you are CERTAIN about the function or accession id you are interested in, and you want to get nothing but that exact match.
--hmm-sources HMM_ANNOTATION_SOURCE[S]
Get sequences for a specific list of HMM sources. You can list one or more sources by separating them from each other with a comma character (i.e., '--hmm-sources source_1,source_2,source_3'). If you would like to see a list of available sources in the contigs database, run this program with '--list-hmm-sources' flag.
--annotation-sources FUNCTION_ANNOTATION_SOURCE[S]
Get functional annotations for a specific list of annotation sources. You can specify one or more sources by separating them from each other with a comma character (i.e., '--annotation-sources source_1,source_2,source_3'). The default behavior is to return everything
--use-hmm
Use HMM hits instead of functional annotations. In other words, --search-term will be queried against HMM source annotations, NOT functional annotations. If you choose this option, you must also say which HMM source to use.
-l, --list-hmm-sources
List available HMM sources in the contigs database and quit.
ANCHOR GENE IDENTIFICATION OPTION #2 Search based on gene caller id(s)
--gene-caller-ids GENE_CALLER_IDS
Gene caller ids to focus on. Multiple of them can be declared separated by a delimiter (the default is a comma, and if there is no option to change the delimiter, you must use a comma).In anvi-gen-variability-profile, if you declare nothing you will get all genes matching your other filtering criteria. In other programs, you may get everything, nothing, or an error. It really depends on the situation. Fortunately, mistakes are cheap, so it's worth a try.
THE OUTPUT Where should the output go. It will be one FASTA file with all matches or one FASTA per match (see --separate-fasta)
-o, --output-dir DIR_PATH
Directory path for output files
-O, --output-file-prefix FILENAME_PREFIX required
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 STUFF Flags and parameters you can set according to your need
--flank-mode
If in --flank-mode, anvi-export-locus will extract a locus based on the coordinates of flanking genes. You MUST provide 2 flanking genes in the form of TWO --search-term, --gene-caller-ids, or --hmm-sources. The --flank-mode option is appropriate for extracting loci of variable gene number lengths, but are consistently located between the same flanking genes in the genome(s) of interest.
-n, --num-genes NUM_GENES
Required for DEFAULT mode. For each match (to the function, or HMM that was searched) a sequence which includes a block of genes will be saved. The block could include either genes only in the forward direction of the gene (defined according to the direction of transcription of the gene) or reverse or both. If you wish to get both direction use a comma (no spaces) to define the block For example, '-n 4,5' will give you four genes before and five genes after. Whereas, '-n 5' will give you five genes after (in addition to the gene that matched). To get only genes preceding the match use '-n 5,0'. If the number of genes requested exceeds the length of the contig, then the output will include the sequence until the end of the contig.
--remove-partial-hits
By default anvi'o will return hits even if they are partial. Declaring this flag will make anvi'o filter all hits that are partial. Partial hits are hits in which you asked for n1 genes before and n2 genes after the gene that matched the search criteria but the search hits the end of the contig before finding the number of genes that you asked.
--delimiter CHAR
The delimiter to parse multiple input terms. The default is ','. Default: ,
--never-reverse-complement
By default, if a gene that is found by the search criteria is reverse in it's direction, then the sequence of the entire locus is reversed before it is saved to the output. If you wish to prevent this behavior then use the flag --never-reverse-complement.

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.