Skip to main content

Generate sceodesic embeddings from an input scRNA-seq dataset.

Project description

Sceodesic

Sceodesic is a Python package that implements the gene program discovery algorithm described by Sinan Ozbay, Aditya Parekh, and Rohit Singh in “Navigating the manifold of single-cell gene coexpression to discover interpretable gene programs.” Given a single-cell gene expression dataset, Seodesic allows the user to:

  1. Discover meaningful gene programs from any single-cell gene expression data.
  2. Re-interpet gene expression data as levels of expression of the aforementioned gene programs.

This repository contains an implementation of the algorithm. Some examples of use can be found below in "Example Usage".

Installation

You can install Sceodesic by running the following in your command line:

git clone https://github.com/rohitsinghlab/sceodesic.git
cd ./sceodesic  # to directory containing pyproject.toml file 
pip install .

API Example Usage

Below is example usage of sceodesic in Python. First, make sure your single-cell gene expression data is in an anndata object, as below.

import anndata

adata = [single cell gene expression anndata object]

Now, you are ready to discover some programs! Note that you should ensure the gene expression data is log-normalized counts:

# if adata is raw counts:
import scanpy as sc

# normalize to log-cp10k counts
sc.pp.normalize_total(adata, 1e4)
sc.pp.log1p(adata)
from sceodesic import run_sceo

run_sceo(adata, num_hvg=300)

embeddings = adata.obsm['sceo_embeddings']

# programs (loadings) stored in .varm, as a numpy array
programs = adata.varm['sceo_programs']

embeddings is a 2D numpy array where rows represent cells and columsn represent levels of gene program expression. programs is a 2D numpy array where columns represent individual gene programs, with each entry of that column giving the weight of each individual gene\ in that program. After you have generated programs and the embeddings, it becomes possible to do a wide variety of downstream single cell analysis using these embeddings. For example, if our data is labelled by cell type with an obs column called "cell_type" , we can compute differential gene program expression across cell types as follows:

# Create new anndata object with embeddings
adata_sceo = anndata.AnnData(embeddings, obs=adata.obs)

sc.get.rank_genes_groups_df(adata = adata_sceo, group = cell_type)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sceodesic-0.0.4.tar.gz (18.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sceodesic-0.0.4-py3-none-any.whl (24.5 kB view details)

Uploaded Python 3

File details

Details for the file sceodesic-0.0.4.tar.gz.

File metadata

  • Download URL: sceodesic-0.0.4.tar.gz
  • Upload date:
  • Size: 18.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.0

File hashes

Hashes for sceodesic-0.0.4.tar.gz
Algorithm Hash digest
SHA256 cc40a80df9a6120adab921701448da535ab4fc8aff0671187d1c1e1059074005
MD5 e46bd42f835b3d6b3f1900e52d56732d
BLAKE2b-256 24f2fa4e46fbd5e6e9f64a44f8039f70e77e5f51776bc433baf53a10ddd08d3b

See more details on using hashes here.

File details

Details for the file sceodesic-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: sceodesic-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 24.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.0

File hashes

Hashes for sceodesic-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 edb16f7599bcd72578f0aa130b95a64bcbe73f9526a48018f802579c78f352aa
MD5 44c47a5bccdb842f6758c3a8a02dc447
BLAKE2b-256 c54b055b45f685961950b02c6022e7830fbca2c1fb8ca1e3d8ade3cd6f0462b8

See more details on using hashes here.

Supported by

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