sbmlutils.biomodels

Utilities for downloading biomodel models.

Module Contents

Functions

download_file(url, path)

Download file from url to path.

download_biomodel_omex(biomodel_id, omex_path)

Download omex for biomodel id.

download_biomodel_sbml(biomodel_id, output_dir[, ...])

Download SBML file for biomodel.

query_curated_biomodels()

Query the curated biomodels.

_create_biomodels_testfiles(output_dir)

Download all curated biomodels and create omex files.

Attributes

logger

output_dir

sbmlutils.biomodels.logger[source]
sbmlutils.biomodels.download_file(url, path)[source]

Download file from url to path.

Raises HTTPError, if one occurred.

Parameters:
  • url (str) –

  • path (pathlib.Path) –

Return type:

pathlib.Path

sbmlutils.biomodels.download_biomodel_omex(biomodel_id, omex_path)[source]

Download omex for biomodel id.

This downloads the latest version of the OMEX from biomodels via the rest service.

Returns:

path to omex

Parameters:
  • biomodel_id (str) –

  • omex_path (pathlib.Path) –

Return type:

pathlib.Path

Raises HTTPError, if one occurred, i.e. if the model does not exist.

sbmlutils.biomodels.download_biomodel_sbml(biomodel_id, output_dir, output_format='sbml')[source]

Download SBML file for biomodel.

Retrieves the archive from biomodels and gets the SBML files from it. Stores the raw SBML files for output_format=’sbml’ or creates an OMEX archive in case of output_format=’omex’.

Parameters:
  • output_format (str) – ‘sbml’ or ‘omex’

  • biomodel_id (str) –

  • output_dir (pathlib.Path) –

Returns:

list of location strings

Return type:

List[str]

Raises HTTPError, if one occurred, i.e. if the model does not exist. Raises ValueError, if invalid format string is provided.

sbmlutils.biomodels.query_curated_biomodels()[source]

Query the curated biomodels.

:return List of biomodel identifiers

Return type:

List[str]

sbmlutils.biomodels._create_biomodels_testfiles(output_dir)[source]

Download all curated biomodels and create omex files.

Parameters:

output_dir (pathlib.Path) –

Return type:

None

sbmlutils.biomodels.output_dir[source]