Skip to content

hackbio-ca/spatioscript-llm-spatial-biology

Panoramics Logo

SpatioScript: LLM-Powered Spatial Biology

Natural-language questions over spatial transcriptomics with integrated cell annotations & spatial graphs

Abstract » · Built With · Local App Installation · Graph Database Data Ingestion · Contact

Let's Get Started

We are excited to share that Panoramics-a-Vision proudly took part in the recent Toronto Bioinformatics Hackathon!
Panoramics is a pan-Canadian catalyst for spatial biology and single-cell innovation, bringing together science, technology, and visionary impact.

Our hackathon team combined diverse expertise and strong collaboration:

  • Shamini Ayyadhury – CEO of Panoramics and team leader, providing strategic vision and overall direction.
  • Suluxan Mohanraj – Software Developer and co-team leader, driving the core technical development.
  • Arzu Kirici – Computational Scientist, contributing analytical expertise and problem-solving for data workflows.
  • Alyona Ivanova – Scientist and Creative Content Lead, shaping communication and presentation materials.
  • Kasra Rahimian – Web Developer, ensuring seamless design and implementation of the project’s web interface.

Together, we worked across disciplines to transform ideas into solutions, demonstrating the collaborative spirit that defines Panoramics.


Abstract

Single-cell RNA sequencing (scRNA-seq) has enabled the measurement of expression levels of thousands of genes across millions of individual cells. While scRNA-seq provides deep transcriptional profiles, it obscures critical information about each cell’s physical location within the tissue microenvironment. Spatial transcriptomics overcomes this limitation by mapping gene expression back onto tissue sections, offering a powerful view of both the molecular identity of cells and their spatial organization. Together, these technologies allow researchers to study how cells are organized and how they interact within complex biological systems, such as tumours.

We present an interactive AI-powered application that enables natural language interrogation of spatial transcriptomics data, with a particular focus on the tumour microenvironment, where the physical arrangement of immune cells, stromal components, and malignant cells plays a critical role in disease progression and therapeutic response.

Users can upload or select pre-processed public datasets and ask questions such as:

  • “Are CD8+ T cells enriched in the tumour core?”
  • “Return the spatial proximity of CD8 cells next to blood vessels.”
  • “How correlated are my spatial domains with pathology annotations?”

The system integrates preprocessed public spatial datasets with cell type annotations and a spatial graph (i.e., connectivity map), performs neighbourhood and enrichment analyses, and generates concise, biologically contextualized summaries using a large language model (LLM).

With the ultimate goal of enhancing multi-disciplinary research, our tool:

  1. Lowers the barrier to exploring high-dimensional spatial datasets, and
  2. Facilitates the integration of image-based annotations with high-dimensional molecular discoveries, serving as a valuable toolkit for both biologists and clinicians.

This project demonstrates how natural language interfaces can make complex, high-dimensional omics data more accessible and actionable, augmenting biological insights and empowering the user’s scientific vision.

(back to top)


Built With

Python OpenAI FastAPI Docker Neo4j QuPath


Local App Installation

Please follow the instructions below to set up the SpatioScript application!

NOTE: You will require an OPENAI API Key and credits to run this app

# Clone this repo 
git clone https://github.com/hackbio-ca/spatioscript-llm-spatial-biology.git
cd spatioscript-llm-spatial-biology

# Copy `sample.env` to `.env`
cp sample.env .env
# Don't forget to assign your OpenAI API key to the OPENAI_API_KEY environment variable
OPENAI_API_KEY=your_openai_api_key_here
# Docker compose up (or use the handy Makefile commands) 
docker compose up 
# OR
make dev

# Recommended: serve with Python to avoid CORS issues
python3 -m http.server 8080
# then go to http://localhost:8080
# Or, simply open index.html in your browser.

Graph Database Data Ingestion

# Add your filtered AnnData csv file to /neo4j/import 
# Open localhost:7474 in your browser to view the Neo4J Graph Database Browser
# Now, run cypher_examples/query_full.cypher in your localhost:7474 browser
# You may increase the heapsize (docker-compose.yml) or the batch_size (cypher_examples/query_full.cypher) to speed up your ingestion!
// Confirming data is in there!
MATCH (n) RETURN n 
MATCH (n) RETURN count(n)

Your SpatioScript app is now ready to explore!

Application Interface
App interface

Neo4j Database View
Neo4j visualization

(back to top)

Contribute

Contributions are welcome! If you'd like to contribute, please open an issue or submit a pull request. See the contribution guidelines for more information.

Support

Contact

Panoramics Team - LinkedIn

For more information email us - [email protected]

(back to top)

License

This project is licensed under the MIT License.

About

SpatioScript: LLM-powered spatial biology query model

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 5