Code Monkey home page Code Monkey logo

pciseq's Introduction

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_df, label_image, 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_df, label_image, scRNA_df, 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

References

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

pciseq's People

Contributors

acycliq avatar mathieubo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.