MELD
Project description
MELD (Manifold Enhancement of Latent Dimensions)
Quantifying the effect of experimental perturbations in scRNA-seq data.
Quick Start
Introduction
MELD is a Python package for quantifying the effects of experimental perturbations. For an in depth explanation of the algorithm, read our manuscript on BioRxiv.
The goal of MELD is to identify populations of cells that are most affected by an experimental perturbation. Consider a simple two-sample experiment: one experimental sample and one control sample.
The current state of the art is to cluster cells based on global gene expression then 1) calculate the number of cells from each condition in each cluster and 2) do differential expression analysis between conditions within each cluster. The fundamental flaw in this approach is that clusters obtained by global variation are more or less arbitrary partitions of the data. Users can vary parameters to get almost any number of clusters of whatever size they want, so there's no reason to expect that these clusters contain cells that are affected by the perturbation.
MELD solves this problem by introducing the concept of the experimental signal as a graph signal on a cell similarity graph. MELD starts using the condition labels that indicate from which sample each cell was measured as the Raw Experimental Signal (RES). In signal processing terms, the RES is a noisy indicator of the effect of an experimental perturbation. This is because not only is the biological system and scRNA-seq measurement noisy, but also because an experimental perturbation is not expect to affect all cells in each sample equally. MELD uses methods from Graph Signal Processing to remove this noise to learn an Enhanced Experimental Signal that can be used to 1) identify individual cells that are the most or least enriched across conditions and 2) identify clusters of cells that are both transcriptionally similar are affected by the experimental perturbation to a similar extent.
Workflow
The basic MELD workflow is:
- Load, filter, normalize, and transform a counts matrix (or CyTOF data matrix) from each sample
- Concatenate the matrices from each sample
data, batch_idx = scprep.utils.combine_batches([batch_1, batch_2])
- Learn a cell similarity graph
G
usinggraphtools
G = gt.Graph(data)
- Visualize data using
PHATE
- Create the RES using the batch label for each cell
RES = np.array([-1 if b == '1' else 1 for b in batch_idx])
- Filter the RES to recover the EES
EES = MELD().fit_transform(G, RES)
- Use the RES and EES to recover Vertex Frequency Clusters
VertexFrequencyCluster(k).fit_predict(G, RES, EES)
Now you can identify which clusters have the highest or lowest EES values and which genes vary most strongly with the EES.
Installation
pip install --user meld
Requirements
MELD requires Python >= 3.5. All other requirements are installed automatically by pip
.
Usage example
For this usage example to work, you must have already loaded library-size normalized and square root-transformed data into a variable named data
. You also need to encode the condition of each sample into an array-like
named RES
of length data.shape[0]
. Each entry of the RES
array should be 1
if the cell is from the experimental condition and -1
if the cell is from the control condition.
import meld
import graphtools
G = graphtools.Graph(data, use_pygsp=True)
EES = meld.MELD().fit_transform(G=G, RES=RES)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file meld-0.3.2.tar.gz
.
File metadata
- Download URL: meld-0.3.2.tar.gz
- Upload date:
- Size: 16.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.7.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a3638f75899c820bc4167a448b908e26575838e76330cb6bf4e9eda21e0a023a |
|
MD5 | 3b06814be38ce2dba7d2699eb5cb2724 |
|
BLAKE2b-256 | 44b79d10be0f024e880be71e19d65fa30626cf97ed39d6c83817fe9789990039 |
File details
Details for the file meld-0.3.2-py3-none-any.whl
.
File metadata
- Download URL: meld-0.3.2-py3-none-any.whl
- Upload date:
- Size: 26.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.7.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a622b7cf45d1644fb7971c9dce4455b0502d034c18d435c5fb4de032129e10b |
|
MD5 | 3b05b11d61e0589179218e38ba719854 |
|
BLAKE2b-256 | f6337678209cde307bbbd0c59508ccd8c6fb45100e46552c3b1dd34f4056984b |