4. biomodels_qc package¶
4.1. Submodules¶
4.2. biomodels_qc.convert module¶
Methods for converting the primary files for an entry of the BioModels database to alternative formats such as BioPAX, MATLAB/Octave, and XPP.
- Author
Jonathan Karr <karr@mssm.edu>
- Date
2021-04-24
- Copyright
2021, BioSimulations Team
- License
MIT
- class biomodels_qc.convert.AltSbmlFormat(value)[source]¶
Bases:
str
,enum.Enum
A format that an SBML file can be converted to
- biomodels_qc.convert.convert_entry(dirname, alt_sbml_formats=None)[source]¶
Convert the primary files for an entry of the BioModels database to alternative formats such as BioPAX, MATLAB/Octave, and XPP.
- Parameters
dir (
str
) – path to directory for a entry of the BioModels databasealt_sbml_formats (
list
ofAltSbmlFormat
, optional) – list of formats to convert SBML files to
- biomodels_qc.convert.convert_sbml(filename, alt_format, alt_filename)[source]¶
Convert a SBML file to another format
SBML (with URNs)
MATLAB
Octave
OMEX metadata
XPP
- Parameters
filename (
str
) – path to SBML filealt_format (
AltSbmlFormat
) – another formatalt_filename (
str
) – path to save converted file
4.3. biomodels_qc.utils module¶
Utilities for quality controlling BioModels
- Author
Jonathan Karr <karr@mssm.edu>
- Date
2021-04-24
- Copyright
2021, BioSimulations Team
- License
MIT
- biomodels_qc.utils.are_biopax_files_the_same(filename_a, filename_b)[source]¶
Determine if two BioPAX files are the same, ignoring the time stamps when they were generated
- Parameters
filename_a (
str
) – path to first BioPAX filefilename_b (
str
) – path to second BioPAX file
- Returns
whether the files are the same, ignoring the time stamps when they were generated
- Return type
bool
- biomodels_qc.utils.build_combine_archive(archive_dirname, master_rel_filenames, description=None, authors=None)[source]¶
Build a COMBINE/OMEX archive from a directory of files
- Parameters
archive_dirname (
str
) – path to directory with the contents of the archivemaster_rel_filenames (
list
ofstr
) – filename of master file, relative toarchive_dirname
description (
str
, optional) – description of the archiveauthors (
list
ofPerson
, optional) – authors of the archive
- Returns
archive
- Return type
CombineArchive
- biomodels_qc.utils.does_sbml_file_represent_core_kinetic_model(filename)[source]¶
Determine whether an SBML file represents a core kinetic model
- Parameters
filename (
str
) – path to SBML file- Returns
whether the file represents a core kinetic model (i.e., doesn’t use other mathematical package)
- Return type
bool
- biomodels_qc.utils.get_smbl_files_for_entry(dir, include_urn_files=False)[source]¶
Get the paths to the SBML files for an entry of the BioModels database
- Parameters
dir (
str
) – path to directory for a entry of the BioModels databaseinclude_urn_files (
bool
, optional) – whether to include the autogenerated URN files
- Returns
SBML files for an entry of the BioModels database
- Return type
list
ofstr
4.4. biomodels_qc.validation module¶
Methods for validating entries of the BioModels database.
- Author
Jonathan Karr <karr@mssm.edu>
- Date
2021-04-24
- Copyright
2021, BioSimulations Team
- License
MIT
- biomodels_qc.validation.validate_combine_archive(filename)[source]¶
Determine if a COMBINE/OMEX archive is valid
- Parameters
filename (
str
) – path to COMBINE/OMEX archive- Returns
nested
list
ofstr
: nested list of errorsnested
list
ofstr
: nested list of warnings
- Return type
tuple
- biomodels_qc.validation.validate_copasi_file(filename)[source]¶
Determine if a COPASI file is valid
- Parameters
filename (
str
) – path to COPASI file- Returns
nested
list
ofstr
: nested list of errorsnested
list
ofstr
: nested list of warnings
- Return type
tuple
- biomodels_qc.validation.validate_copasi_file_in_subprocess(filename)[source]¶
Determine if a COPASI file is valid, handling segmentation faults in COPASI
- Parameters
filename (
str
) – path to COPASI file- Returns
nested
list
ofstr
: nested list of errorsnested
list
ofstr
: nested list of warnings
- Return type
tuple
- biomodels_qc.validation.validate_entry(dirname, file_extensions=None, filenames=None, simulators=None)[source]¶
Validate an entry of the BioModels databse
- Parameters
dirname (
str
) – path to directory for a entry of the BioModels databasefile_extensions (
list
ofstr
, optional) – list of file extensions (e.g., .png) to validate. Default: validate all file extensionsfilenames (
list
ofstr
, optional) – list of specific files to validate. Overides thefile_extensions
argument. Default: validate all files.simulators (
list
ofdict
, optional) – specifications of simulators to use to check that SED-ML files can be executed. Each dictionary should have the schemahttps://api.biosimulators.org/openapi.json#/components/schemas/Simulator
, or two keysid
andversion
.
- Returns
nested
list
ofstr
: nested list of errorsnested
list
ofstr
: nested list of warnings
- Return type
tuple
- biomodels_qc.validation.validate_filename(filename)[source]¶
Determine if a filename is valid
Check that name only involves alphanumeric characters, underscores and dashes
- Parameters
filename (
str
) – path to file- Returns
nested
list
ofstr
: nested list of errorsnested
list
ofstr
: nested list of warnings
- Return type
tuple
- biomodels_qc.validation.validate_image_file(filename, image_format)[source]¶
Determine if an image file is valid
- Parameters
filename (
str
) – path to image fileimage_format (
ImageFormat
) – image format
- Returns
nested
list
ofstr
: nested list of errorsnested
list
ofstr
: nested list of warnings
- Return type
tuple
- biomodels_qc.validation.validate_ipynb_notebook_file(filename)[source]¶
Determine if an IPython/Jupyter notebook file is valid
- Parameters
filename (
str
) – path to notebook file- Returns
nested
list
ofstr
: nested list of errorsnested
list
ofstr
: nested list of warnings
- Return type
tuple
- biomodels_qc.validation.validate_matlab_data_file(filename)[source]¶
Determine if a MATLAB data file is valid
- Parameters
filename (
str
) – path to data file- Returns
nested
list
ofstr
: nested list of errorsnested
list
ofstr
: nested list of warnings
- Return type
tuple
- biomodels_qc.validation.validate_octave_file(filename)[source]¶
Determine if an Octave file is valid
- Parameters
filename (
str
) – path to Octave file- Returns
nested
list
ofstr
: nested list of errorsnested
list
ofstr
: nested list of warnings
- Return type
tuple
- biomodels_qc.validation.validate_owl_ontology_file(filename)[source]¶
Determine if an OWL ontology file is valid
- Parameters
filename (
str
) – path to OWL file- Returns
nested
list
ofstr
: nested list of errorsnested
list
ofstr
: nested list of warnings
- Return type
tuple
- biomodels_qc.validation.validate_pdf_file(filename)[source]¶
Determine if a PDF file is valid
- Parameters
filename (
str
) – path to PDF file- Returns
nested
list
ofstr
: nested list of errorsnested
list
ofstr
: nested list of warnings
- Return type
tuple
- biomodels_qc.validation.validate_python_file(filename)[source]¶
Determine if a Python file is valid
- Parameters
filename (
str
) – path to Python file- Returns
nested
list
ofstr
: nested list of errorsnested
list
ofstr
: nested list of warnings
- Return type
tuple
- biomodels_qc.validation.validate_sbml_file(filename)[source]¶
Determine if a SBML file is valid
- Parameters
filename (
str
) – path to SBML file- Returns
nested
list
ofstr
: nested list of errorsnested
list
ofstr
: nested list of warnings
- Return type
tuple
- biomodels_qc.validation.validate_scilab_file(filename)[source]¶
Determine if an Scilab file is valid
- Parameters
filename (
str
) – path to Scilab file- Returns
nested
list
ofstr
: nested list of errorsnested
list
ofstr
: nested list of warnings
- Return type
tuple
- biomodels_qc.validation.validate_sedml_file(filename, dirname=None, max_number_of_time_course_steps=1000, simulators=None)[source]¶
Determine if a SED-ML file is valid, optionally including checking whether it can be executed by 1 or more simulation tools
- Parameters
filename (
str
) – path to SED-ML filedirname (
str
, optional) – directory for the BioModels entry which includes this SED-ML filemax_number_of_time_course_steps (
str
, optional) – maximum number of steps of a uniform time course before a warning for potentially excessive steps is raisedsimulators (
list
ofdict
, optional) – specifications of simulators to use to check that the SED-ML file can be executed. Each dictionary should have the schemahttps://api.biosimulators.org/openapi.json#/components/schemas/Simulator
, or two keysid
andversion
.
- Returns
nested
list
ofstr
: nested list of errorsnested
list
ofstr
: nested list of warnings
- Return type
tuple
- biomodels_qc.validation.validate_vcml_file(filename)[source]¶
Determine if an VCML file is valid
- Parameters
filename (
str
) – path to VCML file- Returns
nested
list
ofstr
: nested list of errorsnested
list
ofstr
: nested list of warnings
- Return type
tuple
- biomodels_qc.validation.validate_xml_file(filename)[source]¶
Determine if an XML file is valid
- Parameters
filename (
str
) – path to XML file- Returns
nested
list
ofstr
: nested list of errorsnested
list
ofstr
: nested list of warnings
- Return type
tuple
4.5. biomodels_qc.warnings module¶
Warnings
- Author
Jonathan Karr <karr@mssm.edu>
- Date
2021-06-06
- Copyright
2021, BioSimulations Team
- License
MIT
- exception biomodels_qc.warnings.FileCouldNotBeConvertedWarning[source]¶
Bases:
biomodels_qc.warnings.BiomodelsQcWarning
Warning for a problem converting a file to another format