booldog.io.biomodels

API to download and use SBML-qual models from bio.models directly.

Attributes

logger

BIOMODELS_BASE_URL

MAMO_ACCESSIONS

MAMO accessions for models that are compatible with BoolDog.

EXAMPLE_MODEL_ID

BioModels model identifier for an example SBML-qual model (Chaouiya2013

Functions

fetch_model(model_id[, sbml_file, local_file, ...])

Fetch SBML from BioModels by model id

fetch_model_info(model_id)

Fetch model info/metadata from BioModels by model id.

_download(model_id[, filename, local_file])

Downloads a file from a model in BioModels

Module Contents

booldog.io.biomodels.logger
booldog.io.biomodels.BIOMODELS_BASE_URL = 'https://www.biomodels.org/'
booldog.io.biomodels.MAMO_ACCESSIONS = ['MAMO_0000030', 'MAMO_0000053']

MAMO accessions for models that are compatible with BoolDog.

The list contains the following accessions: * MAMO_0000030: logical model (http://identifiers.org/mamo/MAMO_0000030) * MAMO_0000053: Boolean model (http://identifiers.org/mamo/MAMO_0000053)

Type:

list

booldog.io.biomodels.EXAMPLE_MODEL_ID = 'BIOMD0000000562'

BioModels model identifier for an example SBML-qual model (Chaouiya2013 - EGF and TNFalpha mediated signalling pathway). See https://www.ebi.ac.uk/biomodels/BIOMD0000000562 for more details.

Type:

str

booldog.io.biomodels.fetch_model(model_id, sbml_file=None, local_file=None, check_modelling_approach=False)

Fetch SBML from BioModels by model id

Parameters:
  • model_id (str) – BioModels model identifier (e.g. ‘BIOMD0000000562’)

  • sbml_file (str) – Name of the file containing the model in the BioModels registry. Optional, if not given, will be determined from the model info.

  • local_file (str or path-like) – Name of path to save the downloaded model to. Optional, if not given will save the model to the a file in the cwd with the name as on the remote server.

  • check_modelling_approach (Bool) – Whether to check modelling annotation “modellingApproach” falls into Boolean or logical modelling.

Returns:

local_file – Name of the local file containing the download.

Return type:

str

Notes

This first collects the model info/metadata, and uses the ‘files’ –> ‘main’ attribute to find the first file with ‘SBML’/’sbml’ in the beginning of the description.

Will always overwrite an existing file.

booldog.io.biomodels.fetch_model_info(model_id)

Fetch model info/metadata from BioModels by model id.

Parameters:

model_id (str) – BioModels model identifier (e.g. ‘BIOMD0000000562’)

Returns:

Model info/metadata as a dictionary.

Return type:

dict

booldog.io.biomodels._download(model_id, filename=None, local_file=None)

Downloads a file from a model in BioModels

Parameters:

model_id (str) – BioModels model identifier (e.g. )

Returns:

local_file – Name of the local file containing the download.

Return type:

str