Skip to main content

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

Metadata

Release files for sctypepy 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sctypepy 0.1.0
File Size Uploaded Provenance
sctypepy-0.1.0.tar.gz 47.2 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for sctypepy 0.1.0
File Interpreter ABI Platform
sctypepy-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 83.4 kB

Release files / sctypepy-0.1.0.tar.gz

Download URL sctypepy-0.1.0.tar.gz
Size 47.2 kB
Tags Source
SHA-256 checksum
How to use checksums
bb4d565e8f263d701c73a6605335e54e0b0ce7a1179e22ffdbd2453fbadf3fcb
BLAKE2b-256 checksum
How to use checksums
db017cfa732418e741aeab1df4ddc858b48ce0aa669bb1be9d615411749e6851
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 28, 2025.

Transparency log

Release files / sctypepy-0.1.0-py3-none-any.whl

Download URL sctypepy-0.1.0-py3-none-any.whl
Size 36.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d75d4f656f0d4fb93550a5e5419f953b994f5b73d4360b347b715be56dd70783
BLAKE2b-256 checksum
How to use checksums
381f138226bf2ac45eef63495a2f390ad26158041968e1a53a66938db3a29e46
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 28, 2025.

Transparency log

Security for sctypepy 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for sctypepy-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 28, 2025.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page