Package: indra
INDRAINDRA (Integrated Network and Dynamical Reasoning Assembler) is an automated
model assembly system, originally developed for molecular systems biology and
then generalized to other domains (seeINDRA
World). INDRA draws on natural
language processing systems and structured databases to collect mechanistic and
causal assertions, represents them in a standardized form (INDRA Statements),
and assembles them into various modeling formalisms including causal graphs and
dynamical models.At the core of INDRA are its knowledge-level assembly procedures, allowing
sources to be assembled into coherent models, a process that involves
correcting systematic input errors, finding and resolving redundancies,
inferring missing information, filtering to a relevant scope and assessing the
reliability of causal information.The detailed INDRA documentation is available athttp://indra.readthedocs.io.ContentsINDRA ModulesKnowledge sourcesOutput model assemblersInternal knowledge assemblyOther modulesCitationInstallationINDRA REST APIINDRA DockerUsing INDRAFundingINDRA ModulesKnowledge sourcesINDRA is currently integrated with the following natural language processing
systems and structured databases. These input modules (available inindra.sources) all produce INDRA Statements.Reading systems:ReaderModuleReferenceTRIPS/DRUMindra.sources.tripshttp://trips.ihmc.us/parser/cgi/drumREACHindra.sources.reachhttps://github.com/clulab/reachSparserindra.sources.sparserhttps://github.com/ddmcdonald/sparserEidosindra.sources.eidoshttps://github.com/clulab/eidosTEESindra.sources.teeshttps://github.com/jbjorne/TEESMedScanindra.sources.medscanhttps://doi.org/10.1093/bioinformatics/btg207RLIMS-Pindra.sources.rlimsphttps://research.bioinformatics.udel.edu/rlimspISI/AMRindra.sources.isihttps://github.com/sgarg87/big_mech_isi_ggGenewaysindra.sources.genewayshttps://www.ncbi.nlm.nih.gov/pubmed/15016385GNBRindra.sources.gnbrhttps://zenodo.org/record/3459420SemRepindra.sources.semrephttps://github.com/lhncbc/SemRepBiological pathway databases:Database / Exchange formatModuleReferencePathwayCommons / BioPaxindra.sources.biopaxhttp://pathwaycommons.org/http://www.biopax.org/Large Corpus / BELindra.sources.belhttps://github.com/pybel/pybelhttps://github.com/OpenBELSignorindra.sources.signorhttps://signor.uniroma2.it/BioGRIDindra.sources.biogridhttps://thebiogrid.org/Target Affinity Spectrumindra.sources.tashttps://doi.org/10.1101/358978HPRDindra.sources.hprdhttp://www.hprd.orgTRRUSTindra.sources.trrusthttps://www.grnpedia.org/trrust/Phospho.ELMindra.sources.phosphoelmhttp://phospho.elm.eu.org/VirHostNetindra.sources.virhostnethttp://virhostnet.prabi.fr/CTDindra.sources.ctdhttp://ctdbase.orgDrugBankindra.sources.drugbankhttps://www.drugbank.ca/OmniPathindra.sources.omnipathhttps://omnipathdb.org/DGIindra.sources.dgihttps://www.dgidb.org/CRoGindra.sources.croghttps://github.com/chemical-roles/chemical-rolesCREEDSindra.sources.creedshttps://maayanlab.cloud/CREEDS/UbiBrowserindra.sources.ubibrowserhttp://ubibrowser.ncpsb.org.cn/ACSNindra.sources.acsnhttps://acsn.curie.fr/ACSN2/ACSN2.htmlCustom knowledge bases:Database / Exchange formatModuleReferenceNDEx / CXindra.sources.ndex_cxhttp://ndexbio.orgINDRA DB / INDRA Statementsindra.sources.indra_db_resthttps://github.com/indralab/indra_dbHypothes.isindra.sources.hypothesishttps://hypothes.isBiofactoidindra.sources.biofactoidhttps://biofactoid.org/MINERVAindra.sources.minervahttps://covid19map.elixir-luxembourg.org/minerva/Output model assemblersINDRA also provides several model output assemblers that take INDRA Statements
as input. The most sophisticated model assembler is the PySB Assembler, which
implements a policy-guided automated assembly procedure of a rule-based
executable model (that can then be further compiled into other formats such as
SBML, Kappa, BNGL and SBGN to connect to a vast ecosystem of downstream tools).
Several other model assembly modules target various network formats for
visualization, and graph/structural analysis (PyBEL, CyJS, Graphviz, SBGN,
CX, SIF, etc.) and curation (HTML, TSV, IndexCards).
Finally, the English Assembler produces English language descriptions of a set
of INDRA Statements.INDRA also supports extension by outside model assembly tools which take
INDRA Statements as input and produce models. One such example is Delphi
(https://github.com/ml4ai/delphi), which is a Dynamic Bayesian Network
model assembler. Similarly, outside tools that support INDRA Statements
can implement custom visualization methods, such as CauseMos, developed
by Uncharted Software (https://uncharted.software/).Assemblers aimed at model-driven discovery and analysis:Modeling formalism / Exchange formatPurposeModuleReferencePySB (-> SBML, SBGN, BNGL, Kappa, etc.)Detailed, mechanistic modeling, simulation, analysisindra.assemblers.pysbhttp://pysb.orgPyBELCausal analysis, visualizationindra.assemblers.pybelhttps://github.com/pybel/pybelhttps://bel-commons.scai.fraunhofer.de/IndraNetCausal analysis, signed and unsignedindra.assemblers.indranetSIFNetwork analysis, logic modeling, visualizationindra.assemblers.sifSIF formatKAMIKnowledge aggregation of protein sites/states and Kappa modelingindra.assemblers.kamihttps://github.com/Kappa-Dev/KAMIAssemblers primarily aimed at visualization:Network / Exchange formatPurposeModuleReferenceCausal Analysis GraphGeneral causal graph visualizationindra.assemblers.cagCXNetwork browsing, versioning on NDExindra.assemblers.cxhttp://ndexbio.orgCytoscape JSInteractive Cytoscape JS network to embed in websitesindra.assemblers.cyjshttp://js.cytoscape.org/GraphvizStatic PDF/PNG visualization with powerful automated layout using Graphvizindra.assemblers.graphhttps://www.graphviz.org/SBGNVisualization with Systems Biology Graphical Notationindra.assemblers.sbgnhttp://sbgn.orgAssemblers primarily aimed at expert curation and browsing:Output formatPurposeModuleReferenceEnglish languageHuman-readable descriptions, reports, dialogueindra.assemblers.englishHTMLWeb-based browsing, linking out to provenance, curationindra.assemblers.htmlCuration tutorialTSV (Tab/Comma Separated Values)Spreadsheet-based browsing and curationindra.assemblers.tsvIndex CardsCustom JSON format for curating biological mechanismsindra.assemblers.index_cardInternal knowledge assemblyA key feature of INDRA is providing internal knowledge-assembly modules
that operate on INDRA Statements and perform the following tasks:Redundancy/subsumption/generalization/contradiction finding and resolution
with respect to an ontology with the Preassembler
(indra.preassembler.Preassembler)Belief calculation based on evidence using the BeliefEngine
(indra.belief)Mapping grounding between multiple ontologies
(indra.preassembler.ont_mapper.OntMapper)Grounding override and disambiguation
(indra.preassembler.grounding_mapper.GroundingMapper)Protein sequence mapping (indra.preassembler.site_mapper.SiteMapper)The internal assembly steps of INDRA including the ones listed above, and also
a large collection of filters (filter by source, belief, the presence of
grounding information, semantic filters by entity role, etc.) are exposed
in theindra.tools.assemble_corpussubmodule. This submodule contains functions that
take Statements as input and produce processed Statements as output. They can
be composed to form an assembly pipeline connecting knowledge collected from
sources with an output model.This diagram illustrates the assembly pipeline process.The choice of assembly functions can vary depending on the domain (i.e,
biology or world modeling), the modeling goal (i.e., the type of model that
will be assembled and how that model will be used), desired features, and
confidence (e.g., filter to human genes only or apply a belief cutoff),
and any other user preferences.An example of a typical assembly pipeline for biology statements is as follows.
Some of the below steps can be removed, rearranged, and other steps added
to change the assembly pipeline.fromindra.toolsimportassemble_corpusasacstmts=<thecollectionofallrawstatementstouse>stmts=ac.filter_no_hypothesis(stmts)# Filter out hypothetical statementsstmts=ac.map_grounding(stmts)# Map groundingstmts=ac.filter_grounded_only(stmts)# Filter out ungrounded agentsstmts=ac.filter_human_only(stmts)# Filter out non-human genesstmts=ac.map_sequence(stmts)# Map sequencestmts=ac.run_preassembly(stmts,# Run preassemblyreturn_toplevel=False)stmts=ac.filter_belief(stmts,0.8)# Apply belief cutoff of 0.8An example of an assembly pipeline for statements in the world modeling domain
is as follows (note how biology-specific functions are not used, and a custom
belief_scorer and ontology is passed torun_preassemblyhere, while the
biology pipeline used default values). Note that this example requires
theindra_worldpackage to be installed.fromindra.toolsimportassemble_corpusasacfromindra_world.belief.wm_scorerimportget_eidos_scorerfromindra_world.ontology.worldimportworld_ontologystmts=<thecollectionofallrawstatementstouse>stmts=ac.filter_grounded_only(stmts)# Filter out ungrounded agentsbelief_scorer=get_eidos_scorer()stmts=ac.run_preassembly(stmts,# Run preassemblyreturn_toplevel=False,belief_scorer=belief_scorer,ontology=world_ontology,normalize_equivalences=True,# Optional: rewrite equivalent groundings to one standardnormalize_opposites=True,# Optional: rewrite opposite groundings to one standardnormalize_ns='WM')# Use 'WM' namespace to normalize equivalences and oppositesstmts=ac.filter_belief(stmts,0.8)# Apply belief cutoff of e.g., 0.8Assembled statements returned after running the assembly pipeline can be
passed into any of the output model assemblers.Other modulesINDRA also contains modules to access literature content (e.g., PubMed, Elsevier), available inindra.literature, and
access ontological information and convert between identifiers (e.g., UniProt,
HGNC), available inindra.databases.
A full list of further INDRA modules is available in thedocumentation.CitationGyori B.M., Bachman J.A., Subramanian K., Muhlich J.L., Galescu L., Sorger P.K.From word models to executable models of signaling networks using automated
assembly(2017),
Molecular Systems Biology, 13, 954.Bachman J.A., Gyori B.M., Sorger P.K.Automated assembly of molecular mechanisms at scale from text mining and
curated databases(2022),
bioRxiv preprintInstallationFor detailed installation instructions,see the documentation.INDRA currently supports Python 3.6+. The last release of INDRA compatible
with Python 2.7 is 1.10, and the last release fully compatible with Python 3.5
is 1.17.The preferred way to install INDRA is by pointing pip to the source repository
as$ pip install git+https://github.com/sorgerlab/indra.gitReleases of INDRA are also available onPyPI, you can install the latest
release as$ pip install indraHowever, releases will usually be behind the latest code available in this
repository.INDRA depends on a few standard Python packages. These packages are installed
by pip during setup.
For certain modules and use cases, other "extra" dependencies may be needed,
which are described in detail in thedocumentation.INDRA REST APIA REST API for INDRA is available athttp://api.indra.bio:8000.
Note that the REST API is ideal for prototyping and for building light-weight
web apps, but should not be used for large reading and assembly workflows.INDRA DockerINDRA is available as a Docker image on Dockerhub and can be pulled asdocker pull labsyspharm/indraYou can run the INDRA REST API using the container asdocker run -id -p 8080:8080 --entrypoint python labsyspharm/indra /sw/indra/rest_api/api.pyThe Dockerfile to build the image locally is available in a separate repository
athttps://github.com/indralab/indra_docker.Using INDRAIn this example INDRA assembles a PySB model from the natural language
description of a mechanism via theTRIPS reading web
service.fromindra.sourcesimporttripsfromindra.assemblers.pysbimportPysbAssemblerpa=PysbAssembler()# Process a natural language description of a mechanismtrips_processor=trips.process_text('MEK2 phosphorylates ERK1 at Thr-202 and Tyr-204')# Collect extracted mechanisms in PysbAssemblerpa.add_statements(trips_processor.statements)# Assemble the modelmodel=pa.make_model(policies='two_step')INDRA also provides an interface for theREACHnatural language
processor. In this example, a full paper fromPubMed
Centralis processed. The paper's PMC ID isPMC8511698. The example
assumest that a REACH server is running locally (see documentation atindra.sources.reach).
Note that REACH takes about 8 minutes to read this full-text paper.fromindra.sourcesimportreachreach_processor=reach.process_pmc('PMC8511698',url=reach.local_nxml_url)At this point,reach_processor.statementscontains a list of INDRA statements
extracted from the PMC paper.Next we look at an example of reading the 10 most recent PubMed abstracts on
BRAF and collecting the results in INDRA statements.fromindra.sourcesimportreachfromindra.literatureimportpubmed_client# Search for 10 most recent abstracts in PubMed on 'BRAF'pmids=pubmed_client.get_ids('BRAF',retmax=10)all_statements=[]forpmidinpmids:abs=pubmed_client.get_abstract(pmid)ifabsisnotNone:reach_processor=reach.process_text(abs,url=reach.local_text_url)ifreach_processorisnotNone:all_statements+=reach_processor.statementsAt this point, theall_statementslist contains all the statements
extracted from the 10 abstracts.The next example shows querying theBEL large
corpusnetwork for a neighborhood of a given list of proteins using their
HGNC gene names. This example performs the query via PyBEL.fromindra.sourcesimportbel# Process the neighborhood of BRAF and MAP2K1bel_processor=bel.process_pybel_neighborhood(['BRAF','MAP2K1'])At this point,bel_processor.statementscontains a list of INDRA statements
extracted from the neighborhood query.Next, we look at an example of querying thePathway Commons
databasefor paths between two lists of proteins.fromindra.sourcesimportbiopax# Process the neighborhood of BRAF and MAP2K1biopax_processor=biopax.process_pc_pathsfromto(['BRAF','RAF1'],['MAP2K1','MAP2K2'])At this point,biopax_processor.statementscontains a list of INDRA
Statements extracted from the paths-from-to query.FundingThe development of INDRA has been funded from the following sources:ProgramGrant numberDARPA Big MechanismW911NF-14-1-0397DARPA World ModelersW911NF-18-1-0014DARPA Communicating with ComputersW911NF-15-1-0544DARPA Automated Scientific Discovery FrameworkW911NF-18-1-0124DARPA Automating Scientific Knowledge ExtractionHR00111990009DARPA PanaceaHR00111920022DARPA Young Faculty AwardW911NF-20-1-0255