scAR
scAR (single cell Ambient Remover) is a package for denoising multiple single cell omics data. It can be used for multiple tasks, such as, sgRNA assignment for scCRISPRseq, identity barcode assignment for cell indexing, protein denoising for CITE-seq, mRNA denoising for scRNAseq, and etc... It is built using probabilistic deep learning, illustrated as follows:
Table of Contents
Installation
Clone this repository,
$ git clone https://github.com/Novartis/scAR.git
Enter the cloned directory:
$ cd scAR
To install the dependencies, create a conda environment:
Please use
scAR-gpu
if you have an nvidia graphis card and the corresponging driver installed.
$ conda env create -f scAR-gpu.yml
or
Please use
scAR-cpu
if you don't have a graphis card availalble.
$ conda env create -f scAR-cpu.yml
To activate the scAR conda environment run:
$ conda activate scAR
Usage
There are two ways to run scAR.
- Use scAR API if you are Python users
>>> from scAR import model
>>> scarObj = model(adata.X.to_df(), empty_profile)
>>> scarObj.train()
>>> scarObj.inference()
>>> adata.layers["X_scAR_denoised"] = scarObj.native_counts
>>> adata.obsm["X_scAR_assignment"] = scarObj.feature_assignment # feature assignment, e.g., sgRNAs, tags, and etc.. Only available in 'cropseq' mode
See the tutorials
- Run scAR from the command line
$ scar raw_count_matrix.pickle -t technology -e empty_profile.pickle -o output
raw_count_matrix.pickle
, a pickle-formatted raw count matrix (MxN) with cells in rows and features in columns
empty_profile.pickle
, a pickle-formatted feature frequencies (Nx1) in empty droplets
technology
, a string, either 'scRNAseq' or 'CROPseq' or 'CITEseq'
Use scar --help
command to see other optional arguments and parameters.
The output folder contains four (or five) files:
output
├── denoised_counts.pickle # denoised count matrix
├── expected_noise_ratio.pickle # estimated noise ratio
├── BayesFactor.pickle # bayesian factor of ambient contamination
├── expected_native_freq.pickle # estimated native frequencies
└── assignment.pickle # feature assignment, e.g., sgRNAs, tags, and etc.. Gernerated under 'cropseq' mode
Dependencies
Resources
- Tutorials:
- If you'd like to contribute, please contact Caibin ([email protected]).
- Please use the issues to submit bug reports.
License
This project is licensed under the terms of License.
Copyright 2022 Novartis International AG.
Reference
If you use scAR in your research, please consider citing our manuscript,
@article {Sheng2022.01.14.476312,
author = {Sheng, Caibin and Lopes, Rui and Li, Gang and Schuierer, Sven and Waldt, Annick and Cuttat, Rachel and Dimitrieva, Slavica and Kauffmann, Audrey and Durand, Eric and Galli, Giorgio G and Roma, Guglielmo and de Weck, Antoine},
title = {Probabilistic modeling of ambient noise in single-cell omics data},
elocation-id = {2022.01.14.476312},
year = {2022},
doi = {10.1101/2022.01.14.476312},
publisher = {Cold Spring Harbor Laboratory},
URL = {https://www.biorxiv.org/content/early/2022/01/14/2022.01.14.476312},
eprint = {https://www.biorxiv.org/content/early/2022/01/14/2022.01.14.476312.full.pdf},
journal = {bioRxiv}
}