Skip to main content

Probabilistic cell typing for spatial transcriptomics

Project description

pciSeq: Probabilistic Cell typing by In situ Sequencing

A Python package that implements the cell calling algorithm as described in Qian, X., et al. Nature Methods (2020)

screenshot

Installation

python -m pip install pciSeq

Requirement: Python >= 3.8

If you want to work with the source code you can download the repo and then replicate the python environment by

conda env create -n pciSeq -f /path/to/environment.yml

That will create a conda environment with the name pciSeq containing all the necessary packages to run the algorithm. To activate it run

conda activate pciSeq

or, if you open the project in your IDE, then in your project settings, switch your interpreter to the interpreter of the pciSeq env.

Usage

You need to create two pandas dataframes for the spots and the single cell data and a coo_matrix for the label image (which in most cases will be the output of some image segmentation application). Then you pass them into the pciSeq.fit() method as follows:

import pciSeq

res = pciSeq.fit(spots=spots_df, coo=label_image, scRNAseq=scRNA_df)

See the demo below for a more detailed explanation about the arguments of pciSeq.fit() and its return values.

There is also a fourth argument (optional) to override the default hyperparameter values which are initialised by the config.py module. To pass user-defined hyperparameter values, create a dictionary with keys the hyperparameter names and values their new values. For example, to exclude all Npy and Vip spots you can do:

import pciSeq

opts = { 'exclude_genes': ['Npy', 'Vip'] }
res = pciSeq.fit(spots=spots_df, coo=label_image, scRNAseq=scRNA_df, opts=opts)

Demo

You can run a pciSeq demo in google colab: Open In Colab

Viewer

An interactive viewer to explore the data runs on this url. Instructions about building this viewer with your own data are here.
If you have v 0.0.49 or greater you can also launch the viewer automatically by setting opts = {'launch_viewer': True} and passing it to pciSeq.fit(), see Open In Colab

Change Log

[0.0.50] - 2023-05-27

  • Single cell data are optional, more info can be found here Open In Colab

  • pciSeq.fit() takes keyword arguments

References

Qian, X., et al. (2020). Probabilistic cell typing enables fine mapping of closely related cell types in situ. Nat Methods 17, 101 - 106.

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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

pciSeq-0.0.51.dev0-py3-none-any.whl (355.1 kB view details)

Uploaded Python 3

File details

Details for the file pciSeq-0.0.51.dev0-py3-none-any.whl.

File metadata

  • Download URL: pciSeq-0.0.51.dev0-py3-none-any.whl
  • Upload date:
  • Size: 355.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.13

File hashes

Hashes for pciSeq-0.0.51.dev0-py3-none-any.whl
Algorithm Hash digest
SHA256 a58fd6e242c9399b347cbd3b6a2779a727a259537e1ded06f4e646c0fea75e90
MD5 aecb6acf998cfa59ea93d81176edbb7d
BLAKE2b-256 e8cc520cd772ae4eaab062e8815c2d0bbe0625eb4459396facd72f427acff038

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page