Core Tests

Basic

Perform basic tests on an instance of cobra.Model.

test_basic.test_compartments_presence(read_only_model, store)[source]

Expect that >= 3 compartments are defined in the model.

test_basic.test_enzyme_complex_presence(read_only_model, store)[source]

Expect that >= 1 enzyme complexes are present in the model.

test_basic.test_find_pure_metabolic_reactions(read_only_model, store)[source]

Expect >= 1 pure metabolic reactions are present in the model.

test_basic.test_find_transport_reactions(read_only_model, store)[source]

Expect >= 1 transport reactions are present in the read_only_model.

test_basic.test_find_unique_metabolites(read_only_model, store)[source]

Expect there to be less metabolites when removing compartment tag.

test_basic.test_gene_protein_reaction_rule_presence(read_only_model, store)[source]

Expect all non-exchange reactions to have a GPR rule.

test_basic.test_genes_presence(read_only_model, store)[source]

Expect that >= 1 genes are present in the model.

test_basic.test_metabolic_coverage(read_only_model, store)[source]

Expect a model to have high metabolic coverage.

test_basic.test_metabolites_charge_presence(read_only_model, store)[source]

Expect all metabolites to have charge information.

test_basic.test_metabolites_formula_presence(read_only_model, store)[source]

Expect all metabolites to have a formula.

test_basic.test_metabolites_presence(read_only_model, store)[source]

Expect that >= 1 metabolites are present in the model.

test_basic.test_model_id_presence(read_only_model, store)[source]

Expect that the model has an identifier.

test_basic.test_ngam_presence(read_only_model, store)[source]

Expect a single non growth-associated maintenance reaction.

test_basic.test_reactions_presence(read_only_model, store)[source]

Expect that >= 1 reactions are present in the model.

test_basic.test_transport_reaction_presence(read_only_model, store)[source]

Expect >= 1 transport reactions are present in the model.

Consistency

Stoichiometric consistency tests for an instance of cobra.Model.

test_consistency.test_blocked_reactions(read_only_model, store)[source]

Expect all reactions to be able to carry flux.

test_consistency.test_detect_energy_generating_cycles(read_only_model, store, met)[source]

Expect that no energy metabolite can be produced out of nothing.

test_consistency.test_find_deadends(read_only_model, store)[source]

Expect no deadends to be present.

test_consistency.test_find_disconnected(read_only_model, store)[source]

Expect no disconnected metabolites to be present.

test_consistency.test_find_orphans(read_only_model, store)[source]

Expect no orphans to be present.

test_consistency.test_find_stoichiometrically_balanced_cycles(read_only_model, store)[source]

Expect no stoichiometrically balanced loops to be present.

test_consistency.test_reaction_charge_balance(read_only_model, store)[source]

Expect all reactions to be charge balanced.

test_consistency.test_reaction_mass_balance(read_only_model, store)[source]

Expect all reactions to be mass balanced.

test_consistency.test_stoichiometric_consistency(read_only_model, store)[source]

Expect that the stoichiometry is mass-balanced.

Biomass

Biomass tests performed on an instance of cobra.Model.

N.B.: We parametrize each function here with the identified biomass reactions. In the storage of test results we rely on the order of the biomass fixtures to remain the same as the parametrized test cases.

test_biomass.test_biomass_consistency(read_only_model, reaction_id, store)[source]

Expect biomass components to sum up to 1 g[CDW].

test_biomass.test_biomass_default_production(model, reaction_id, store)[source]

Expect biomass production in default medium.

test_biomass.test_biomass_precursors_default_production(read_only_model, reaction_id, store)[source]

Expect production of all biomass precursors in default medium.

test_biomass.test_biomass_precursors_open_production(model, reaction_id, store)[source]

Expect precursor production in complete medium.

test_biomass.test_biomass_presence(store)[source]

Expect the model to contain at least one biomass reaction.

test_biomass.test_fast_growth_default(model, reaction_id)[source]

Expect the predicted growth rate for each BOF to be below 10.3972.

This is based on lowest doubling time reported here http://www.pnnl.gov/science/highlights/highlight.asp?id=879

test_biomass.test_gam_in_biomass(model, reaction_id, store)[source]

Expect the biomass reactions to contain atp and adp.

Annotation

Annotation tests performed on an instance of cobra.Model.

test_annotation.test_metabolite_annotation_overview(read_only_model, store)[source]

Expect all metabolites to have annotations from common databases.

The required databases are outlined in annotation.py.

test_annotation.test_metabolite_annotation_presence(read_only_model, store)[source]

Expect all metabolites to have a non-empty annotation attribute.

test_annotation.test_metabolite_annotation_wrong_ids(read_only_model, store)[source]

Expect all annotations of metabolites to be in the correct format.

The required formats, i.e., regex patterns are outlined in annotation.py.

test_annotation.test_metabolite_id_namespace_consistency(read_only_model, store)[source]

Expect metabolite IDs to be from the same namespace.

test_annotation.test_reaction_annotation_overview(read_only_model, store)[source]

Expect all reactions to have annotations from common databases.

The required databases are outlined in annotation.py.

test_annotation.test_reaction_annotation_presence(read_only_model, store)[source]

Expect all reactions to have a non-empty annotation attribute.

test_annotation.test_reaction_annotation_wrong_ids(read_only_model, store)[source]

Expect all annotations of reactions to be in the correct format.

The required formats, i.e., regex patterns are outlined in annotation.py.

test_annotation.test_reaction_id_namespace_consistency(read_only_model, store)[source]

Expect reaction IDs to be from the same namespace.

Syntax

Syntax tests performed on an instance of cobra.Model.

test_syntax.non_cytosolic(read_only_model, store)[source]

Provide all non-cytosolic compartments.

test_syntax.test_abc_transp_rxn_tag_match(read_only_model, store)[source]

Expect all abc transport reactions to be tagged with abc.

test_syntax.test_demand_reaction_tag_match(read_only_model, store)[source]

Expect all demand reaction IDs to be prefixed with DM_.

test_syntax.test_exchange_reaction_tag_match(read_only_model, store)[source]

Expect all exchange reaction IDs to be prefixed with EX_.

test_syntax.test_false_demand_reaction(read_only_model, store)[source]

Expect all rxns that are tagged with DM_ to be true demand rxns.

test_syntax.test_false_exchange_reaction(read_only_model, store)[source]

Expect all rxns that are tagged with EX_ to be true exchange rxns.

test_syntax.test_false_sink_reaction(read_only_model, store)[source]

Expect all rxns that are tagged with SK_ to be true sink rxns.

test_syntax.test_non_abc_transp_rxn_tag_match(read_only_model, store)[source]

Expect all non-abc transport reactions to be tagged with a t.

test_syntax.test_non_transp_rxn_id_compartment_suffix_match(read_only_model, store, non_cytosolic)[source]

Expect all reactions outside of the cytosol to be tagged accordingly.

test_syntax.test_non_transp_rxn_id_suffix_compartment_match(read_only_model, store, non_cytosolic)[source]

Expect compartment-tagged reactions to involve fitting metabolites.

test_syntax.test_sink_reaction_tag_match(read_only_model, store)[source]

Expect all sink reaction IDs to be prefixed with SK_.

test_syntax.test_upper_case_mets(read_only_model, store)[source]

Expect all metabolites to be lower case with accepted exceptions.