17.1.1.8. cobra.test
¶
17.1.1.8.1. Subpackages¶
- 17.1.1.8.1.1.
cobra.test.data
- 17.1.1.8.1.2.
cobra.test.test_core
- 17.1.1.8.1.2.1.1.
cobra.test.test_core.conftest
- 17.1.1.8.1.2.1.2.
cobra.test.test_core.test_configuration
- 17.1.1.8.1.2.1.3.
cobra.test.test_core.test_core_reaction
- 17.1.1.8.1.2.1.4.
cobra.test.test_core.test_dictlist
- 17.1.1.8.1.2.1.5.
cobra.test.test_core.test_gene
- 17.1.1.8.1.2.1.6.
cobra.test.test_core.test_group
- 17.1.1.8.1.2.1.7.
cobra.test.test_core.test_metabolite
- 17.1.1.8.1.2.1.8.
cobra.test.test_core.test_model
- 17.1.1.8.1.2.1.9.
cobra.test.test_core.test_solution
- 17.1.1.8.1.2.1.1.
- 17.1.1.8.1.3.
cobra.test.test_flux_analysis
- 17.1.1.8.1.3.1.1.
cobra.test.test_flux_analysis.conftest
- 17.1.1.8.1.3.1.2.
cobra.test.test_flux_analysis.test_deletion
- 17.1.1.8.1.3.1.3.
cobra.test.test_flux_analysis.test_fastcc
- 17.1.1.8.1.3.1.4.
cobra.test.test_flux_analysis.test_gapfilling
- 17.1.1.8.1.3.1.5.
cobra.test.test_flux_analysis.test_geometric
- 17.1.1.8.1.3.1.6.
cobra.test.test_flux_analysis.test_loopless
- 17.1.1.8.1.3.1.7.
cobra.test.test_flux_analysis.test_moma
- 17.1.1.8.1.3.1.8.
cobra.test.test_flux_analysis.test_parsimonious
- 17.1.1.8.1.3.1.9.
cobra.test.test_flux_analysis.test_phenotype_phase_plane
- 17.1.1.8.1.3.1.10.
cobra.test.test_flux_analysis.test_reaction
- 17.1.1.8.1.3.1.11.
cobra.test.test_flux_analysis.test_room
- 17.1.1.8.1.3.1.12.
cobra.test.test_flux_analysis.test_variability
- 17.1.1.8.1.3.1.1.
- 17.1.1.8.1.4.
cobra.test.test_io
- 17.1.1.8.1.4.1.1.
cobra.test.test_io.conftest
- 17.1.1.8.1.4.1.2.
cobra.test.test_io.test_annotation
- 17.1.1.8.1.4.1.3.
cobra.test.test_io.test_annotation_format
- 17.1.1.8.1.4.1.4.
cobra.test.test_io.test_io_order
- 17.1.1.8.1.4.1.5.
cobra.test.test_io.test_json
- 17.1.1.8.1.4.1.6.
cobra.test.test_io.test_mat
- 17.1.1.8.1.4.1.7.
cobra.test.test_io.test_notes
- 17.1.1.8.1.4.1.8.
cobra.test.test_io.test_pickle
- 17.1.1.8.1.4.1.9.
cobra.test.test_io.test_sbml
- 17.1.1.8.1.4.1.10.
cobra.test.test_io.test_yaml
- 17.1.1.8.1.4.1.1.
- 17.1.1.8.1.5.
cobra.test.test_sampling
- 17.1.1.8.1.6.
cobra.test.test_util
17.1.1.8.2. Submodules¶
17.1.1.8.3. Package Contents¶
17.1.1.8.3.1. Functions¶
|
Reads SBML model from given filename. |
|
Returns a cobra model for testing |
|
alias for running all unit-tests on installed cobra |
-
cobra.test.
read_sbml_model
(filename, number=float, f_replace=F_REPLACE, **kwargs)¶ Reads SBML model from given filename.
If the given filename ends with the suffix ‘’.gz’’ (for example, ‘’myfile.xml.gz’),’ the file is assumed to be compressed in gzip format and will be automatically decompressed upon reading. Similarly, if the given filename ends with ‘’.zip’’ or ‘’.bz2’,’ the file is assumed to be compressed in zip or bzip2 format (respectively). Files whose names lack these suffixes will be read uncompressed. Note that if the file is in zip format but the archive contains more than one file, only the first file in the archive will be read and the rest ignored.
To read a gzip/zip file, libSBML needs to be configured and linked with the zlib library at compile time. It also needs to be linked with the bzip2 library to read files in bzip2 format. (Both of these are the default configurations for libSBML.)
This function supports SBML with FBC-v1 and FBC-v2. FBC-v1 models are converted to FBC-v2 models before reading.
The parser tries to fall back to information in notes dictionaries if information is not available in the FBC packages, e.g., CHARGE, FORMULA on species, or GENE_ASSOCIATION, SUBSYSTEM on reactions.
- Parameters
filename (path to SBML file, or SBML string, or SBML file handle) – SBML which is read into cobra model
number (data type of stoichiometry: {float, int}) – In which data type should the stoichiometry be parsed.
f_replace (dict of replacement functions for id replacement) – Dictionary of replacement functions for gene, specie, and reaction. By default the following id changes are performed on import: clip G_ from genes, clip M_ from species, clip R_ from reactions If no replacements should be performed, set f_replace={}, None
- Returns
- Return type
Notes
- Provided file handles cannot be opened in binary mode, i.e., use
- with open(path, “r” as f):
read_sbml_model(f)
File handles to compressed files are not supported yet.