Skip to main content

Cell annotation function

Project description

SCMAPpy

Python version of scmap as described from the original paper of Kilesev et al. (2017) It integrates with scanpy objects.

On top of the original algorithm, we implement a few additional functions.

Usage

The purpose of this package is to map the annotations of a reference single-cell dataset (reference) into a target dataset (target). The package is implemented to be used with AnnData objects and Scanpy environment.

We implement three functions to do this pipeline of annotation.

  • common_genes: Function to find the common genes between both datasets.
  • scmap_annotate: Function to anotate the target dataset that implements the original scmap function.
  • scmap_projection: Function to project the target dataset into a representation of the reference dataset.

Example

Consider a reference and a target datasets. The genes are annotated in .var["Gene_names"]. The annotations are in reference.obs["Annotation"]

The first step for the annotation is to find the common genes between both datasets.

reference,target = common_genes(reference,target,"Gene_names",remove_unmached=True)

Before proceeding to the mapping, we need to select that are going to be used for the mapping, as using the hole genome will have the curse of dimensionality. There are different flavors for selecting the genes that do not require this step, but the most typical is to use the highly varying genes. For that you have to first run the scanpy.pp.highly_varying_genes algorithm in the reference dataset.

scanpy.pp.highly_varying_genes(reference)

With the common genes detected and the genes on interest selected, we can proceed to map the data.

scmap_annotate(reference,target,"Gene_names","Annotation",algorithm_flavor="centroid",gene_selection_flavor="HVGs",similarity_threshold=.7, key_added="scmap_annotation")

That is it. By default there will be a new column added in target.obs with the annotations.

In the case that we would also to visualize where the annotated cells where projected in a representation of the data, we can use the projection function. Consider that we have a UMAP representation in reference.obsm["X_umap"]. We would do,

scmap_projection(reference,target,"Gene_names","X_umap",algorithm_flavor="centroid",gene_selection_flavor="HVGs",key_added="scmap_annotation")

and this will add a target.obsm["scmap_annotation"] with the projected cells.

Project details


Release history Release notifications | RSS feed

This version

0.2

Download files

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

Source Distribution

scmappy-0.2.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

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

scmappy-0.2-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file scmappy-0.2.tar.gz.

File metadata

  • Download URL: scmappy-0.2.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.5

File hashes

Hashes for scmappy-0.2.tar.gz
Algorithm Hash digest
SHA256 76ac1580a24a09a8a9a7f7ea9bc81e42be6ad386719ceb234db9baf20d54ae70
MD5 97f5596c7b140668d2fc669438112d14
BLAKE2b-256 6a96a845312d6e34e8feb96a1b292cf9bdfd1de2b3f962dc77c2649ae5e58574

See more details on using hashes here.

File details

Details for the file scmappy-0.2-py3-none-any.whl.

File metadata

  • Download URL: scmappy-0.2-py3-none-any.whl
  • Upload date:
  • Size: 6.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.5

File hashes

Hashes for scmappy-0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a9757f991242affd3dfa38de330d4672aae4ec74c4f2c6d021c97ea81de4c6ce
MD5 6032892102d9b23c8b1de031fd2df626
BLAKE2b-256 b7b9897dd0de6eab899e37dc85cd02bd90f377cd0b54160141e537dcc1266a53

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