Skip to main content

Feature selection for preserving biological trajectories from single-cell data

Project description

DELVE

Dynamic selection of locally covarying features

Introduction

DELVE is an unsupervised feature selection method for identifying a representative subset of dynamically-expressed molecular features that recapitulate cellular trajectories from single-cell data (e.g. single-cell RNA sequencing, protein iterative immunofluorescence imaging). In contrast to previous work, DELVE uses a bottom-up approach to mitigate the effect of unwanted sources of feature variation confounding inference, and instead models cell states from dynamic feature modules that constitute core regulatory complexes. For more details on the method, please read the associated paper: Ranek JS, Stallaert W, Milner JJ, Redick M, Wolff SC, Beltran AS, Stanley N, and Purvis JE. DELVE: feature selection for preserving biological trajectories in single-cell data. Nature Communications. 2024.

  • Last Updated : June 24, 2026

For a comparison of alternative feature selection methods and the overall benchmarking pipeline, please see delve_benchmark.

Installation

Dependencies

  • Python >= 3.9, sketchKH >= 0.1.4, anndata >= 0.7.6, numpy >=1.26.4,<2.0, scipy >= 1.7.1, umap-learn == 0.5.1, scikit-learn >= 0.23.2, scanpy >=1.8.1, tqdm

You can install the package and necessary dependencies with pip by,

pip install delve-fs

Alternatively, you can clone the git repository and install the necessary dependencies using the provided yml file. First clone the repository by,

git clone https://github.com/jranek/delve.git

Then change the working directory as,

cd delve

You can then create the conda environment using the provided yml file.

conda env create -f venv_delve.yml

Once the environment is created, you can activate it by,

conda activate venv_delve

Data access

You can download all of the preprocessed single-cell datasets (.h5ad files) from the Zenodo repository.

Example usage

To perform trajectory-preserving feature selection with DELVE, first read in a preprocessed .h5ad object. This .h5ad object contains a sample profiled with a single-cell technology (i.e. protein iterative indirect immunofluorescence imaging data).

import anndata
import os
adata = anndata.read_h5ad(os.path.join('data', 'adata_RPE.h5ad'))

Then simply perform DELVE feature selection by,

# Inputs:
# adata: annotated data object (dimensions = cells x features)
# k: number of nearest neighbors in the between-cell kNN affinity graph
# n_pcs: number of principal components. If None (default): will construct a between-cell affinity graph by computing pairwise Euclidean distances according to adata.X. Else: according to PCA of adata.X 
# num_subsamples: number of representative cellular neighborhoods. Neighborhoods are subsampled using kernel herding sketching (see https://dl.acm.org/doi/abs/10.1145/3535508.3545539, https://github.com/CompCy-lab/SketchKH)  
# n_clusters: number of feature modules
# n_random_state: number of random KMeans clustering initializations when identifying dynamic feature modules
# random_state: random state parameter 
# n_jobs: number of tasks
# -----------------------
    
# Returns:
# delta_mean: average pairwise change in expression across prototypical cellular neighborhoods (dimensions = num_subsamples x features)
# modules: dataframe containing feature-cluster assignments and permutation p-values (dimensions = features x 2)
# ranked_features: ranked set of features that best preserve the local trajectory structure (dimensions = features x 1)
# -----------------------
from delve import *
delta_mean, modules, ranked_features = delve_fs(adata = adata, k = 10, num_subsamples = 1000, n_clusters = 5, random_state = 0, n_jobs = -1)

License

This software is licensed under the MIT license (https://opensource.org/licenses/MIT).

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

delve_fs-0.1.7.tar.gz (10.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

delve_fs-0.1.7-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

Details for the file delve_fs-0.1.7.tar.gz.

File metadata

  • Download URL: delve_fs-0.1.7.tar.gz
  • Upload date:
  • Size: 10.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.21

File hashes

Hashes for delve_fs-0.1.7.tar.gz
Algorithm Hash digest
SHA256 4baf2d7bb72094bf27cb8887717cd0578d1d033a89f6455b2ed032b1098d58f1
MD5 bd49ecacf882d45f200b2860f9a89c2c
BLAKE2b-256 b36138a6b0361df62ae50d859cb0c230569bfddc75e55f4b15c4bebf5a9a1733

See more details on using hashes here.

File details

Details for the file delve_fs-0.1.7-py3-none-any.whl.

File metadata

  • Download URL: delve_fs-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 9.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.21

File hashes

Hashes for delve_fs-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 08b37174989975c8c061085c579a0a1b8975b1a1a8d220f6ef576f5203f0d1a6
MD5 37e5cdbe729c7f52adbfa91548eb4748
BLAKE2b-256 3df875fb144708c9635b3dfd6e11923a79f4314e5a06d7e01b44f8d42481d85c

See more details on using hashes here.

Supported by

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