# gyorilab/indra architecture

> Architecture diagram of the GitHub repository gyorilab/indra, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/gyorilab/indra
- Repository: https://github.com/gyorilab/indra

## Overview

INDRA turns mechanistic and causal assertions from text-reading systems and structured knowledge sources into standardized INDRA Statements, then corrects, grounds, deduplicates, scopes, and assesses them before assembling models. Its outputs include causal graphs and dynamical models; explanation tools analyze assembled models. The graph reflects documented product flow and sampled references; several source adapters and assembler formats are represented at subsystem level because their implementations were not excerpted.

Main entry points: [`indra/tools/assemble_corpus.py`](https://github.com/gyorilab/indra/blob/master/indra/tools/assemble_corpus.py) (Corpus assembly), [`indra/statements/statements.py`](https://github.com/gyorilab/indra/blob/master/indra/statements/statements.py) (INDRA Statements), [`indra/assemblers`](https://github.com/gyorilab/indra/tree/master/indra/assemblers) (Graph and format assemblers), [`indra/assemblers/pysb/assembler.py`](https://github.com/gyorilab/indra/blob/master/indra/assemblers/pysb/assembler.py) (PySB assembler)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_inputs["Knowledge inputs"]
  node_readers["Text readers"]
  node_reach["REACH reader<br/>[processor.py]"]
  node_structured["Structured sources"]
  node_dbrest["INDRA DB queries<br/>[query.py]"]
end

subgraph group_knowledge["Knowledge processing"]
  node_statements["INDRA Statements<br/>[statements.py]"]
  node_statementio["Statement serialization<br/>[io.py]"]
  node_pipeline["Assembly pipeline<br/>[pipeline.py]"]
  node_corpus["Corpus assembly<br/>[assemble_corpus.py]"]
  node_grounding["Grounding mapper"]
  node_preassembly["Preassembly"]
  node_mechlinker["Mechanism linking<br/>[__init__.py]"]
  node_belief["Belief scoring<br/>[__init__.py]"]
  node_ontology["Biology ontology<br/>[ontology.py]"]
end

subgraph group_outputs["Model outputs"]
  node_assemblers["Graph and format assemblers"]
  node_cx["CX assembler<br/>[assembler.py]"]
  node_pysb["PySB assembler<br/>[assembler.py]"]
  node_pysbexport["PySB export<br/>[export.py]"]
end

subgraph group_analysis["Model analysis"]
  node_checker["PySB model checker<br/>[pysb.py]"]
  node_pathfinding["Path finding<br/>[pathfinding.py]"]
end

subgraph group_support["Reference services"]
  node_pubmed["PubMed client<br/>[pubmed_client.py]"]
  node_cbio["cBioPortal client<br/>[cbio_client.py]"]
  node_context["Cell context<br/>[context_client.py]"]
  node_hgnc["HGNC mappings<br/>[hgnc_client.py]"]
end

node_researcher(("User"))
node_rest["REST API<br/>[api.py]"]

node_researcher -->|"submits requests"| node_rest
node_readers -->|"produce statements"| node_statements
node_structured -->|"produce statements"| node_statements
node_reach -->|"produces statements"| node_statements
node_dbrest -->|"decodes results"| node_statements
node_statements -->|"assembled by"| node_corpus
node_pipeline -->|"invokes corpus functions"| node_corpus
node_corpus -->|"applies grounding"| node_grounding
node_corpus -->|"preassembles statements"| node_preassembly
node_corpus -->|"links mechanisms"| node_mechlinker
node_corpus -->|"assesses reliability"| node_belief
node_corpus -->|"uses biological scope"| node_ontology
node_corpus -->|"assembles models"| node_assemblers
node_assemblers -->|"includes CX output"| node_cx
node_assemblers -->|"includes dynamical output"| node_pysb
node_assemblers -.->|"supports serialized statements"| node_statementio
node_pysb -->|"exports model"| node_pysbexport
node_pysb -->|"model checked by"| node_checker
node_statements -.->|"supports explanation"| node_pathfinding
node_context -->|"queries expression"| node_cbio
node_cbio -->|"maps gene identifiers"| node_hgnc
node_pubmed -.->|"supports literature workflows"| node_statements

click node_rest "https://github.com/gyorilab/indra/blob/master/rest_api/api.py"
click node_readers "https://github.com/gyorilab/indra/tree/master/indra/sources"
click node_reach "https://github.com/gyorilab/indra/blob/master/indra/sources/reach/processor.py"
click node_structured "https://github.com/gyorilab/indra/tree/master/indra/sources"
click node_dbrest "https://github.com/gyorilab/indra/blob/master/indra/sources/indra_db_rest/query.py"
click node_statements "https://github.com/gyorilab/indra/blob/master/indra/statements/statements.py"
click node_statementio "https://github.com/gyorilab/indra/blob/master/indra/statements/io.py"
click node_pipeline "https://github.com/gyorilab/indra/blob/master/indra/pipeline/pipeline.py"
click node_corpus "https://github.com/gyorilab/indra/blob/master/indra/tools/assemble_corpus.py"
click node_grounding "https://github.com/gyorilab/indra/tree/master/indra/preassembler/grounding_mapper"
click node_preassembly "https://github.com/gyorilab/indra/tree/master/indra/preassembler"
click node_mechlinker "https://github.com/gyorilab/indra/blob/master/indra/mechlinker/__init__.py"
click node_belief "https://github.com/gyorilab/indra/blob/master/indra/belief/__init__.py"
click node_ontology "https://github.com/gyorilab/indra/blob/master/indra/ontology/bio/ontology.py"
click node_assemblers "https://github.com/gyorilab/indra/tree/master/indra/assemblers"
click node_cx "https://github.com/gyorilab/indra/blob/master/indra/assemblers/cx/assembler.py"
click node_pysb "https://github.com/gyorilab/indra/blob/master/indra/assemblers/pysb/assembler.py"
click node_pysbexport "https://github.com/gyorilab/indra/blob/master/indra/assemblers/pysb/export.py"
click node_checker "https://github.com/gyorilab/indra/blob/master/indra/explanation/model_checker/pysb.py"
click node_pathfinding "https://github.com/gyorilab/indra/blob/master/indra/explanation/pathfinding/pathfinding.py"
click node_pubmed "https://github.com/gyorilab/indra/blob/master/indra/literature/pubmed_client.py"
click node_cbio "https://github.com/gyorilab/indra/blob/master/indra/databases/cbio_client.py"
click node_context "https://github.com/gyorilab/indra/blob/master/indra/databases/context_client.py"
click node_hgnc "https://github.com/gyorilab/indra/blob/master/indra/databases/hgnc_client.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_readers,node_reach,node_structured,node_dbrest,node_researcher toneBlue
class node_statements,node_statementio,node_pipeline,node_corpus,node_grounding,node_preassembly,node_mechlinker,node_belief,node_ontology toneAmber
class node_assemblers,node_cx,node_pysb,node_pysbexport,node_rest toneMint
class node_checker,node_pathfinding toneRose
class node_pubmed,node_cbio,node_context,node_hgnc toneIndigo
```

## Components

### Knowledge inputs

- [Text readers](https://github.com/gyorilab/indra/tree/master/indra/sources): `indra/sources`
- [REACH reader](https://github.com/gyorilab/indra/blob/master/indra/sources/reach/processor.py): `indra/sources/reach/processor.py`
- [Structured sources](https://github.com/gyorilab/indra/tree/master/indra/sources): `indra/sources`
- [INDRA DB queries](https://github.com/gyorilab/indra/blob/master/indra/sources/indra_db_rest/query.py): `indra/sources/indra_db_rest/query.py`

### Knowledge processing

- [INDRA Statements](https://github.com/gyorilab/indra/blob/master/indra/statements/statements.py): `indra/statements/statements.py`
- [Statement serialization](https://github.com/gyorilab/indra/blob/master/indra/statements/io.py): `indra/statements/io.py`
- [Assembly pipeline](https://github.com/gyorilab/indra/blob/master/indra/pipeline/pipeline.py): `indra/pipeline/pipeline.py`
- [Corpus assembly](https://github.com/gyorilab/indra/blob/master/indra/tools/assemble_corpus.py): `indra/tools/assemble_corpus.py`
- [Grounding mapper](https://github.com/gyorilab/indra/tree/master/indra/preassembler/grounding_mapper): `indra/preassembler/grounding_mapper`
- [Preassembly](https://github.com/gyorilab/indra/tree/master/indra/preassembler): `indra/preassembler`
- [Mechanism linking](https://github.com/gyorilab/indra/blob/master/indra/mechlinker/__init__.py): `indra/mechlinker/__init__.py`
- [Belief scoring](https://github.com/gyorilab/indra/blob/master/indra/belief/__init__.py): `indra/belief/__init__.py`
- [Biology ontology](https://github.com/gyorilab/indra/blob/master/indra/ontology/bio/ontology.py): `indra/ontology/bio/ontology.py`

### Model outputs

- [Graph and format assemblers](https://github.com/gyorilab/indra/tree/master/indra/assemblers): `indra/assemblers`
- [CX assembler](https://github.com/gyorilab/indra/blob/master/indra/assemblers/cx/assembler.py): `indra/assemblers/cx/assembler.py`
- [PySB assembler](https://github.com/gyorilab/indra/blob/master/indra/assemblers/pysb/assembler.py): `indra/assemblers/pysb/assembler.py`
- [PySB export](https://github.com/gyorilab/indra/blob/master/indra/assemblers/pysb/export.py): `indra/assemblers/pysb/export.py`

### Model analysis

- [PySB model checker](https://github.com/gyorilab/indra/blob/master/indra/explanation/model_checker/pysb.py): `indra/explanation/model_checker/pysb.py`
- [Path finding](https://github.com/gyorilab/indra/blob/master/indra/explanation/pathfinding/pathfinding.py): `indra/explanation/pathfinding/pathfinding.py`

### Reference services

- [PubMed client](https://github.com/gyorilab/indra/blob/master/indra/literature/pubmed_client.py): `indra/literature/pubmed_client.py`
- [cBioPortal client](https://github.com/gyorilab/indra/blob/master/indra/databases/cbio_client.py): `indra/databases/cbio_client.py`
- [Cell context](https://github.com/gyorilab/indra/blob/master/indra/databases/context_client.py): `indra/databases/context_client.py`
- [HGNC mappings](https://github.com/gyorilab/indra/blob/master/indra/databases/hgnc_client.py): `indra/databases/hgnc_client.py`

### Other components

- **User**
- [REST API](https://github.com/gyorilab/indra/blob/master/rest_api/api.py): `rest_api/api.py`

## Connections

- User → REST API: submits requests
- Text readers → INDRA Statements: produce statements
- Structured sources → INDRA Statements: produce statements
- REACH reader → INDRA Statements: produces statements
- INDRA DB queries → INDRA Statements: decodes results
- INDRA Statements → Corpus assembly: assembled by
- Assembly pipeline → Corpus assembly: invokes corpus functions (evidence: `indra/pipeline/pipeline.py`)
- Corpus assembly → Grounding mapper: applies grounding (evidence: `indra/tools/assemble_corpus.py`)
- Corpus assembly → Preassembly: preassembles statements (evidence: `indra/tools/assemble_corpus.py`)
- Corpus assembly → Mechanism linking: links mechanisms (evidence: `indra/tools/assemble_corpus.py`)
- Corpus assembly → Belief scoring: assesses reliability (evidence: `indra/tools/assemble_corpus.py`)
- Corpus assembly → Biology ontology: uses biological scope (evidence: `indra/tools/assemble_corpus.py`)
- Corpus assembly → Graph and format assemblers: assembles models
- Graph and format assemblers → CX assembler: includes CX output (evidence: `indra/assemblers/cx/__init__.py`)
- Graph and format assemblers → PySB assembler: includes dynamical output (evidence: `indra/assemblers/pysb/__init__.py`)
- Graph and format assemblers → Statement serialization: supports serialized statements
- PySB assembler → PySB export: exports model (evidence: `indra/assemblers/pysb/assembler.py`)
- PySB assembler → PySB model checker: model checked by (evidence: `indra/explanation/model_checker/pysb.py`)
- INDRA Statements → Path finding: supports explanation
- Cell context → cBioPortal client: queries expression (evidence: `indra/databases/context_client.py`)
- cBioPortal client → HGNC mappings: maps gene identifiers (evidence: `indra/databases/cbio_client.py`)
- PubMed client → INDRA Statements: supports literature workflows
