anvi-reaction-network

This program generates a metabolic reaction network in an anvi'o contigs or pan database.

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

Authors

Requires

kegg-functions

Can use

contigs-db enzymes-txt reaction-ref-data kegg-data

Provides

reaction-network

Usage

This program stores a metabolic reaction-network in a contigs-db or pan-db.

The network consists of data on biochemical reactions predicted to be encoded by the genome or pangenome.

Information on the predicted reactions and the involved metabolites are stored in tables of the contigs-db or pan-db. The program, anvi-get-metabolic-model-file, can be used to export the reaction-network from the database to a reaction-network-json file formatted for input into programs for flux balance analysis.

Setup

anvi-setup-kegg-data downloads, among other files, the binary relations files needed to construct a reaction-network from KEGG Orthology (KO) sequence annotations. The following command sets up the database in a default anvi’o directory.

anvi-setup-kegg-data

anvi-setup-modelseed-database sets up the ModelSEED Biochemistry database, which harmonizes biochemical data from various reference databases, including KEGG. The following command sets up the database in a default anvi’o directory.

anvi-setup-modelseed-database

Download newest available KEGG files

Alternatively, KEGG data can be set up not from a snapshot but by downloading the newest files available from KEGG using the -D flag. In the following command, a higher number of download threads than the default of 1 is provided by -T, which significantly speeds up downloading.

anvi-setup-kegg-data -D -T 5

Install in non-default location

To preserve KEGG data that you already have set up for whatever reason, the new snapshot or download can be placed in a non-default location using the option, --kegg-data-dir.

anvi-setup-kegg-data --kegg-data-dir path/to/other/directory

anvi-reaction-network requires a --kegg-dir argument to seek KEGG data in a non-default location.

Likewise, different versions of the ModelSEED Biochemistry database can be set up in non-default locations and used with the --modelseed-dir argument.

anvi-setup-modelseed-database --dir path/to/other/directory

Usage

From an enzymes file (no contigs database needed)

anvi-reaction-network can build a reaction network directly from a tab-delimited enzymes file — no contigs database required. This is useful when working with custom enzyme lists from transcriptomic/proteomic data, ancestral gene content predictions, or any other source outside of anvi’o’s standard annotation workflow.

The enzymes file must have three columns: gene_id, enzyme_accession, and source. Only rows where source is KOfam are used. This is the same format used by anvi-estimate-metabolism.

anvi-reaction-network --enzymes-txt /path/to/enzymes.txt \ --output-json /path/to/network.json

The resulting JSON file can be directly used by anvi-draw-kegg-pathways via its --reaction-network-json option:

anvi-draw-kegg-pathways --reaction-network-json /path/to/network.json \ -o output_maps/

From a contigs database

anvi-reaction-network takes a either a contigs-db OR a pan-db and genomes-storage-db as required input. Genes stored within the contigs-db or genomes-storage-db must have KO protein annotations, which can be assigned by anvi-run-kegg-kofams.

anvi-reaction-network -c /path/to/contigs-db

If a contigs-db already contains a reaction-network from a previous run of this program, the flag --overwrite-existing-network can overwrite the existing network with a new one. For example, if anvi-run-kegg-kofams is run again on a database using a newer version of KEGG, then anvi-reaction-network should be rerun to update the reaction-network derived from the KO annotations.

anvi-reaction-network -c /path/to/contigs-db \ --overwrite-existing-network

A reaction-network can also be generated from consensus KO annotations of gene clusters. This can be used to understand the conservation or divergence of parts of the metabolic network between organisms in the pangenome.

anvi-reaction-network -p /path/to/pan-db \ -g /path/to/genomes-storage-db

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-reaction-network.

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-reaction-network [-h] [--enzymes-txt FILE] [--output-json FILE] [-c CONTIGS_DB] [-p PAN_DB] [-g GENOMES_STORAGE] [--consensus-threshold FLOAT] [--discard-ties] [--kegg-dir PATH] [--modelseed-dir PATH] [--overwrite-existing-network] [--stats-file PATH]

Parameters and their descriptions

ENZYMES FILE INPUT Generate a reaction network from a tab-delimited enzymes file, bypassing the need for a contigs database. This enables reaction networks from custom enzyme lists such as transcriptomic/proteomic data or LCA gene content predictions. The file must have columns 'gene_id', 'enzyme_accession', and 'source'; only rows with source 'KOfam' are used. See 'anvi-estimate-metabolism' for the full enzymes-txt format specification.
--enzymes-txt FILE
Path to a tab-delimited enzymes file with required columns 'gene_id', 'enzyme_accession', and 'source'. Rows where 'source' is 'KOfam' are used to build the reaction network. Use '--output-json' to specify where the resulting network file is written.
--output-json FILE
Path for the output reaction network JSON file. Required when using '--enzymes-txt'. The file can be loaded by 'anvi-draw-kegg-pathways' via its '--reaction-network-json' option.
SINGLE GENOME OR METAGENOME INPUT Generate a reaction network from a contigs database and store the network in the database.
-c, --contigs-db CONTIGS_DB
Anvi'o contigs database generated by 'anvi-gen-contigs-database'
PANGENOME INPUT Generate a reaction network from a pan database and associated genomes storage database, and store the network in the pan database.
-p, --pan-db PAN_DB
Anvi'o pan database
-g, --genomes-storage GENOMES_STORAGE
Anvi'o genomes storage file
--consensus-threshold FLOAT
If this argument is provided, then a protein annotation must be assigned to this minimum proportion of genes in a cluster to be imputed to the cluster as a whole. By default, without this argument, the annotation assigned to the most genes becomes the annotation of the cluster (also see --discard-ties). The consensus threshold must be a number from 0 to 1.
--discard-ties
By default, a gene cluster is assigned a protein annotation by finding the protein ortholog that occurs in the greatest number of genes in the cluster (see --consensus-threshold) and arbitrarily choosing one ortholog in case of a tie. With this flag, a tie instead results in an ortholog annotation not being assigned to the cluster.
DATABASE KEGG and ModelSEED reference database information
--kegg-dir PATH
Path to KEGG database directory. If this option is not used, the program expects a database set up in the default location used by 'anvi-setup-kegg-data'.
--modelseed-dir PATH
Path to ModelSEED Biochemistry database directory. If this option is not used, the program expects a database set up in the default location used by 'anvi-setup-modelseed-database'.
OTHER OPTIONS
--overwrite-existing-network
Overwrite an existing reaction network in the database (for contigs/pan DB modes) or overwrite the output JSON file (for enzymes-txt mode) if it already exists.
--stats-file PATH
Write a tab-delimited file of network overview statistics (statistics also printed to the terminal) to the output path.

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.