diff --git a/.github/workflows/black.yaml b/.github/workflows/black.yaml new file mode 100644 index 0000000..84b4d5d --- /dev/null +++ b/.github/workflows/black.yaml @@ -0,0 +1,14 @@ +name: Black lint + +on: [push, pull_request] + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: psf/black@stable + with: + options: "--diff --verbose --line-length 127" + src: "./scAR" + version: "22.3.0" diff --git a/README.md b/README.md index 0fc327e..77c2754 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,8 @@ # scAR -[![scAR](https://img.shields.io/badge/scAR-005AF0?style=for-the-badge&logo=dependabot&logoColor=white.svg)](https://github.com/Novartis/scAR) -![single-cell omics](https://img.shields.io/badge/single_cell_omics-005AF0?style=for-the-badge.svg) -![machine learning](https://img.shields.io/badge/machine_learning-005AF0?style=for-the-badge.svg) -![variational autoencoders](https://img.shields.io/badge/variational_autoencoders-005AF0?style=for-the-badge.svg) -![denoising](https://img.shields.io/badge/denoising-005AF0?style=for-the-badge.svg) +[![scAR](https://anaconda.org/bioconda/scar/badges/version.svg)](https://anaconda.org/bioconda/scar) +[![Stars](https://img.shields.io/github/stars/Novartis/scar?logo=GitHub&color=red)](https://github.com/Novartis/scAR) +[![Downloads](https://anaconda.org/bioconda/scar/badges/downloads.svg)](https://anaconda.org/bioconda/scar/files) **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: @@ -22,7 +20,25 @@ ## Installation -Clone this repository, +#### Conda +1, Install [conda](https://docs.conda.io/projects/conda/en/latest/user-guide/install/index.html) +2, Create conda environment +```sh +$ conda create -n scAR_env +``` + +3, Activate conda environment +```sh +$ conda activate scAR_env +``` + +4, Install scar +```sh +$ conda install -c bioconda scar +``` + +#### Git+pip +Alternatively, clone this repository, ```sh $ git clone https://github.com/Novartis/scAR.git @@ -61,7 +77,7 @@ There are two ways to run scAR. 1) Use scAR API if you are Python users ```sh ->>> from scAR import model +>>> from scar import model >>> scarObj = model(adata.X.to_df(), empty_profile) >>> scarObj.train() >>> scarObj.inference() diff --git a/scAR/main/__init__.py b/scAR/main/__init__.py index 1b8daf0..3e738b5 100644 --- a/scAR/main/__init__.py +++ b/scAR/main/__init__.py @@ -1,2 +1,3 @@ # -*- coding: utf-8 -*- -__version__ = '0.2.2' \ No newline at end of file + +__version__ = '0.2.3' \ No newline at end of file diff --git a/scAR/test/test_scar.py b/scAR/test/test_scar.py new file mode 100755 index 0000000..c37f05d --- /dev/null +++ b/scAR/test/test_scar.py @@ -0,0 +1,23 @@ +import pandas as pd +from scAR import model +import unittest + +class ScarIntegration(unittest.TestCase): + """ + Test activation_functions.py functions. + """ + + def test_scar(self): + raw_count = pd.read_pickle("scAR/test/raw_counts.pickle") + empty_profile=pd.read_pickle("scAR/test/ambient_profile.pickle") + expected_output=pd.read_pickle("scAR/test/output_assignment.pickle") + + scarObj = model( + raw_count=raw_count.values, empty_profile=empty_profile, scRNAseq_tech="CROPseq" + ) + + scarObj.train(epochs=40, batch_size=64) + + scarObj.inference() + + self.assertTrue(scarObj.feature_assignment.equals(expected_output))