MINERVA (indra.sources.minerva)

This module implements extracting INDRA Statements from COVID-19 Disease Map models (https://covid19map.elixir-luxembourg.org/minerva/). Currently it supports a processor that extracts statements from SIF export of the models.

More information about COVID-19 Disease Map project can be found at https://covid.pages.uni.lu

MINERVA Source API (indra.sources.minerva.api)

indra.sources.minerva.api.process_file(filename, model_id, map_name='covid19map')[source]

Get statements by processing a single local SIF file.

Parameters
  • filename (str) – A name (or path) of a local SIF file to process.

  • model_id (int) – ID of a model corresponding to file content. Model ID is needed to find relevant references.

  • map_name (str) – A name of a disease map to process.

Returns

sp – An instance of a SifProcessor with extracted INDRA statements.

Return type

indra.source.minerva.SifProcessor

indra.sources.minerva.api.process_files(ids_to_filenames, map_name='covid19map')[source]

Get statements by processing one or more local SIF files.

Parameters
  • ids_to_file_names (dict) – A dictionary mapping model IDs to files containing model content as SIF. Model IDs are needed to find relevant references.

  • map_name (str) – A name of a disease map to process.

Returns

sp – An instance of a SifProcessor with extracted INDRA statements.

Return type

indra.source.minerva.SifProcessor

indra.sources.minerva.api.process_from_web(filenames='all', map_name='covid19map')[source]

Get statements by processing remote SIF files.

Parameters
  • filenames (list or str('all')) – Filenames for models that need to be processed (for full list of available models see https://git-r3lab.uni.lu/covid/models/-/tree/master/ Executable%20Modules/SBML_qual_build/sif). If set to ‘all’ (default), then all available models will be processed.

  • map_name (str) – A name of a disease map to process.

Returns

sp – An instance of a SifProcessor with extracted INDRA statements.

Return type

indra.source.minerva.SifProcessor

MINERVA SIF Processor (indra.sources.minerva.processor)

class indra.sources.minerva.processor.SifProcessor(model_id_to_sif_strs, map_name='covid19map')[source]

Processor that extracts INDRA Statements from SIF strings.

Parameters
  • model_id_to_sif_strs (dict) – A dictionary mapping a model ID (int) to a list of strings in SIF format. Example: {799: [‘csa2 POSITIVE sa9’, ‘csa11 NEGATIVE sa30’]}

  • map_name (str) – A name of a disease map to process.

statements

A list of INDRA Statements extracted from the SIF strings.

Type

list[indra.statements.Statement]

indra.sources.minerva.processor.get_agent(element_id, ids_to_refs, complex_members)[source]

Get an agent for a MINERVA element.

Parameters
  • element_id (str) – ID of an element used in MINERVA API and raw SIF files.

  • ids_to_refs (dict) – A dictionary mapping element IDs to MINERVA provided references. Note that this mapping is unique per model (same IDs can be mapped to different refs in different models).

  • complex_members (dict) – A dictionary mapping element ID of a complex element to element IDs of its members.

Returns

agent – INDRA agent created from given refs.

Return type

indra.statements.agent.Agent

indra.sources.minerva.processor.get_agent_from_refs(db_refs)[source]

Get an agent given its db_refs.

indra.sources.minerva.processor.get_family(agents)[source]

Get a FamPlex family if all of its members are given.