ANS: Adjusted Neighborhood Scoring to improve gene signature-based cell annotation in single-cell RNA-seq data
A gene expression signature scoring Python package.
This repository accompanies the work: Laure Ciernik*, Agnieszka Kraft*, Joséphine Yates, Florian Barkmann, and Valentina Boeva, “ANS: Adjusted Neighborhood Scoring to improve gene signature-based cell annotation in single-cell RNA-seq data”. doi: https://doi.org/10.1101/2023.09.20.558114
Note: This repository is in the experimental stage. Changes to the API may appear.
For tutorials and API description, see our documentation.
We aim for Python versions 3.8+. Run:
pip install git+https://github.com/lciernik/ANS_signature_scoring.git
Disclaimer: The implementations of all Tirosh et al. 2016 based scoring methods are largely based on the implementation of the score_genes
method in Scanpy.
The repository contains an R implementation of the novel scoring method in the folder
src_R/adjusted_neighborhood_scoring.R
. The file can be downloaded, and the methods can be loaded for use.
Disclaimer: The code is largely based on the implementation of the AddModuleScore
method of the Seurat package.
Note: ANS for R should be used on Seurat objects. Source the file in your script and use it identically to AddModuleScore
.
The package allows full compatibility with the Python scRNA-seq analysis toolbox Scanpy. The scoring methods are applied to preprocessed (log-normalized) scRNA-seq.
import signaturescoring as ssc
ssc.score_signature(
adata=adata, # preprocessed (log-normalized) gene expression data in an AnnData object
gene_list=gene_signature, # gene expression signature, type list
method='adjusted_neighborhood_scoring',
ctrl_size=100,
score_name='scores', # scores stored in adata.obs column defined by score_name
)
print(adata.obs['scores'].describe())
Other method
values:
seurat_scoring
,seurat_ag_scoring
, andseurat_lvg_scoring
: Python implementation of the scoring methodAddModuleScore
of the packageSeurat
first proposed by Tirosh et al. 2016 and two alternatives (this paper).jasmine_scoring
: Python implementation of JASMINE by Noureen et al. 2022. Requires an additional argumentscore_method
with the valueslikelihood
oroddsratio
.ucell_scoring
: Python implementation of UCell by Andreatta et Carmona 2021.
See tutorials on basic scoring examples, GMM postprocessing, and hard labeling in the tutorials
folder.
First: Laure Ciernik Second: Prof. Valentina Boeva