biosimulators_utils.biosimulations package¶
Submodules¶
biosimulators_utils.biosimulations.data_model module¶
Data model for BioSimulations metadata
- Author
Jonathan Karr <karr@mssm.edu>
- Date
2020-12-06
- Copyright
2020, Center for Reproducible Biomedical Modeling
- License
MIT
- class biosimulators_utils.biosimulations.data_model.Citation(title=None, authors=None, journal=None, volume=None, issue=None, pages=None, year=None, identifiers=None)[source]¶
Bases:
object
A citation
- class biosimulators_utils.biosimulations.data_model.ExternalReferences(identifiers=None, citations=None)[source]¶
Bases:
object
Identifiers and citations of an object
- is_equal(other)[source]¶
Determine if collections of external references are equal
- Parameters
other (
ExternalReferences
) – another collection of external referencse- Returns
True
, if two collections of external references are equal- Return type
bool
- class biosimulators_utils.biosimulations.data_model.Metadata(description=None, tags=None, authors=None, references=None, license=None, created=None, updated=None)[source]¶
Bases:
object
Metadata about an object
biosimulators_utils.biosimulations.utils module¶
Utility methods for working with BioSimulations and runBioSimulations
- Author
Jonathan Karr <karr@mssm.edu>
- Date
2021-01-30
- Copyright
2021, Center for Reproducible Biomedical Modeling
- License
MIT
- biosimulators_utils.biosimulations.utils.get_api_session(num_retries=5, backoff_factor=10, config=None)[source]¶
Get a session for the BioSimulations API with retrying
- Parameters
num_retries (
int
) – number of times to retry each querybackoff_factor (
float
) – initial delay between retriesconfig (
Config
, optional) – configuration
- Returns
session
- Return type
requests.Session
- biosimulators_utils.biosimulations.utils.get_authorization_for_client(id, secret, config=None)[source]¶
Get the authorization for a client of the BioSimulations API
- Parameters
id (
str
) – id of the API clientsecret (
str
) – secret for API clientconfig (
Config
, optional) – configuration
- Returns
authorization for the client
- Return type
str
- biosimulators_utils.biosimulations.utils.get_published_project(project_id, config=None)[source]¶
Publish a project to BioSimulations
- Parameters
project_id (
str
) – desired id for the published projectconfig (
Config
, optional) – configuration
- Returns
in schema
Project
orNone
if the project doesn’t exist- Return type
dict
- biosimulators_utils.biosimulations.utils.publish_simulation_project(run_id, project_id, overwrite=True, auth=None, config=None)[source]¶
Publish a project to BioSimulations
- Parameters
run_id (
str
) – id of the simulation run to publishproject_id (
str
) – desired id for the published project(obj (auth) – str, optional): authorization for the BioSimulations; needed to claim edit the published project in the future
config (
Config
, optional) – configuration
- biosimulators_utils.biosimulations.utils.run_simulation_project(name, filename_or_url, simulator, simulator_version='latest', cpus=1, memory=8, max_time=20, env_vars=None, purpose='other', email=None, project_id=None, auth=None, config=None)[source]¶
Submit a simulation project (COMBINE/OMEX archive) to runBioSimulations and, optionally, BioSimulations
- Parameters
name (
str
) – name for the simulation runfilename_or_url (
str
) – path or URL to COMBINE/OMEX archivesimulator (
str
) – BioSimulators id for simulatorsimulator_version (
str
, optional) – simulator versioncpus (
int
, optional) – CPUsmemory (
float
, optional) – maximum memory in GBmax_time (
float
, optional) – maximum execution time in minutesenv_vars (
list
ofdict
, optional) – environment variables to execute the COMBINE/OMEX archive. Each element should have two string-valued keyskey
andvalue
purpose (
str
, optional) – purpose (academic
orother
)email (
str
, optional) – email to receive a notification upon completion of the simulation runproject_id (
str
, optional) – id to publish the run as to BioSimulations(obj (auth) – str, optional): authorization for the BioSimulations; needed to claim edit the published project in the future
config (
Config
, optional) – configuration
- Returns
runBioSimulations id
- Return type
str
- biosimulators_utils.biosimulations.utils.validate_biosimulations_api_response(response, failure_introductory_message, exception_type=None)[source]¶
Validate a response from one of BioSimulation’s APIs.
- Parameters
response (
requests.models.Response
) – API responsefailure_introductory_message (
str
) – introductory message for failuresexception_type (
type
, optional) – type of exception to throw
- Raises
requests.RequestException –