Skip to main content

Sc-Type, but in Python

Project description

ScTypePy: Python implementation of ScType

A Python implementation of ScType for automatic cell type annotation of single-cell RNA-seq data.

ScType is described in the following publication:
Nature Communications (2022): https://doi.org/10.1038/s41467-022-28803-w

Installation

pip install sctypepy

Quickstart

import scanpy as sc
from sctypepy import run_sctype

# Load and preprocess your data
adata = sc.datasets.pbmc3k()
sc.pp.neighbors(adata)
sc.tl.leiden(adata)

adata = run_sctype(adata, tissue_type="Immune system", groupby="leiden")

print(adata.obs["sctype_classification"].value_counts())

Example

Example usages can be found in the example directory.

Usage

Auto-detect tissue type

If you're unsure which tissue type to use:

from sctypepy import auto_detect_tissue_type

tissue_df = auto_detect_tissue_type(adata, groupby="leiden")
print(tissue_df.head())

Available tissue types

from sctypepy import get_available_tissues

print(get_available_tissues())

Custom marker database

Provide your own markers as a DataFrame with columns: tissueType, cellName, geneSymbolmore1, geneSymbolmore2.

import pandas as pd

custom_db = pd.DataFrame({
    "tissueType": ["Brain", "Brain"],
    "cellName": ["Neuron", "Astrocyte"],
    "geneSymbolmore1": ["SNAP25,SYT1,RBFOX3", "GFAP,AQP4,S100B"],
    "geneSymbolmore2": ["", ""],
})

adata = run_sctype(adata, tissue_type="Brain", db=custom_db)

Output

After running run_sctype():

  • adata.obs["sctype_classification"] — predicted cell type per cell
  • adata.obsm["sctype_scores"] — raw scores for each cell type

Authors & Contributions

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

sctypepy-0.0.2.tar.gz (47.1 kB view details)

Uploaded Source

Built Distribution

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

sctypepy-0.0.2-py3-none-any.whl (36.2 kB view details)

Uploaded Python 3

File details

Details for the file sctypepy-0.0.2.tar.gz.

File metadata

  • Download URL: sctypepy-0.0.2.tar.gz
  • Upload date:
  • Size: 47.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for sctypepy-0.0.2.tar.gz
Algorithm Hash digest
SHA256 7264f6a042f2620a1d074a06a65cdbb7b0ccf58430847093eafb7d70ac6ee758
MD5 27f7439bc27b6c3c3132ee16e6af1950
BLAKE2b-256 a6d47c50f5991410f2f3ee2d23a4a087fff965f166ece6f30af9256113ee010f

See more details on using hashes here.

Provenance

The following attestation bundles were made for sctypepy-0.0.2.tar.gz:

Publisher: python-publish.yml on MatchaOnMuffins/sctypepy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sctypepy-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: sctypepy-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 36.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for sctypepy-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e30f09bebed42b7036743d099d421cb855bd5f9e8abf241b45abd5562038a852
MD5 1e48d67ef888d096326a1af6769db501
BLAKE2b-256 c60624fdae8eecc81656ffbf01c754a4d404c2eb19c92a0b6516e83f97492b55

See more details on using hashes here.

Provenance

The following attestation bundles were made for sctypepy-0.0.2-py3-none-any.whl:

Publisher: python-publish.yml on MatchaOnMuffins/sctypepy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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