### Run All Predictions Source: https://gapseq.readthedocs.io/en/latest/_sources/usage/basics.md.txt Execute all prediction steps with a single command. This is a quick way to get started. ```bash ./gapseq doall toy/myb71.faa.gz ``` -------------------------------- ### Test Gapseq Installation on Ubuntu/Debian/Mint Source: https://gapseq.readthedocs.io/en/latest/_sources/install.md.txt Runs a test command to verify the Gapseq installation. ```sh ./gapseq test ``` -------------------------------- ### Install Gapseq Dependencies on Ubuntu/Debian/Mint Source: https://gapseq.readthedocs.io/en/latest/_sources/install.md.txt Installs system dependencies, R packages, and downloads the Gapseq source code. Ensure you have git, build tools, and necessary libraries installed. ```sh # Installation of main system dependencies sudo apt install ncbi-blast+ git libglpk-dev r-base-core bc curl libcurl4-openssl-dev libssl-dev libsbml5-dev diamond-aligner mmseqs2 # installation of required R-packages R -e 'install.packages(c("data.table", "stringr", "getopt", "R.utils", "stringi", "jsonlite", "httr", "pak"))' R -e 'if (!requireNamespace("BiocManager", quietly = TRUE)) install.packages("BiocManager"); BiocManager::install("Biostrings")' R -e 'pak::pkg_install("Waschina/cobrar")' # Download latest gapseq version from github git clone https://github.com/jotech/gapseq && cd gapseq # Download reference sequence database (Bacteria and Archaea) bash ./gapseq update-sequences -t Bacteria bash ./gapseq update-sequences -t Archaea ``` -------------------------------- ### Install Gapseq System Dependencies with Homebrew Source: https://gapseq.readthedocs.io/en/latest/_sources/install.md.txt Installs core system dependencies for Gapseq using Homebrew on MacOS. Ensure Homebrew is installed and updated before running. ```bash # Installation of main system dependencies brew install coreutils binutils git glpk blast r grep bc gzip curl bc brewsci/bio/libsbml diamond mmseqs2 ``` -------------------------------- ### Install Specific Reference Sequence Database Version Source: https://gapseq.readthedocs.io/en/latest/database/ReferenceSequences.html Installs a specific version of the reference sequence database identified by a Zenodo record ID. This is crucial for ensuring reproducibility of results. ```bash gapseq update-sequences -t Bacteria -Z ``` -------------------------------- ### Install Gapseq Dependencies on macOS with Homebrew Source: https://gapseq.readthedocs.io/en/latest/install.html Installs core system dependencies, R packages, and downloads the Gapseq source code from GitHub. This method is recommended for macOS users. ```bash # Installation of main system dependencies brew install coreutils binutils git glpk blast r grep bc gzip curl bc brewsci/bio/libsbml diamond mmseqs2 # installation of required R-packages R -e 'install.packages(c("data.table", "stringr", "getopt", "R.utils", "stringi", "jsonlite", "httr"))' R -e 'if (!requireNamespace("BiocManager", quietly = TRUE)) install.packages("BiocManager"); BiocManager::install("Biostrings")' R -e 'pak::pkg_install("Waschina/cobrar")' # Download latest gapseq version from github git clone https://github.com/jotech/gapseq && cd gapseq # Download reference sequence database (Bacteria and Archaea) bash ./gapseq update-sequences -t Bacteria bash ./gapseq update-sequences -t Archaea ``` -------------------------------- ### Install Gapseq Dependencies on Centos/Fedora/RHEL Source: https://gapseq.readthedocs.io/en/latest/_sources/install.md.txt Installs system dependencies, R packages, and downloads the Gapseq source code. Note that diamond and mmseqs2 are not installed via yum and require manual installation. ```sh # Installation of main system dependencies sudo yum install ncbi-blast+ git glpk-devel hmmer bc libcurl-devel curl openssl-devel libsbml-devel # installation of required R-packages R -e 'install.packages(c("data.table", "stringr", "getopt", "R.utils", "stringi", "jsonlite", "httr", "pak"))' R -e 'if (!requireNamespace("BiocManager", quietly = TRUE)) install.packages("BiocManager"); BiocManager::install("Biostrings")' R -e 'pak::pkg_install("Waschina/cobrar")' # Download latest gapseq version from github git clone https://github.com/jotech/gapseq && cd gapseq # Download reference sequence database (Bacteria and Archaea) bash ./gapseq update-sequences -t Bacteria bash ./gapseq update-sequences -t Archaea ``` -------------------------------- ### Install a Specific Reference Sequence Database Version Source: https://gapseq.readthedocs.io/en/latest/_sources/database/ReferenceSequences.md.txt Installs a specific version of the reference sequence database identified by its Zenodo record ID. This is useful for ensuring reproducibility with older gapseq versions or specific datasets. ```sh gapseq update-sequences -t Bacteria -Z ``` -------------------------------- ### Install libsbml Development Package Source: https://gapseq.readthedocs.io/en/latest/_sources/install.md.txt Installs the libsbml development package on Debian/Ubuntu or Fedora/CentOS systems. This is required for Gapseq's SBML support. ```sh sudo apt install libsbml5-dev # debian/ubuntu sudo yum install libsbml-devel # fedora/centos ``` -------------------------------- ### Install 'cobrar' R Package from GitHub Source: https://gapseq.readthedocs.io/en/latest/news.html Install the 'cobrar' R package from GitHub using the 'remotes' package. Ensure system libraries 'libSBML' and 'glpk' are installed beforehand. ```r remotes::install_github("Waschina/cobrar") ``` -------------------------------- ### Biomass Component Example Source: https://gapseq.readthedocs.io/en/latest/_sources/database/biomassReaction.md.txt Example of a biomass component entry, specifying its ID, name, compartment, and coefficient. ```json { "id" : "cpd00161", "name" : "L-Threonine", "comp" : "c", "coef" : 0.0474316079511907, "link" : "cpd00001:-1" } ``` -------------------------------- ### Basic Usage with Comma-Separated Lists Source: https://gapseq.readthedocs.io/en/latest/_sources/usage/panDraft.md.txt Provides a basic example of how to run the pan-draft module using comma-separated lists for model and pathway table paths. ```bash gapseq pan -m MAG01-draft.RDS,MAG02-draft.RDS,MAG03-draft.RDS,MAG04-draft.RDS -w MAG01-all-Pathways.tbl,MAG02-all-Pathways.tbl,MAG03-all-Pathways.tbl,MAG04-all-Pathways.tbl ``` -------------------------------- ### Example Reaction Table Source: https://gapseq.readthedocs.io/en/latest/_sources/tutorials/archaea.md.txt This table displays reaction IDs, names, fluxes, and equations for metabolic processes in methanogens, illustrating chemiosmosis. ```text ## rxn name flux equation ## ## 1: rxn90058_c0 Coenzyme B:coenzyme M:methanophenazine oxidoreductase (chemiosmosis) 16.59132 (3) H+-c0 + (1) CoM-S-S-CoB-c0 + (1) Dihydromethanophenazine-c0 <==> (1) CoM-c0 + (1) HTP-c0 + (1) Methanophenazine-c0 + (2) H+-e0 ## 2: rxn90059_c0 hydrogen:2-(2,3-dihydropentaprenyloxy)phenazine oxidoreductase (chemiosmosis) 16.59132 (2) H+-c0 + (1) Methanophenazine-c0 + (1) H2-c0 --> (1) Dihydromethanophenazine-c0 + (2) H+-e0 ``` -------------------------------- ### Install R 'remotes' Package Source: https://gapseq.readthedocs.io/en/latest/news.html Install the 'remotes' R package if it is not already installed. This is a prerequisite for installing packages from GitHub. ```r install.packages("remotes") # only needed if 'remotes' is not installed yet ``` -------------------------------- ### Install 'cobrar' R Package Source: https://gapseq.readthedocs.io/en/latest/_sources/news.md.txt Install the 'cobrar' R package, which replaces 'sybil' and 'sybilSBML' for metabolic modeling in Gapseq. Ensure 'remotes' is installed first if necessary. ```R install.packages("remotes") # only needed if 'remotes' is not installed yet ``` ```R remotes::install_github("Waschina/cobrar") ``` -------------------------------- ### Install Alternative Aligners (MMseqs2, Diamond) Source: https://gapseq.readthedocs.io/en/latest/_sources/install.md.txt Installs MMseqs2 and Diamond aligners on Debian/Ubuntu systems using apt. These tools can speed up Gapseq's find and find-transport modules. ```sh sudo apt install mmseqs2 diamond-aligner ``` -------------------------------- ### Install Stable Gapseq Release with Conda Source: https://gapseq.readthedocs.io/en/latest/install.html Creates and activates a conda environment for the stable Gapseq release and downloads the reference sequence databases. This is a convenient method for Linux and macOS. ```bash conda create -c conda-forge -c bioconda -n gapseq gapseq # activate gapseq environment conda activate gapseq # Download reference sequence database gapseq update-sequences -t Bacteria gapseq update-sequences -t Archaea ``` -------------------------------- ### Integrate Pathway Source: https://gapseq.readthedocs.io/en/latest/_sources/usage/adapt.md.txt Integrate an entire pathway into a model, for example, the photosynthesis pathway into E. coli. ```bash ./gapseq adapt -a PHOTOALL-PWY -m toy/ecoli.RDS ``` -------------------------------- ### Example Growth Medium Definition (CSV) Source: https://gapseq.readthedocs.io/en/latest/usage/medium.html Defines an M9-like medium with specific compound identifiers, names, and maximum flux rates. This format is used for gapfilling. ```csv compounds,name,maxFlux cpd00001,H2O,100 cpd00007,O2,10 cpd00009,Phosphate,100 cpd00027,D-Glucose,5 cpd00030,Mn2+,100 cpd00034,Zn2+,100 cpd00048,Sulfate,100 cpd00058,Cu2+,100 cpd00063,Ca2+,100 cpd00067,H+,100 cpd00099,Cl-,100 cpd00149,Co2+,100 cpd00205,K+,100 cpd00254,Mg,100 cpd00531,Hg2+,100 cpd00971,Na+,100 cpd01012,Cd2+,100 cpd01048,Arsenate,100 cpd10515,Fe2+,100 cpd10516,fe3,100 cpd11595,chromate,100 cpd00013,NH3,100 ``` -------------------------------- ### Download Sequence Database to a User Directory Source: https://gapseq.readthedocs.io/en/latest/_sources/database/ReferenceSequences.md.txt Downloads the reference sequence database to a specified user directory, useful when write permissions are limited in the default gapseq installation directory. ```sh gapseq update-sequences -t Bacteria -D $HOME/gapseq_seqDB ``` -------------------------------- ### Install Pyrodigal for Nucleotide Translation Source: https://gapseq.readthedocs.io/en/latest/_sources/install.md.txt Installs the Pyrodigal library using pip, which Gapseq uses for predicting open reading frames and translating nucleotide sequences to amino acids. ```sh pip install pyrodigal ``` -------------------------------- ### Install Development Version of Gapseq with Conda Source: https://gapseq.readthedocs.io/en/latest/install.html Clones the development version of Gapseq, creates a dedicated conda environment, and downloads the reference sequence databases. This method is for users who need the latest features. ```bash # Cloning the development version of gapseq git clone https://github.com/jotech/gapseq cd gapseq # Create and activate a conda environment "gapseq-dev" conda env create -n gapseq-dev --file gapseq_env.yml conda activate gapseq-dev # Download reference sequence database (Bacteria and Archaea) bash ./gapseq update-sequences -t Bacteria bash ./gapseq update-sequences -t Archaea ``` -------------------------------- ### Ensure R User Library is Writable Source: https://gapseq.readthedocs.io/en/latest/_sources/install.md.txt Run this command before installing R packages if you encounter 'is not writable' errors. It creates the user library directory if it doesn't exist. ```bash Rscript -e 'if( file.access(Sys.getenv("R_LIBS_USER"), mode=2) == -1 ) dir.create(path = Sys.getenv("R_LIBS_USER"), showWarnings = FALSE, recursive = TRUE)' ``` -------------------------------- ### Install Required R Packages for Gapseq Source: https://gapseq.readthedocs.io/en/latest/_sources/install.md.txt Installs necessary R packages for Gapseq functionality. This includes packages for data manipulation, string processing, and biological sequence analysis. ```r R -e 'install.packages(c("data.table", "stringr", "getopt", "R.utils", "stringi", "jsonlite", "httr"))' R -e 'if (!requireNamespace("BiocManager", quietly = TRUE)) install.packages("BiocManager"); BiocManager::install("Biostrings")' R -e 'pak::pkg_install("Waschina/cobrar")' ``` -------------------------------- ### Create and Activate Conda Environment for Gapseq Development Version Source: https://gapseq.readthedocs.io/en/latest/_sources/install.md.txt Creates a Conda environment named 'gapseq-dev' using the 'gapseq_env.yml' file, which installs Gapseq and its dependencies. The environment is then activated. ```sh # Create and activate a conda environment "gapseq-dev" conda env create -n gapseq-dev --file gapseq_env.yml conda activate gapseq-dev ``` -------------------------------- ### Gapseq Command-Line Workflow for Archaea Source: https://gapseq.readthedocs.io/en/latest/_sources/tutorials/archaea.md.txt This sequence of commands outlines the gapseq workflow for finding genes, transporters, and drafting a metabolic model for archaea, starting with downloading a genome. ```sh wget -q -O mthe.fna.gz ftp://ftp.ncbi.nlm.nih.gov/genomes/all/GCF/000/008/645/GCF_000008645.1_ASM864v1/GCF_000008645.1_ASM864v1_genomic.fna.gz gapseq find -p all -t Archaea -m Archaea -A diamond mthe.fna.gz gapseq find-transport -A diamond mthe.fna.gz gapseq draft -r mthe-all-Reactions.tbl -t mthe-Transporter.tbl -u 200 -l 100 -p mthe-all-Pathways.tbl gapseq fill -m mthe-draft.RDS -n ../../dat/media/MM_anaerobic_CO2_H2.csv -b 100 -e highH2 ``` -------------------------------- ### Clone Development Version of Gapseq Source: https://gapseq.readthedocs.io/en/latest/_sources/install.md.txt Clones the development version of Gapseq from GitHub and navigates into the gapseq directory. This is the first step for installing the latest development code. ```sh # Cloning the development version of gapseq git clone https://github.com/jotech/gapseq cd gapseq ``` -------------------------------- ### Ensure R Package Library is Writable Source: https://gapseq.readthedocs.io/en/latest/install.html Run this command before installing R packages if you encounter a 'not writable' error. It creates the user's library directory if it doesn't exist and ensures write permissions. ```bash Rscript -e 'if( file.access(Sys.getenv("R_LIBS_USER"), mode=2) == -1 ) dir.create(path = Sys.getenv("R_LIBS_USER"), showWarnings = FALSE, recursive = TRUE)' ``` -------------------------------- ### Find Sequences Using a User-Specified Database Directory Source: https://gapseq.readthedocs.io/en/latest/_sources/database/ReferenceSequences.md.txt Searches for sequences using a custom-specified reference sequence database location. This ensures gapseq uses the correct database when not using the default installation path. ```sh gapseq find -p all -D $HOME/gapseq_seqDB -A diamond ecoli.faa.gz ``` -------------------------------- ### Update Gapseq Sequence Databases Source: https://gapseq.readthedocs.io/en/latest/_sources/install.md.txt Downloads the reference sequence databases for Bacteria and Archaea using the gapseq update-sequences command. This command requires the gapseq tool to be cloned or installed. ```bash # Download reference sequence database (Bacteria and Archaea) bash ./gapseq update-sequences -t Bacteria bash ./gapseq update-sequences -t Archaea ``` -------------------------------- ### Example Growth Medium CSV/TSV Format Source: https://gapseq.readthedocs.io/en/latest/_sources/usage/medium.md.txt Defines a growth medium using a 3-column format: compounds identifier, compound name, and maximum flux. This format can be used for CSV or TSV files. ```text compounds,name,maxFlux cpd00001,H2O,100 cpd00007,O2,10 cpd00009,Phosphate,100 cpd00027,D-Glucose,5 cpd00030,Mn2+,100 cpd00034,Zn2+,100 cpd00048,Sulfate,100 cpd00058,Cu2+,100 cpd00063,Ca2+,100 cpd00067,H+,100 cpd00099,Cl-,100 cpd00149,Co2+,100 cpd00205,K+,100 cpd00254,Mg,100 cpd00531,Hg2+,100 cpd00971,Na+,100 cpd01012,Cd2+,100 cpd01048,Arsenate,100 cpd10515,Fe2+,100 cpd10516,fe3,100 cpd11595,chromate,100 cpd00013,NH3,100 ``` -------------------------------- ### Recommended Usage with Directory Paths Source: https://gapseq.readthedocs.io/en/latest/_sources/usage/panDraft.md.txt Illustrates the recommended method for pan-draft input by specifying directories containing the draft model and pathway prediction files. ```bash mkdir -p modfiles mv MAG*-draft.RDS modfiles mv MAG*-all-Pathways.tbl modfiles gapseq pan -m modfiles/ -w modfiles/ ``` -------------------------------- ### Create Draft Model Source: https://gapseq.readthedocs.io/en/latest/usage/basics.html Creates a draft model using reaction, transporter, and pathway table files as input. ```bash ./gapseq draft -r toy/myb71-all-Reactions.tbl -t toy/myb71-Transporter.tbl -p toy/myb71-all-Pathways.tbl ``` -------------------------------- ### Basic Usage with Wildcards Source: https://gapseq.readthedocs.io/en/latest/_sources/usage/panDraft.md.txt Demonstrates using wildcards to specify paths for draft models and pathway prediction tables. ```bash gapseq pan -m MAG*-draft.RDS -w MAG*-all-Pathways.tbl ``` -------------------------------- ### Biomass Group Definition Example Source: https://gapseq.readthedocs.io/en/latest/_sources/database/biomassReaction.md.txt Example of a biomass group definition, including group name, mass, unit type, and a list of components. ```json { "group_name" : "Lipids", "mass" : 0.09, "unit_group" : "g", "unit_components" : "MOLSPLIT", "components" : [ { "id" : "cpd15540", "name" : "Phosphatidylglycerol-dioctadecanoyl", "comp" : "c", "coef" : 1 }, { "id" : "cpd15793", "name" : "Stearoylcardiolipin-B-subtilis", "comp" : "c", "coef" : 1 }, { "id" : "cpd15722", "name" : "Diisoheptadecanoylphosphatidylglycerol", "comp" : "c", "coef" : 1 }, { "id" : "cpd15794", "name" : "Isoheptadecanoylcardiolipin-B-subtilis", "comp" : "c", "coef" : 1 }, { "id" : "cpd15723", "name" : "Dianteisoheptadecanoylphosphatidylglycerol", "comp" : "c", "coef" : 1 }, { "id" : "cpd15795", "name" : "Anteisoheptadecanoylcardiolipin-B-subtilis", "comp" : "c", "coef" : 1 }, { "id" : "cpd15533", "name" : "phosphatidylethanolamine-dioctadecanoyl", "comp" : "c", "coef" : 1 }, { "id" : "cpd15696", "name" : "Dianteisoheptadecanoylphosphatidylethanolamine", "comp" : "c", "coef" : 1 }, { "id" : "cpd15695", "name" : "Diisoheptadecanoylphosphatidylethanolamine", "comp" : "c", "coef" : 1 } ] } ``` -------------------------------- ### Enable Substance Uptake Source: https://gapseq.readthedocs.io/en/latest/_sources/usage/adapt.md.txt Enable the uptake of a specific substance for a model to allow growth under a known condition. Requires a table of all reactions. ```bash ./gapseq adapt -m toy/myb71.RDS -w cpd00211:TRUE -b toy/myb71-all-Reactions.tbl ``` -------------------------------- ### Create Draft Metabolic Model Source: https://gapseq.readthedocs.io/en/latest/_sources/usage/basics.md.txt Generate a draft metabolic model using provided reaction, transporter, and pathway tables. This is the initial step in network reconstruction. ```bash ./gapseq draft -r toy/myb71-all-Reactions.tbl -t toy/myb71-Transporter.tbl -p toy/myb71-all-Pathways.tbl ``` -------------------------------- ### Download Genome Assemblies and Media File Source: https://gapseq.readthedocs.io/en/latest/tutorials/yogurt.html Downloads the protein sequences for Lactobacillus delbrueckii and Streptococcus thermophilus from NCBI RefSeq, and the milk growth media file from a GitHub repository. These commands are used to prepare the input data for gapseq. ```bash # Download genome assemblies from NCBI (RefSeq) in protein sequences wget -q -O ldel.faa.gz ftp://ftp.ncbi.nlm.nih.gov/genomes/all/GCF/000/056/065/GCF_000056065.1_ASM5606v1/GCF_000056065.1_ASM5606v1_protein.faa.gz wget -q -O sthe.faa.gz ftp://ftp.ncbi.nlm.nih.gov/genomes/all/GCF/010/120/595/GCF_010120595.1_ASM1012059v1/GCF_010120595.1_ASM1012059v1_protein.faa.gz # Download gapfill-medium file from github wget -q https://github.com/Waschina/gapseq.tutorial.data/raw/master/yogurt/milk.csv ``` -------------------------------- ### Remove Pathway Source: https://gapseq.readthedocs.io/en/latest/_sources/usage/adapt.md.txt Remove an entire pathway from a model, for example, the glycolysis pathway. ```bash ./gapseq adapt -m toy/ecoli.RDS -r GLYCOLYSIS ``` -------------------------------- ### Load data.table Package Source: https://gapseq.readthedocs.io/en/latest/_sources/tutorials/yogurt.md.txt Loads the data.table package for efficient data manipulation and summarization of FBA/FVA results. Ensure this package is installed before running. ```r library(data.table) ``` -------------------------------- ### Predict Gapfill Medium for Pan-Model Source: https://gapseq.readthedocs.io/en/latest/_sources/tutorials/pandraft.md.txt Predicts a minimal growth medium that supports biomass production for the pan-model. This step is crucial for making the draft model functional. ```sh # predict gapfill medium for pan model gapseq medium -m pan_model/panModel-draft.RDS -p pan_model/panModel-tmp-Pathways.tbl -f pan_model/ ``` -------------------------------- ### Use MMseqs2 Aligner with Gapseq Source: https://gapseq.readthedocs.io/en/latest/_sources/install.md.txt Specifies the MMseqs2 aligner for the 'gapseq find' and 'gapseq find-transport' modules. Ensure MMseqs2 is installed and in your system's PATH. ```sh # mmseqs2 gapseq find -p all -A mmseqs2 genome.faa.gz gapseq find-transport -p all -A mmseqs2 genome.faa.gz ``` -------------------------------- ### Download Genome Assemblies and Media File Source: https://gapseq.readthedocs.io/en/latest/_sources/tutorials/yogurt.md.txt Download the necessary protein FASTA files for Lactobacillus delbrueckii and Streptococcus thermophilus, along with the milk growth media CSV file from GitHub. ```sh # Download genome assemblies from NCBI (RefSeq) in protein sequences wget -q -O ldel.faa.gz ftp://ftp.ncbi.nlm.nih.gov/genomes/all/GCF/000/056/065/GCF_000056065.1_ASM5606v1/GCF_000056065.1_ASM5606v1_protein.faa.gz wget -q -O sthe.faa.gz ftp://ftp.ncbi.nlm.nih.gov/genomes/all/GCF/010/120/595/GCF_010120595.1_ASM1012059v1/GCF_010120595.1_ASM1012059v1_protein.faa.gz # Download gapfill-medium file from github wget -q https://github.com/Waschina/gapseq.tutorial.data/raw/master/yogurt/milk.csv ``` -------------------------------- ### Use Diamond Aligner with Gapseq Source: https://gapseq.readthedocs.io/en/latest/_sources/install.md.txt Specifies the Diamond aligner for the 'gapseq find' and 'gapseq find-transport' modules. Ensure Diamond is installed and in your system's PATH. ```sh # diamond gapseq find -p all -A diamond genome.faa.gz gapseq find-transport -p all -A diamond genome.faa.gz ``` -------------------------------- ### Find Metabolic Pathways Source: https://gapseq.readthedocs.io/en/latest/usage/basics.html Searches for all metabolic pathways. Requires a FASTA file as input. ```bash ./gapseq find -p all toy/myb71.faa.gz ``` -------------------------------- ### Update Reference Sequences for Archaea Source: https://gapseq.readthedocs.io/en/latest/_sources/database/ReferenceSequences.md.txt Installs or updates the reference sequence database for archaea. This command fetches the latest sequences associated with the current gapseq version. ```sh gapseq update-sequences -t Archaea # for archaea ``` -------------------------------- ### Update Reference Sequences for Bacteria Source: https://gapseq.readthedocs.io/en/latest/_sources/database/ReferenceSequences.md.txt Installs or updates the reference sequence database for bacteria. This command fetches the latest sequences associated with the current gapseq version. ```sh gapseq update-sequences -t Bacteria # for bacteria ``` -------------------------------- ### Load cobrapy and data.table R Packages Source: https://gapseq.readthedocs.io/en/latest/tutorials/yogurt.html Loads the necessary R packages, cobrapy for metabolic modeling and data.table for data manipulation. Ensure these packages are installed before running. ```r library(cobrar) ``` ```r library(data.table) ``` -------------------------------- ### Update Reference Sequences for Bacteria or Archaea Source: https://gapseq.readthedocs.io/en/latest/database/ReferenceSequences.html Installs or updates the reference sequence databases for gapseq. Specify the target domain ('Bacteria' or 'Archaea') to download the appropriate sequences. ```bash gapseq update-sequences -t Bacteria # for bacteria gapseq update-sequences -t Archaea # for archaea ``` -------------------------------- ### Build Pan-Draft Model Source: https://gapseq.readthedocs.io/en/latest/_sources/tutorials/pandraft.md.txt Combines individual draft metabolic models into a single pan-draft model, capturing shared and accessory metabolic reactions. ```sh # reconstruct pan model mkdir -p pan_model gapseq pan -m models/ -w models/ -f pan_model/ ``` -------------------------------- ### Predict Growth Medium Command Source: https://gapseq.readthedocs.io/en/latest/_sources/usage/medium.md.txt Predicts a growth medium using pathway and draft model inputs. Use this to generate a gapfilling medium. ```bash gapseq medium -m ecoli-draft.RDS -p ecoli-all-Pathways.tbl ``` -------------------------------- ### Fill Metabolic Model with Gapseq Source: https://gapseq.readthedocs.io/en/latest/_sources/tutorials/archaea.md.txt Fills the draft metabolic model using specified media and biomass constraints with gapseq. ```sh gapseq fill -m mbar-draft.RDS -n ../../dat/media/MM_anaerobic_CO2_H2.csv -b 100 -e highH2 ``` -------------------------------- ### Download Genome and Run gapseq for Methanogens Source: https://gapseq.readthedocs.io/en/latest/tutorials/archaea.html Downloads the genome of Methanothermobacter thermautotrophicus and runs gapseq to find metabolic pathways and transporters. This is for methanogens without cytochromes. ```bash wget -q -O mthe.fna.gz ftp://ftp.ncbi.nlm.nih.gov/genomes/all/GCF/000/008/645/GCF_000008645.1_ASM864v1/GCF_000008645.1_ASM864v1_genomic.fna.gz gapseq find -p all -t Archaea -m Archaea -A diamond mthe.fna.gz gapseq find-transport -A diamond mthe.fna.gz gapseq draft -r mthe-all-Reactions.tbl -t mthe-Transporter.tbl -u 200 -l 100 -p mthe-all-Pathways.tbl gapseq fill -m mthe-draft.RDS -n ../../dat/media/MM_anaerobic_CO2_H2.csv -b 100 -e highH2 ``` -------------------------------- ### Download and Clone Gapseq from GitHub Source: https://gapseq.readthedocs.io/en/latest/_sources/install.md.txt Clones the latest Gapseq version from GitHub and navigates into the gapseq directory. This is a prerequisite for updating sequence databases. ```bash # Download latest gapseq version from github git clone https://github.com/jotech/gapseq && cd gapseq ``` -------------------------------- ### Update to the Latest Reference Sequence Database Source: https://gapseq.readthedocs.io/en/latest/_sources/database/ReferenceSequences.md.txt Updates the reference sequence database to the absolute latest version available on Zenodo, overriding the version-specific database linked to the current gapseq installation. ```sh gapseq update-sequences -t Bacteria -Z latest ``` -------------------------------- ### Draft Metabolic Model with Gapseq Source: https://gapseq.readthedocs.io/en/latest/_sources/tutorials/archaea.md.txt Creates a draft metabolic model by combining identified reactions, transporters, and pathways using gapseq. ```sh gapseq draft -r mbar-all-Reactions.tbl -t mbar-Transporter.tbl -u 200 -l 100 -p mbar-all-Pathways.tbl ``` -------------------------------- ### Combine Growth Phenotype Modifications Source: https://gapseq.readthedocs.io/en/latest/_sources/usage/adapt.md.txt Combine enabling and disabling of growth phenotypes in a single command by providing a list of substances with their desired growth state. Requires a table of all reactions. ```bash ./gapseq adapt -m toy/myb71.RDS -w cpd00211:TRUE,cpd00027:FALSE -b toy/myb71-all-Reactions.tbl ``` -------------------------------- ### Fill metabolic model with media Source: https://gapseq.readthedocs.io/en/latest/tutorials/archaea.html Fills the metabolic model using a specified media composition and high hydrogen conditions. This step refines the model for constraint-based analysis. ```bash gapseq fill -m mbar-draft.RDS -n ../../dat/media/MM_anaerobic_CO2_H2.csv -b 100 -e highH2 ``` -------------------------------- ### Find Specific Pathways Source: https://gapseq.readthedocs.io/en/latest/usage/basics.html Searches for a specific metabolic pathway, like 'chitin'. Requires a FASTA file. ```bash ./gapseq find -p chitin toy/myb71.faa.gz ``` -------------------------------- ### Example user-defined biomass JSON format Source: https://gapseq.readthedocs.io/en/latest/_sources/database/biomassReaction.md.txt This JSON structure defines a custom biomass reaction. It includes metadata like ID, name, and domain, along with detailed component groups (e.g., DNA, RNA, Protein) and their constituent metabolites with coefficients. ```json { "id" : "user_biomass", "name" : "A user biomass definition", "ref" : "Motivated by https://github.com/jotech/gapseq/issues/156", "energy_GAM" : 40, "domain" : "Bacteria", "met_groups" : [ { "group_name" : "DNA", "mass" : 0.03, "unit_group" : "g", "unit_components" : "MOLFRACTION", "components" : [ { "id" : "cpd00115", "name" : "dATP", "comp" : "c", "coef" : 0.25, "link" : "cpd00012:-1" }, { "id" : "cpd00357", "name" : "dTTP", "comp" : "c", "coef" : 0.25, "link" : "cpd00012:-1" }, { "id" : "cpd00241", "name" : "dGTP", "comp" : "c", "coef" : 0.25, "link" : "cpd00012:-1" }, { "id" : "cpd00356", "name" : "dCTP", "comp" : "c", "coef" : 0.25, "link" : "cpd00012:-1" } ] }, { "group_name" : "RNA", "mass" : 0.2, "unit_group" : "g", "unit_components" : "MOLFRACTION", "components" : [ { "id" : "cpd00002", "name" : "ATP", "comp" : "c", "coef" : 0.25, "link" : "cpd00012:-1" }, { "id" : "cpd00062", "name" : "UTP", "comp" : "c", "coef" : 0.25, "link" : "cpd00012:-1" }, { "id" : "cpd00038", "name" : "GTP", "comp" : "c", "coef" : 0.25, "link" : "cpd00012:-1" }, { "id" : "cpd00052", "name" : "CTP", "comp" : "c", "coef" : 0.25, "link" : "cpd00012:-1" } ] }, { "group_name" : "Protein", "mass" : 0.55, "unit_group" : "g", "unit_components" : "MOLFRACTION", "components" : [ { "id" : "cpd00035", "name" : "L-alanine", "comp" : "c", "coef" : 0.1, "link" : "cpd00001:-1" }, { "id" : "cpd00051", "name" : "L-arginine", "comp" : "c", "coef" : 0.05, "link" : "cpd00001:-1" }, { "id" : "cpd00132", "name" : "L-asparagine", "comp" : "c", "coef" : 0.05, "link" : "cpd00001:-1" }, { "id" : "cpd00041", "name" : "L-Aspartate", "comp" : "c", "coef" : 0.05, "link" : "cpd00001:-1" }, { "id" : "cpd00084", "name" : "L-Cysteine", "comp" : "c", "coef" : 0.01, "link" : "cpd00001:-1" }, { "id" : "cpd00053", "name" : "L-Glutamine", "comp" : "c", "coef" : 0.05, "link" : "cpd00001:-1" }, { "id" : "cpd00023", "name" : "L-Glutamate", "comp" : "c", "coef" : 0.06, "link" : "cpd00001:-1" }, { "id" : "cpd00033", "name" : "Glycine", "comp" : "c", "coef" : 0.1, "link" : "cpd00001:-1" }, { "id" : "cpd00119", "name" : "L-Histidine", "comp" : "c", "coef" : 0.02, "link" : "cpd00001:-1" }, { "id" : "cpd00322", "name" : "L-Isoleucine", "comp" : "c", "coef" : 0.05, "link" : "cpd00001:-1" }, { "id" : "cpd00107", "name" : "L-Leucine", "comp" : "c", "coef" : 0.09, "link" : "cpd00001:-1" }, { "id" : "cpd00039", "name" : "L-Lysine", "comp" : "c", "coef" : 0.05, "link" : "cpd00001:-1" } ] } ] } ``` -------------------------------- ### Predict Growth Medium Source: https://gapseq.readthedocs.io/en/latest/usage/medium.html Predicts a growth medium using pathway prediction and draft model inputs. Requires specifying the draft model and pathway table. ```bash gapseq medium -m ecoli-draft.RDS -p ecoli-all-Pathways.tbl ``` -------------------------------- ### gapseq Pipeline for Model Reconstruction Source: https://gapseq.readthedocs.io/en/latest/tutorials/yogurt.html This snippet outlines the complete gapseq pipeline for reconstructing metabolic models, covering reaction, pathway, and transporter prediction, draft model building, and gapfilling for two different models. ```bash modelA="ldel" modelB="sthe" # (1) Reaction & Pathway prediction gapseq find -p all -b 200 -m auto -t auto -A diamond $modelA.faa.gz gapseq find -p all -b 200 -m auto -t auto -A diamond $modelB.faa.gz # (2) Transporter prediction gapseq find-transport -b 200 -A diamond $modelA.faa.gz gapseq find-transport -b 200 -A diamond $modelB.faa.gz # (3) Building Draft Model - based on Reaction-, Pathway-, and Transporter prediction gapseq draft -r $modelA-all-Reactions.tbl -t $modelA-Transporter.tbl -p $modelA-all-Pathways.tbl -u 200 -l 100 gapseq draft -r $modelB-all-Reactions.tbl -t $modelB-Transporter.tbl -p $modelB-all-Pathways.tbl -u 200 -l 100 # (4) Gapfilling gapseq fill -m $modelA-draft.RDS -n milk.csv -b 100 gapseq fill -m $modelB-draft.RDS -n milk.csv -b 100 ```