Skip to content

4. Predict growth profiles

Ben Vezina edited this page Mar 2, 2023 · 14 revisions

The Bactabolize fba function

bactabolize fba --model_fp input_assembly_model.json --fba_spec_name m9 --output_fp input_assembly_model_FBA.tsv

Once a model has been generated, you can test its growth profiles across a range of nutrient sources e.g. a common use case would be to predict whether or not the model can simulate growth in minimal media with each of a range of different carbon substrate sources. Bactabolize will test each nutrient source under aerobic and anaerobic conditions. Predictions are based on Flux Balance Analysis (FBA), optimising the model's biomass objective function. If the optimised biomass objective value exceeds a predetermined threshold, the model is considered to predict positive growth.

bactabolize fba is designed to facilitate prediction of growth phenotypes at scale. You can select the base media for your predictions and Bactabolize will identify the set of extracellular metabolites that are supported by the model and can be utilised as a source of carbon, phosphorus, nitrogen, and/or sulfur. Metabolites can only be tested if a corresponding exchange reaction is present in the model i.e. a reaction that represents the transfer of the metabolite from the extracellular space into the cell. The metabolite's chemical formula is used to determine the type of substrate source for which it is considered (e.g. a metabolite is a potential carbon source if its chemical formula in the model contains carbon). Where a metabolite contains more than one of the four elements, all combinations are tested. 'bactabolize fba' will perform an independent FBA for each element source as an alternative carbon and/or nitrogen and/or phosphorus and/or sulfur source to the default source(s) in your selected media (e.g. for m9 minimal media, the default carbon source is glucose).

fba flowchart

Input files

Two inputs are required:

1. A strain-specific metabolic model in BiGG compatible JSON format.

E.g. a model generated by bactabolize draft_model. Alternatively the SEED_to_BiGG_model_convert helper script can be used to convert third party models using SEED IDs into those compatible with Bactabolize.

2. An FBA specification file.

A JSON formatted file giving details about the base media, element sources and atmosphere types to be tested. See here for details.

E.g. the pre-built m9_spec.json file can be used to perform FBA in m9 minimal media, cycling through all possible sources of carbon and/or nitrogen and/or phosphorus and/or sulfur in both aerobic and anaerobic environments. The default carbon, nitrogen, phosphorus and sulfur sources are defined as glucose, ammonia, phosphate and sulphate, respectively.

Outputs

A single tab-delimited file will be output for each model. The file will contain 6 columns as follows:

Column name Description
fba_type Name of the FBA run (defined exchanges only, or all potential element sources)
spec_name FBA specification name (indicates base media, default element sources, atmospheres to be tested)
atmosphere Type of atmosphere (aerobic: O2; anaerobic: no O2)
exchange Name of exchange reaction assessed (indicates the metabolite tested)
categories Elements for which the exchange was assessed as being a potential source (C, N, P or S)
objective value Biomass objective value

Command options

Required

--model_fp - Input model (.json) to perform FBA on.

--fba_spec_name - Prepackaged FBA spec name [choices: bg11, cdm_mendoza, lb, lb_carveme, m9, nutrient, pmm5_mendoza, pmm7_mendoza, tsa, tsa_sheep_blood]

--output_fp - Output filename for FBA results (tab-delimited).

Optional

--fba_spec_fp - Select custom FBA spec file instead of pre-packaged. Example and explanation here.

--fba_open_value - Set objective value for nutrient sources tested during FBA. Should be a negative value between -1 and -1000. -10 or -20 is probably most reasonable. DEFAULT: -1000

Examples

# Produce FBA on M9 minimal media with an objective value of -20
bactabolize fba \
    --model_fp input_assembly_model.json \
    --fba_spec_name m9 \
    --output_fp input_assembly_model_FBA.tsv \
    --fba_open_value -20

# Produce FBA on input on TSA media with an objective value of -10
bactabolize fba \
    --model_fp input_assembly_model.json \
    --fba_spec_name tsa \
    --output_fp input_assembly_model_FBA.tsv \
    --fba_open_value -10

FBA spec file

The *_spec.json file defines the media, atmosphere and default element sources FBA will use as a growth environment and is found in the following directory: ~/miniconda3/envs/bactabolize/lib/python3.9/site-packages/bactabolize/data/fba_specs/. Example:

{
  "M9": {
    "fba_type": [
        "defined_exchanges_only",
        "potential_element_sources"
    ],
    "atmosphere": ["aerobic", "anaerobic"],
    "media_type": "m9",
    "default_element_sources": {
      "carbon": "EX_glc__D_e",
      "phosphorus": "EX_pi_e",
      "nitrogen": "EX_nh4_e",
      "sulfur": "EX_so4_e"
    }
  }
}
  • The fba_type field sets the type of FBA to run. In the example above both simple media assessment (i.e. the user selected base media with no element substitutions, specified by defined_exchanges_only) and base media plus all possible combinations of element sources supported in the model (specified as potential_element_sources) will be tested.
  • The atmosphere field allows specification of aerobic and/or anerobic conditions to be tested.
  • The media_type field specifies the base growth media to be used as defined in the associated growth media definition file.
  • default_element_sources specifies the default exchange reactions (corresponding to the default element sources) to replace when assessing alternative sources. These should correspond to components in the base media.

Pre-built spec files

The data/fba_specs directory contains pre-built spec files for the commonly used bacterial medias, including:

  • bg11
  • cdm_mendoza
  • lb
  • lb_carveme
  • m9
  • nutrient
  • pmm5_mendoza
  • pmm7_mendoza
  • tsa
  • tsa_sheep_blood

These can be accessed by using the --fba_spec_name command with bactabolize fba

Custom spec files

You can make your own spec file following the format above. You'll need to make sure that the relevant growth media definition file is available in the /data/media_definitions directory. This can be accessed by using the --fba_spec_fp command with bactabolize fba

Enabling metabolites in the model

To run individual FBA on a metabolite:

  1. The metabolite must have a corresponding exchange reaction in the model (i.e. a reaction specifying that the metabolite can be transferred from the extracellular space into the cell). Exchange reactions are a subset of the model reactions distinguished by the EX_ prefix e.g. EX_glc__D_e is the exchange reaction for D-Glucose.
  2. The metabolite must be annotated with its chemical formula in the model. If you have a model that contains metanetx identifiers for metabolites (i.e. a BiGG model), you can add metabolite formulas using the BiGG model compound annotator.

Clone this wiki locally