Skip to main content

Sc-Type, but in Python

Project description

sctypepy

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

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

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.1.tar.gz (22.0 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.1-py3-none-any.whl (23.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sctypepy-0.0.1.tar.gz
  • Upload date:
  • Size: 22.0 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.1.tar.gz
Algorithm Hash digest
SHA256 304ff508118f2d3b54672813dd2d2fe3b118e386653ed92ed80990c327ac627d
MD5 5d7d428d3f9412da2615ad093abea8db
BLAKE2b-256 0d5589bef6b7f62f1318adbeb6c1fbb4a0c896a118c865e70fb79e3b388fc9f5

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: sctypepy-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 23.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.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 edbc169b4a9a7ffe409ff776d7573177314c69658b2690f112045c7ac52f89d1
MD5 e89daa9ab3fb947325fa248436594d7a
BLAKE2b-256 a7b5f977873913009a51642c308d028e066fbc2d8e29a39bfc32c9875fa93b89

See more details on using hashes here.

Provenance

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