Skip to main content

M3DropPy

A Python implementation of the M3Drop single-cell RNA-seq analysis tool, originally developed as an R package.

About

M3DropPy is a Python conversion of the popular M3Drop R package for dropout-based feature selection in single-cell RNA sequencing data. This package provides powerful methods for identifying highly variable and differentially expressed genes by leveraging the high frequency of dropout events (zero expression values) that are characteristic of single-cell RNA-seq data.

Background

Single-cell RNA sequencing often results in a large number of dropouts (genes with zero expression in particular cells) due to the technical challenges of reverse-transcribing and amplifying small quantities of RNA from individual cells. M3Drop takes advantage of this characteristic by modeling the relationship between dropout rate and mean expression using the Michaelis-Menten equation:

P_i = 1 - S_i/(S_i + K)

Where:

  • P_i is the proportion of cells where gene i drops out
  • S_i is the mean expression of gene i
  • K is the Michaelis constant

Key Features

M3Drop Method

  • Michaelis-Menten Modeling: Models dropout rates using enzyme kinetics principles
  • Feature Selection: Identifies differentially expressed genes by detecting outliers from the fitted curve
  • Optimized for Smart-seq2: Works best with full-transcript protocols without UMIs

DANB (Depth-Adjusted Negative Binomial) Method

  • UMI Compatibility: Specifically designed for UMI-tagged data (10X Chromium, etc.)
  • Depth Adjustment: Accounts for sequencing depth variations across cells
  • Negative Binomial Modeling: Models count data with appropriate variance structure

Additional Methods

  • Brennecke Method: Implementation of highly variable gene detection
  • Consensus Feature Selection: Combines multiple feature selection approaches
  • Pearson Residuals: Alternative normalization for UMI data

Installation

You can install M3DropPy using pip:

pip install M3Drop

Imports

You can import specific functions from different modules:

from m3Drop.basics import your_function_name
from m3Drop.M3D_Imputation import another_function

Usage

from m3Drop.basics import M3DropConvertData, M3DropFeatureSelection
from m3Drop.NB_UMI import NBumiFitModel, NBumiFeatureSelectionCombinedDrop, NBumiPearsonResiduals

# Load your single-cell expression data
# counts should be a genes x cells matrix

# For non-UMI data (Smart-seq2, etc.)
# Convert and normalize data
norm_data = M3DropConvertData(counts, is_counts=True)

# Perform M3Drop feature selection
selected_genes = M3DropFeatureSelection(norm_data, mt_method="fdr", mt_threshold=0.01)

# For UMI data (10X Chromium, etc.)
# Fit DANB model
danb_fit = NBumiFitModel(counts)

# Perform dropout-based feature selection
selected_genes = NBumiFeatureSelectionCombinedDrop(danb_fit, method="fdr", qval_thres=0.01)

# Calculate Pearson residuals for normalization
pearson_residuals = NBumiPearsonResiduals(counts, danb_fit)

When to Use Each Method

  • M3Drop: Use for Smart-seq2 and other full-transcript protocols without UMIs
  • DANB/NBumi: Use for UMI-tagged data like 10X Chromium
  • Consensus: Use when you want to combine multiple feature selection approaches

Original R Package

This Python implementation is based on the M3Drop R package developed by Tallulah Andrews and converted to Python by Anthony Son and Pragalvha Sharma.

Citation

If you use M3DropPy in your research, please cite the original M3Drop paper:

  • Andrews, T.S. and Hemberg, M. (2019). M3Drop: Dropout-based feature selection for scRNASeq. Bioinformatics, 35(16), 2865-2867.

Metadata

Release files for M3Drop 0.4.56

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for M3Drop 0.4.56
File Size Uploaded Provenance Actions
m3drop-0.4.56.tar.gz 26.2 kB Without provenance Details for m3drop-0.4.56.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for M3Drop 0.4.56
File Interpreter ABI Platform Actions
m3drop-0.4.56-py3-none-any.whl Python 3 none any Details for m3drop-0.4.56-py3-none-any.whl

Total release size: 63.4 kB

Release files / m3drop-0.4.56.tar.gz

Download URL m3drop-0.4.56.tar.gz
Size 26.2 kB
Tags Source
SHA-256 checksum
How to use checksums
0c6b1858d2df6a6fd1509f1d0cf99da644bf1b22a3e8fe1ac8d7a310da6a5826
BLAKE2b-256 checksum
How to use checksums
382f6febb99c8a6a4841c894fbcd5d567e272c3d8fc3a7cd75aa551ab718bfbd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.10

Release files / m3drop-0.4.56-py3-none-any.whl

Download URL m3drop-0.4.56-py3-none-any.whl
Size 37.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
394c5ff34b6b619804510b3c1809b83d71c79bdd6c4a52b553b92d89b410a3c2
BLAKE2b-256 checksum
How to use checksums
4434162db4427118b721030fc4f9444810272d6df7c9300812a8bb653141239e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.10

Security for M3Drop 0.4.56

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.4.56 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page