How tumo505/grail-heart works
GRAIL-Heart is a cardiac spatial-transcriptomics analysis framework. Its main workflow takes expression and spatial data, constructs a cell graph, predicts ligand–receptor activity, and supports inverse analysis to rank signals associated with cell fates. The README also documents model training, curated interaction resources, pathway analysis, and an interactive app. The sampled excerpts do not expose all package wiring, so uncertain implementation links are omitted.
Main entry points: grail_heart.py GRAIL-Heart model · inference.py Inference API · app.py Interactive web app · cellchat_database.py L–R resources
Components 19
Data and interactions
- Dataset loading
src/grail_heart/data/datasets.py - Spatial graph
src/grail_heart/data/graph_builder.py - L–R resources
src/grail_heart/data/cellchat_database.py - Expanded L–R pairs
src/grail_heart/data/expanded_lr_database.py
GNN and inference
- Training
src/grail_heart/training/trainer.py - Feature encoders
src/grail_heart/models/encoders.py - Graph attention
src/grail_heart/models/gat_layers.py - GRAIL-Heart model
src/grail_heart/models/grail_heart.py - Prediction heads
src/grail_heart/models/predictors.py - Inverse modeling
src/grail_heart/models/inverse_modelling.py - Inference API
src/grail_heart/inference.py
Analysis and visualization
- Pathway resources
src/grail_heart/data/cellchat_database.py - Spatial visualization
src/grail_heart/visualization/spatial_viz.py
User interfaces
- Interactive web app
app/app.py - Command-line entry
src/grail_heart/cli.py
Other components
- Researcher
- Spatial data
- Analysis results
- OmniPath
Connections 20
- Researcher → Interactive web app: uploads data
- Researcher → Command-line entry: runs analysis
- Spatial data → Dataset loading: loads
- Dataset loading → Spatial graph: constructs graph
- OmniPath → L–R resources: provides interactions
- Expanded L–R pairs → L–R resources: supplements pairs
- Training → GRAIL-Heart model: trains
- Feature encoders → GRAIL-Heart model: encodes features
- Graph attention → GRAIL-Heart model: performs message passing
- GRAIL-Heart model → Prediction heads: produces predictions
- GRAIL-Heart model → Inverse modeling: supports fate analysis
- Inference API → GRAIL-Heart model: runs model
- Inference API → L–R resources: scores interactions
- Inference API → Analysis results: returns predictions
- Inverse modeling → Analysis results: ranks causal signals
- Pathway resources → Analysis results: supports enrichment
- Spatial visualization → Analysis results: renders networks
- Interactive web app → Inference API: runs inference
- Interactive web app → Analysis results: presents analysis
- Command-line entry → Inference API: invokes predictions