psamm.importer
– Import Functions¶
Entry points and functionality for importing models.
This module contains entry points for the psamm-import programs and functionality to assist in importing external file formats, converting them into proper native models and writing those models to files.
-
exception
psamm.importer.
ImportError
¶ Exception used to signal a general import error.
-
exception
psamm.importer.
ModelLoadError
¶ Exception used to signal an error loading the model files.
-
exception
psamm.importer.
ParseError
¶ Exception used to signal an error parsing the model files.
-
class
psamm.importer.
Importer
¶ Base importer class.
-
psamm.importer.
get_default_compartment
(model)¶ Return what the default compartment should be set to.
If some compounds have no compartment, unique compartment name is returned to avoid collisions.
-
psamm.importer.
detect_best_flux_limit
(model)¶ Detect the best default flux limit to use for model output.
The default flux limit does not change the model but selecting a good value reduced the amount of output produced and reduces clutter in the output files.
-
psamm.importer.
reactions_to_files
(model, dest, writer, split_subsystem)¶ Turn the reaction subsystems into their own files.
If a subsystem has a number of reactions over the threshold, it gets its own YAML file. All other reactions, those that don’t have a subsystem or are in a subsystem that falls below the threshold, get added to a common reaction file.
Parameters: - model –
psamm_import.model.MetabolicModel
. - dest – output path for model files.
- writer –
psamm.datasource.native.ModelWriter
. - split_subsystem – Divide reactions into multiple files by subsystem.
- model –
-
psamm.importer.
model_exchange
(model)¶ Return exchange definition as YAML dict.
-
psamm.importer.
model_reaction_limits
(model)¶ Yield model reaction limits as YAML dicts.
-
psamm.importer.
infer_compartment_entries
(model)¶ Infer compartment entries for model based on reaction compounds.
-
psamm.importer.
infer_compartment_adjacency
(model)¶ Infer compartment adjacency for model based on reactions.
-
psamm.importer.
count_genes
(model)¶ Count the number of distinct genes in model reactions.
-
psamm.importer.
write_yaml_model
(model, dest='.', convert_exchange=True, split_subsystem=True)¶ Write the given NativeModel to YAML files in dest folder.
The parameter
convert_exchange
indicates whether the exchange reactions should be converted automatically to an exchange file.
-
psamm.importer.
main
(importer_class=None, args=None)¶ Entry point for import program.
If the
args
are provided, these should be a list of strings that will be used instead ofsys.argv[1:]
. This is mostly useful for testing.
-
psamm.importer.
main_bigg
(args=None, urlopen=<function urlopen>)¶ Entry point for BiGG import program.
If the
args
are provided, these should be a list of strings that will be used instead ofsys.argv[1:]
. This is mostly useful for testing.