Skip to main content

Method to detect and enable removal of doublets from single-cell RNA-sequencing.

Project description

DoubletDetection

DOI Documentation Status Code style: black Build Status

DoubletDetection is a Python3 package to detect doublets (technical errors) in single-cell RNA-seq count matrices.

Installing DoubletDetection

Install from PyPI

pip install doubletdetection

Install from source

git clone https://github.com/JonathanShor/DoubletDetection.git
cd DoubletDetection
pip3 install .

If you are using pipenv as your virtual environment, it may struggle installing from the setup.py due to our custom Phenograph requirement. If so, try the following in the cloned repo:

pipenv run pip3 install .

Running DoubletDetection

To run basic doublet classification:

import doubletdetection
clf = doubletdetection.BoostClassifier()
# raw_counts is a cells by genes count matrix
labels = clf.fit(raw_counts).predict()
  • raw_counts is a scRNA-seq count matrix (cells by genes), and is array-like
  • labels is a 1-dimensional numpy ndarray with the value 1 representing a detected doublet, 0 a singlet, and np.nan an ambiguous cell.

The classifier works best when

  • There are several cell types present in the data
  • It is applied individually to each run in an aggregated count matrix

In v2.5 we have added a new experimental clustering method (scanpy's Louvain clustering) that is much faster than phenograph. We are still validating results from this new clustering. Please see the notebook below for an example of using this new feature.

See our jupyter notebook for an example on 8k PBMCs from 10x.

Obtaining data

Data can be downloaded from the 10x website.

Credits and citations

Gayoso, Adam, Shor, Jonathan, Carr, Ambrose J., Sharma, Roshan, Pe'er, Dana (2018, July 17). DoubletDetection (Version v2.4). Zenodo. http://doi.org/10.5281/zenodo.2678041

We also thank the participants of the 1st Human Cell Atlas Jamboree, Chun J. Ye for providing data useful in developing this method, and Itsik Pe'er for providing guidance in early development as part of the Computational genomics class at Columbia University.

This project is licensed under the terms of the MIT license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

doubletdetection-3.0.tar.gz (11.2 kB view details)

Uploaded Source

Built Distribution

doubletdetection-3.0-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

Details for the file doubletdetection-3.0.tar.gz.

File metadata

  • Download URL: doubletdetection-3.0.tar.gz
  • Upload date:
  • Size: 11.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.7.6 Darwin/20.2.0

File hashes

Hashes for doubletdetection-3.0.tar.gz
Algorithm Hash digest
SHA256 97d90410c7f705f372ede56b7babdec04ae704c01cf28175da557a4384f35843
MD5 7c1df55a668737d3b704213b8d74ab4e
BLAKE2b-256 2737328fcac78fab212d9e3d684a860935f764cd832d71e0cea56a744a7d0dd1

See more details on using hashes here.

File details

Details for the file doubletdetection-3.0-py3-none-any.whl.

File metadata

  • Download URL: doubletdetection-3.0-py3-none-any.whl
  • Upload date:
  • Size: 10.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.7.6 Darwin/20.2.0

File hashes

Hashes for doubletdetection-3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 801adfa6cc1e139c7446a6b0d725b78f4182bfaecaa3e2991e8fbde5472706b1
MD5 664a926d2a2e05f9c6772f2ef027304b
BLAKE2b-256 45d23fafcd6a589e223b15d1407852b2af30959604c42748f13d2f7c763d82e2

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page