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.1.0.tar.gz (47.2 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.1.0-py3-none-any.whl (36.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for sctypepy-0.1.0.tar.gz
Algorithm Hash digest
SHA256 bb4d565e8f263d701c73a6605335e54e0b0ce7a1179e22ffdbd2453fbadf3fcb
MD5 0f21e5f4053750242e1710b0d193fd15
BLAKE2b-256 db017cfa732418e741aeab1df4ddc858b48ce0aa669bb1be9d615411749e6851

See more details on using hashes here.

Provenance

The following attestation bundles were made for sctypepy-0.1.0.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.1.0-py3-none-any.whl.

File metadata

  • Download URL: sctypepy-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 36.3 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d75d4f656f0d4fb93550a5e5419f953b994f5b73d4360b347b715be56dd70783
MD5 0695842fdd61172cb340e51ede0372ff
BLAKE2b-256 381f138226bf2ac45eef63495a2f390ad26158041968e1a53a66938db3a29e46

See more details on using hashes here.

Provenance

The following attestation bundles were made for sctypepy-0.1.0-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