Package: scdrs
scDRS (single-cell disease-relevance score) is a method for associating individual cells in single-cell RNA-seq data with disease GWASs, built on top ofAnnDataandScanpy.Read thedocumentation:installation,usage,command-line interface (CLI),file formats, etc.Check outinstructionsfor making customized gene sets using MAGMA.ReferenceZhang*, Hou*, et al. "Polygenic enrichment distinguishes disease associations of individual cells in single-cell RNA-seq data", Nature Genetics, 2022.Versionsv1.0.2: bug fixes onscdrs.util.plot_group_stats; input checks inscdrs munge-gsandscdrs.util.load_h5ad.v1.0.1: stable version used in publication. Identical tov1.0.0except documentation.v1.0.0: stable version used in revision 1. Results are identical tov0.1for binary gene sets. Changes with respect tov0.1:scDRS command-line interface (CLI) instead of.pyscripts for calling scDRS in bash, includingscdrs munge-gs,scdrs compute-score, andscdrs perform-downstream.More efficient in memory use due to the use of sparse matrix throughout the computation.Allow the use of quantitative weights.New feature--adj-propfor adjusting for cell type-proportions.v0.1: stable version used in the initial submission.Code and data to reproduce results of the paperSeescDRS_paperfor more details (experimentsfolder is deprecated). Data are atfigshare.DownloadGWAS gene sets(.gsfiles) for 74 diseases and complex traits.DownloadscDRS results(.score.gzand.full_score.gzfiles) for TMS FACS + 74 diseases/trait.Older versionsInitial submission:GWAS gene setsandscDRS results.Explore scDRS results viacellxgeneDemo for3 TMS FACS cell types and 3 diseases/traits.Results for110,096 TMS FACS cells and 74 diseases/traits.Downloadh5ad filesfor cellxgene.110,096 cells from 120 cell types in TMS FACSIBD-associated cellsscDRS scripts (deprecated)NOTE:scDRS scripts are still maintained but deprecated. Consider usingscDRS command-line interfaceinstead.scDRS script for score calculationInput: scRNA-seq data (.h5adfile) and gene set file (.gsfile)Output: scDRS score file ({trait}.score.gzfile) and full score file ({trait}.full_score.gzfile) for each trait in the.gsfileh5ad_file=your_scrnaseq_datacov_file=your_covariate_filegs_file=your_gene_set_fileout_dir=your_output_folder

pythoncompute_score.py\--h5ad_file${h5ad_file}.h5ad\--h5ad_speciesmouse\--cov_file${cov_file}.cov\--gs_file${gs_file}.gs\--gs_specieshuman\--flag_filterTrue\--flag_raw_countTrue\--n_ctrl1000\--flag_return_ctrl_raw_scoreFalse\--flag_return_ctrl_norm_scoreTrue\--out_folder${out_dir}--h5ad_file(.h5adfile) : scRNA-seq data--h5ad_species("hsapiens"/"human"/"mmusculus"/"mouse") : species of the scRNA-seq data samples--cov_file(.covfile) : covariate file (optional, .tsv file, seefile format)--gs_file(.gsfile) : gene set file (seefile format)--gs_species("hsapiens"/"human"/"mmusculus"/"mouse") : species for genes in the gene set file--flag_filter("True"/"False") : if to perform minimum filtering of cells and genes--flag_raw_count("True"/"False") : if to perform normalization (size-factor + log1p)--n_ctrl(int) : number of control gene sets (default 1,000)--flag_return_ctrl_raw_score("True"/"False") : if to return raw control scores--flag_return_ctrl_norm_score("True"/"False") : if to return normalized control scores--out_folder: output folder. Score files will be saved as{out_folder}/{trait}.score.gz(seefile format)scDRS script for downsteam applicationsInput: scRNA-seq data (.h5adfile), gene set file (.gsfile), and scDRS full score files (.full_score.gzfiles)Output:{trait}.scdrs_ct.{cell_type}file (same as the new{trait}.scdrs_group.{cell_type}file) for cell type-level analyses (association and heterogeneity);{trait}.scdrs_varfile (same as the new{trait}.scdrs_cell_corrfile) for cell variable-disease association;{trait}.scdrs_genefile for disease gene prioritization.h5ad_file=your_scrnaseq_dataout_dir=your_output_folder
pythoncompute_downstream.py\--h5ad_file${h5ad_file}.h5ad\--score_file@.full_score.gz\--cell_typecell_type\--cell_variablecausal_variable,non_causal_variable,covariate\--flag_geneTrue\--flag_filterFalse\--flag_raw_countFalse\# flag_raw_count is set to `False` because the toy data is already log-normalized, set to `True` if your data is not log-normalized--out_folder${out_dir}--h5ad_file(.h5adfile) : scRNA-seq data--score_file(.full_score.gzfiles) : scDRS full score files; supporting use of "@" to match strings--cell_type(str) : cell type column (supporting multiple columns separated by comma); must be present inadata.obs.columns; used for cell type-disease association analyses (5% quantile as test statistic) and detecting association heterogeneity within cell type (Geary's C as test statistic)--cell_variable(str) : cell-level variable columns (supporting multiple columns separated by comma); must be present inadata.obs.columns; used for cell variable-disease association analyses (Pearson's correlation as test statistic)--flag_gene("True"/"False") : if to correlate scDRS disease scores with gene expression--flag_filter("True"/"False") : if to perform minimum filtering of cells and genes--flag_raw_count("True"/"False") : if to perform normalization (size-factor + log1p)--out_folder: output folder. Score files will be saved as{out_folder}/{trait}.scdrs_ct.{cell_type}for cell type-level analyses (association and heterogeneity);{out_folder}/{trait}.scdrs_varfile for cell variable-disease association;{out_folder}/{trait}.scdrs_var.{trait}.scdrs_genefile for disease gene prioritization. (seefile format)