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 celladata.obsm["sctype_scores"]— raw scores for each cell type
Authors & Contributions
- Original ScType algorithm and R implementation: Aleksandr Ianevski and contributors
https://github.com/IanevskiAleksandr/sc-type
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bb4d565e8f263d701c73a6605335e54e0b0ce7a1179e22ffdbd2453fbadf3fcb
|
|
| MD5 |
0f21e5f4053750242e1710b0d193fd15
|
|
| BLAKE2b-256 |
db017cfa732418e741aeab1df4ddc858b48ce0aa669bb1be9d615411749e6851
|
Provenance
The following attestation bundles were made for sctypepy-0.1.0.tar.gz:
Publisher:
python-publish.yml on MatchaOnMuffins/sctypepy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sctypepy-0.1.0.tar.gz -
Subject digest:
bb4d565e8f263d701c73a6605335e54e0b0ce7a1179e22ffdbd2453fbadf3fcb - Sigstore transparency entry: 730361935
- Sigstore integration time:
-
Permalink:
MatchaOnMuffins/sctypepy@d64f07264f95e21a4305614d7d379075c920c5b9 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/MatchaOnMuffins
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@d64f07264f95e21a4305614d7d379075c920c5b9 -
Trigger Event:
release
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d75d4f656f0d4fb93550a5e5419f953b994f5b73d4360b347b715be56dd70783
|
|
| MD5 |
0695842fdd61172cb340e51ede0372ff
|
|
| BLAKE2b-256 |
381f138226bf2ac45eef63495a2f390ad26158041968e1a53a66938db3a29e46
|
Provenance
The following attestation bundles were made for sctypepy-0.1.0-py3-none-any.whl:
Publisher:
python-publish.yml on MatchaOnMuffins/sctypepy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sctypepy-0.1.0-py3-none-any.whl -
Subject digest:
d75d4f656f0d4fb93550a5e5419f953b994f5b73d4360b347b715be56dd70783 - Sigstore transparency entry: 730361937
- Sigstore integration time:
-
Permalink:
MatchaOnMuffins/sctypepy@d64f07264f95e21a4305614d7d379075c920c5b9 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/MatchaOnMuffins
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@d64f07264f95e21a4305614d7d379075c920c5b9 -
Trigger Event:
release
-
Statement type: