Skip to main content

Predicting emergent phenotypes from single cell populations using CELLECTION

Project description

CellECTION: An Attention-Based Multiple Instance Learning Approach to Predict Emergent Phenotypes from Single Cell Populations

developed by Hongru Hu: hrhu@ucdavis.edu

alt text

Biological systems exhibit emergent phenotypes that arise from the collective behavior of individual components, such as whole-organ functions that arise from the coordinated activity of its individual cells, or organism-level phenotypes that result from the functional interplay of collections of genes in the genome. We present CELLECTION, a deep learning framework that learns to associate subgroups of instances with different emergent phenotypes. We show CELLECTION enables interpretable predictions for heterogeneous tasks, including disease classification, identification of disease-associated cell subtypes, alignment of developmental stages between human model systems, and even predicting relative hand-wing indices across the avian lineage. CELLECTION therefore provides a scalable and flexible framework for identifying key cellular or genetic signatures underlying complex traits in development, disease, and evolution.


Installation

You can install CELLECTION from PyPI:

pip install cellection

For full functionality including additional bioinformatics tools:

pip install cellection[full]

Or install from source:

git clone https://github.com/quon-titative-biology/CELLECTION.git
cd CELLECTION
pip install -e .

Package requirements

scPair is implemented using torch 2.4.1, anndata 0.10.9, and scanpy 1.10.3 under Python 3.10.15.

Users can choose to create the environment provided under this repository (env file):

conda env create --file=environment.yml

Quick Start

import cellection
import scanpy as sc

# Load your single-cell data
adata = sc.read_h5ad("your_data.h5ad")

# Initialize CELLECTION object
cellection_obj = cellection.cellectiion_object(
    adata=adata,
    task_type='classification', 
    task_key='disease_cov', 
    sample_key='ind_cov', 
    batch_key=None, 
    model_type='classification', 
    input_type='measurement', 
    sparse_input=True, 
    InstanceEncoder=True, 
    val_size=0.2, 
    aggregator='gated_attention', 
    global_features=128, 
    attention_dim=32, 
    max_epochs=200, 
    learning_rate=1e-4, 
    batch_size=15, 
    seed=2, 
    device=torch.device("cuda" if torch.cuda.is_available() else "cpu"), 
    hidden_layer=[256, 32], 
    activation=nn.ReLU(), 
    layernorm=True, 
    batchnorm=False, 
    dropout_rate=0.1, 
    save_model=True, 
    save_path=None)

# Prepare the data and initialize the model
cellection_obj.prepare()

# Train the model
cellection_obj.train()

# Perform inference
sample_meta, true_labels, pred_labels, sample_embeddings, sample_global_features, attention_scores = cellection_obj.inference()

Features

  • Multiple Instance Learning (MIL): Framework for learning from bags of instances
  • PointNet Architecture: Implementation of PointNet for point cloud classification
  • Cell Classification: Specialized for biological cell classification tasks
  • Attention Mechanisms: Multiple aggregation methods including gated attention
  • Batch Effect Correction: Built-in support for batch effect handling
  • Flexible Input: Support for both measurement data and pre-computed features

Citation

If you use CELLECTION in your research, please cite:

@software{cellection2025,
  title={Predicting emergent phenotypes from single cell populations using CELLECTION},
  author={Hongru Hu},
  year={2025},
  url={https://github.com/quon-titative-biology/CELLECTION}
}

License

This project is licensed under the MIT License - see the LICENSE file for details.

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

cellection-0.1.1.tar.gz (16.0 kB view details)

Uploaded Source

Built Distribution

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

cellection-0.1.1-py3-none-any.whl (15.1 kB view details)

Uploaded Python 3

File details

Details for the file cellection-0.1.1.tar.gz.

File metadata

  • Download URL: cellection-0.1.1.tar.gz
  • Upload date:
  • Size: 16.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.6

File hashes

Hashes for cellection-0.1.1.tar.gz
Algorithm Hash digest
SHA256 6d6860d326f54aa8120a2347b5f1987422c0defe1beb14138089a8ee937170e7
MD5 f2a7e1170450ce46fe0e75de9374f14c
BLAKE2b-256 45ee983b31d5ae056b60214c10729246a4c367e5b3ff34dec6be85980be12f63

See more details on using hashes here.

File details

Details for the file cellection-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: cellection-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 15.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.6

File hashes

Hashes for cellection-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c051d4443d17a70790995767e7d660255c05f04f93cdbaf2ab336b67f496ccbf
MD5 94734b402c62258d54749ca192a15704
BLAKE2b-256 97bb3d61f4e661883545513aff3e2a75cf7cac917862990f3203012633ac3792

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