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

BioPAX_l2 = 'BioPAX_l2'[source]
BioPAX_l3 = 'BioPAX_l3'[source]
MATLAB = 'MATLAB'[source]
OMEX_Metadata = 'OMEX_Metadata'[source]
Octave = 'Octave'[source]
SBML_URN = 'SBML_URN'[source]
XPP = 'XPP'[source]
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 database

  • alt_sbml_formats (list of AltSbmlFormat, 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 file

  • alt_format (AltSbmlFormat) – another format

  • alt_filename (str) – path to save converted file

biomodels_qc.convert.run_sbf_converter(filename, format)[source]

Run the Systems Biology Format Converter (SBFC)

Parameters
  • filename (str) – path to file to convert

  • format (str) – format to convert file to

Raises

ValueError – if the conversion failed

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 file

  • filename_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 archive

  • master_rel_filenames (list of str) – filename of master file, relative to archive_dirname

  • description (str, optional) – description of the archive

  • authors (list of Person, 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 database

  • include_urn_files (bool, optional) – whether to include the autogenerated URN files

Returns

SBML files for an entry of the BioModels database

Return type

list of str

biomodels_qc.utils.is_sbml_file(filename)[source]

Determine whether a file is an SBML file

Parameters

filename (str) – path to file

Returns

whether the file is an SBML file

Return type

bool

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 of str: nested list of errors

  • nested list of str: 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 of str: nested list of errors

  • nested list of str: 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 of str: nested list of errors

  • nested list of str: 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 database

  • file_extensions (list of str, optional) – list of file extensions (e.g., .png) to validate. Default: validate all file extensions

  • filenames (list of str, optional) – list of specific files to validate. Overides the file_extensions argument. Default: validate all files.

  • simulators (list of dict, optional) – specifications of simulators to use to check that SED-ML files can be executed. Each dictionary should have the schema https://api.biosimulators.org/openapi.json#/components/schemas/Simulator, or two keys id and version.

Returns

  • nested list of str: nested list of errors

  • nested list of str: 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 of str: nested list of errors

  • nested list of str: 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 file

  • image_format (ImageFormat) – image format

Returns

  • nested list of str: nested list of errors

  • nested list of str: 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 of str: nested list of errors

  • nested list of str: 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 of str: nested list of errors

  • nested list of str: 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 of str: nested list of errors

  • nested list of str: 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 of str: nested list of errors

  • nested list of str: 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 of str: nested list of errors

  • nested list of str: 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 of str: nested list of errors

  • nested list of str: 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 of str: nested list of errors

  • nested list of str: 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 of str: nested list of errors

  • nested list of str: 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 file

  • dirname (str, optional) – directory for the BioModels entry which includes this SED-ML file

  • max_number_of_time_course_steps (str, optional) – maximum number of steps of a uniform time course before a warning for potentially excessive steps is raised

  • simulators (list of dict, optional) – specifications of simulators to use to check that the SED-ML file can be executed. Each dictionary should have the schema https://api.biosimulators.org/openapi.json#/components/schemas/Simulator, or two keys id and version.

Returns

  • nested list of str: nested list of errors

  • nested list of str: 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 of str: nested list of errors

  • nested list of str: 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 of str: nested list of errors

  • nested list of str: nested list of warnings

Return type

tuple

biomodels_qc.validation.validate_xpp_file(filename)[source]

Determine if an XPP file is valid

Parameters

filename (str) – path to XPP file

Returns

  • nested list of str: nested list of errors

  • nested list of str: nested list of warnings

Return type

tuple

biomodels_qc.validation.validate_zip_file(filename)[source]

Determine if an zip archive file is valid

Parameters

filename (str) – path to zip archive file

Returns

  • nested list of str: nested list of errors

  • nested list of str: 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.BiomodelsQcWarning[source]

Bases: UserWarning

BioModels-QC warning

exception biomodels_qc.warnings.FileCouldNotBeConvertedWarning[source]

Bases: biomodels_qc.warnings.BiomodelsQcWarning

Warning for a problem converting a file to another format