Package introducing the InSituPy framework to analyze single-cell spatial transcriptomics data.
Project description
InSituPy: A framework for histology-guided, multi-sample analysis of single-cell spatial transcriptomics data
InSituPy is a Python package designed to facilitate the analysis of single-cell spatial transcriptomics data. With InSituPy, you can easily load, visualize, and analyze the data, enabling and simplifying the comprehensive exploration of spatial gene expression patterns within tissue sections and across multiple samples. Currently the analysis is focused on data from the Xenium In Situ methodology but a broader range of reading functions will be implemented in the future.
Latest changes
Update to >=0.6.0
- Changed reading logic of
cell_namesinBoundariesData: this might lead to issues with backward compatibility but generalizes the reading of boundaries data opening it for other technologies. - Adapt viewer for smaller screens
- Revised automated registration pipeline:
- Fixed issue with large multiplexed IF images.
- Area dependent number of minimum matches to make registration pipeline also work on small images.
- add registration demo notebook for pancreas data
- by default remove history of variable data when calling
.save()
Update to 0.5.0
Major changes in reading/loading logic!
This might conflict with the backwards compatibility of this version! If there are issues with loading reading InSituPy projects saved with older version, please let me know to find workarounds!
- Reduced focus on Xenium method in data structure
InSituData.read()substitutesread_xeniumfor reading ofInSituPyprojects.read_xeniumused now to read data from Xenium data folders
Installation
Prerequisites
-
Create and activate a conda environment:
conda create --name insitupy python=3.9 conda activate insitupy
Method 1: Installation from Cloned Repository
-
Clone the repository to your local machine:
git clone https://github.com/jwrth/InSituPy.git
-
Navigate to the cloned repository and select the right branch:
cd InSituPy # Optionally: switch to dev branch git checkout dev
-
Install the required packages using
pipwithin the conda environment:# basic installation pip install . # for developmental purposes add the -e flag pip install -e .
Method 2: Direct Installation from GitHub
-
Install directly from GitHub:
# for installation without napari use pip install git+https://github.com/jwrth/InSituPy.git
Make sure you have Conda installed on your system before proceeding with these steps. If not, you can install Miniconda or Anaconda from https://docs.conda.io/en/latest/miniconda.html.
To ensure that the InSituPy package is available as a kernel in Jupyter notebooks within your conda environment, you can follow the instructions here.
Getting started
Documentation
For detailed instructions on using InSituPy, refer to the official documentation, which will be made public after publication. The documentation will provide comprehensive guides on installation, usage, and advanced features.
Tutorials
Explore the tutorials in ./notebooks/ to learn how to use InSituPy:
Sample level analysis
These tutorials focus on the preprocessing, analysis and handling of individual samples.
- Registration of additional images - Learn how to register additional images to the spatial transcriptomics data.
- Alternatively this is also implemented for an example dataset from pancreatic cancer
- Basic analysis functionalities - Learn about the basic functionalities, such as loading of data, basic preprocessing and interactive visualization with napari.
- Add annotations - Learn how to add annotations from external software such as QuPath and do annotations in the napari viewer.
- Crop data - Learn how to crop your data to focus your analysis on specific areas in the tissue.
- Cell type annotation - Shows an example workflow to annotate the cell types.
- Explore gene expression along axis - Example cases showing how to correlate gene expression with e.g. the distance to histological annotations.
- Build an
InSituDataobject from scratch - General introduction on how to build anInSituDataobject from scratch.
Experiment-level analysis
This set of tutorials focuses on
- Analyze multiple samples at once with InSituPy - Introduces the main concepts behind the
InSituExperimentclass and how to work with multiple samples at once. - Differential gene expression analysis - Perform differential gene expression analysis within one sample and across multiple samples.
Example data
If you want to test the pipeline on different example datasets, this notebook provides an overview of functions to download Xenium In Situ data from official sources.
Features
- Data Preprocessing: InSituPy provides functions for normalizing, filtering, and transforming raw in situ transcriptomics data.
- Interactive Visualization: Create interactive plots using napari to easily explore spatial gene expression patterns.
- Annotation: Annotate Xenium In Situ data in the napari viewer or import annotations from external tools like QuPath.
- Multi-sample analysis: Perform analysis on an experiment-level, i.e. with multiple samples at once.
Contributing
Contributions are welcome! If you find any issues or have suggestions for new features, please open an issue or submit a pull request.
License
InSituPy is licensed under the BSD-3-Clause.
InSituPy is developed and maintained by Johannes Wirth and Anna Chernysheva. Feedback is highly appreciated and hopefully InSituPy helps you with your analysis of spatial transcriptomics data. The package is thought to be a starting point to simplify the analysis of in situ sequencing data in Python and it would be exciting to integrate functionalities for larger and more comprehensive data structures. Currently, the framework focuses on the analysis of Xenium In Situ data but it is planned to integrate more methodologies and any support on this is highly welcomed.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file insitupy_spatial-0.6.1.tar.gz.
File metadata
- Download URL: insitupy_spatial-0.6.1.tar.gz
- Upload date:
- Size: 126.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.0.1 CPython/3.10.12 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eb9219899d5f544d4f9a7a2bb2dcf28a442d9a0ff0a2ff8a6851c8d9403789a5
|
|
| MD5 |
3ada66ff6ea530ab5dcbfc140bb3a919
|
|
| BLAKE2b-256 |
96c7b6a060af87ed9b9f6a63330550fc3cf4d83e612fb40db0bbaf2264b0995c
|
File details
Details for the file insitupy_spatial-0.6.1-py3-none-any.whl.
File metadata
- Download URL: insitupy_spatial-0.6.1-py3-none-any.whl
- Upload date:
- Size: 150.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.0.1 CPython/3.10.12 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
09d2dc4c652bd572fb81eaba6ed08035f9754bf1fec348c9b2161e4193918191
|
|
| MD5 |
612ff8ccb3c115fb847bd967495cab78
|
|
| BLAKE2b-256 |
e4313aff736f222f16586da540ec46f7ef28f3bfa141d7af608cb5c3903aca39
|