scFoundation Model Agent
The scFoundation Model Agent provides a unified interface to leverage state-of-the-art single-cell foundation models for diverse downstream tasks. It integrates scGPT, scBERT, Geneformer, scFoundation, and emerging models to enable cross-species cell annotation, in silico perturbation prediction, gene regulatory network inference, and batch integration.
When to Use This Skill
- When annotating cell types across species (human, mouse, cross-species).
- For predicting perturbation effects (knockouts, drug treatments) in silico.
- To infer gene regulatory networks from single-cell data.
- When integrating batches without losing biological signal.
- For generating cell embeddings for downstream analysis.
Core Capabilities
Cross-Species Cell Annotation: Transfer cell type labels across species using unified embeddings.
In Silico Perturbation: Predict gene expression changes from knockouts/treatments.
Gene Regulatory Network Inference: Discover TF-target relationships from attention patterns.
Batch Integration: Remove technical variation while preserving biology.
Cell Embedding Generation: Generate universal cell representations for any downstream task.
Multi-Model Ensemble: Combine predictions from multiple foundation models.
Supported Foundation Models
| Model |
Parameters |
Training Data |
Strengths |
| scGPT |
50M |
33M human cells |
General purpose, perturbations |
| Geneformer |
10M |
30M cells |
Chromatin, gene networks |
| scBERT |
20M |
1.2M cells |
Cell type annotation |
| scFoundation |
100M |
50M cells |
Large-scale, multi-species |
| scTab |
15M |
22M cells |
Tabular prediction |
| UCE (Universal Cell Embeddings) |
100M |
36M cells |
Cross-species transfer |
Workflow
Input: Single-cell RNA-seq data (AnnData format).
Model Selection: Choose appropriate model(s) for task.
Preprocessing: Tokenize genes, normalize expression.
Inference: Generate embeddings or predictions.
Task Execution: Annotation, perturbation, or network inference.
Ensemble (Optional): Combine multi-model predictions.
Output: Annotated data, predictions, networks.
Example Usage
User: "Use scGPT to predict the effect of CRISPR knockout of TP53 on these cancer cells."
Agent Action:
python3 Skills/Genomics/scFoundation_Model_Agent/foundation_predict.py \
--input cancer_cells.h5ad \
--model scgpt \
--task perturbation \
--perturbation "TP53 knockout" \
--model_checkpoint scgpt_human_gene_v1.pt \
--output tp53_ko_predictions.h5ad
Task-Specific Usage
Cell Type Annotation
python3 foundation_predict.py \
--input query_cells.h5ad \
--model geneformer \
--task annotation \
--reference tabula_sapiens.h5ad \
--output annotated_cells.h5ad
Gene Network Inference
python3 foundation_predict.py \
--input cells.h5ad \
--model scgpt \
--task grn_inference \
--transcription_factors tf_list.txt \
--output gene_network.csv
Batch Integration
python3 foundation_predict.py \
--input multi_batch.h5ad \
--model scfoundation \
--task integration \
--batch_key batch \
--output integrated.h5ad
Output Formats
| Task |
Output |
Format |
| Annotation |
Cell type labels |
.h5ad obs column |
| Perturbation |
Predicted expression |
.h5ad layer |
| GRN |
TF-target edges |
.csv, .graphml |
| Integration |
Corrected embeddings |
.h5ad obsm |
| Embeddings |
Cell representations |
.h5ad obsm |
Performance Benchmarks
| Task |
Model |
Dataset |
Performance |
| Annotation |
scGPT |
Tabula Sapiens |
93% accuracy |
| Annotation |
Geneformer |
HLCA |
91% accuracy |
| Perturbation (R²) |
scGPT |
Norman 2019 |
0.87 |
| Integration (kBET) |
scFoundation |
Multi-atlas |
0.92 |
| Cross-species |
UCE |
Human→Mouse |
85% F1 |
AI/ML Architecture
Transformer Backbone:
- Gene-level tokenization
- Attention-based gene interactions
- Masked expression prediction pretraining
Perturbation Module:
- Conditional generation
- Counterfactual prediction
- Dose-response modeling
Transfer Learning:
- Zero-shot annotation
- Few-shot fine-tuning
- Domain adaptation
Prerequisites
- Python 3.10+
- PyTorch 2.0+
- transformers, flash-attn
- Scanpy, AnnData
- Model-specific weights
- GPU with 16GB+ VRAM
Related Skills
- Nicheformer_Spatial_Agent - For spatial foundation models
- scGPT_Agent - Dedicated scGPT workflows
- Cell_Type_Annotation - Traditional annotation methods
- Pathway_Analysis - Gene set enrichment
Model Selection Guide
| Use Case |
Recommended Model |
Reason |
| General annotation |
scGPT |
Broad training, robust |
| Cross-species |
UCE |
Species-agnostic embeddings |
| Perturbation |
scGPT |
Best perturbation performance |
| GRN inference |
Geneformer |
Attention → regulatory links |
| Large-scale |
scFoundation |
Efficient, scalable |
| Tabular prediction |
scTab |
Optimized for classification |
Special Considerations
- Gene Coverage: Models trained on variable gene sets; check overlap
- Species: Some models human-only; use UCE for cross-species
- Compute: Large models need significant GPU memory
- Fine-Tuning: Task-specific fine-tuning improves performance
- Versioning: Model weights update frequently; track versions
Ensemble Strategies
| Strategy |
Method |
Benefit |
| Majority Vote |
Mode of predictions |
Robust to outliers |
| Weighted Average |
Confidence-weighted |
Leverages uncertainty |
| Stacking |
Meta-model |
Learns model strengths |
| Attention Fusion |
Cross-model attention |
Deep integration |
Author
AI Group - Biomedical AI Platform
1---2name: scfoundation-model-agent3description: Unified agent for leveraging single-cell foundation models (scGPT, scBERT, Geneformer, scFoundation) for cross-species annotation, perturbation prediction, and gene network inference.4---56<!--7# COPYRIGHT NOTICE8# This file is part of the "Universal Biomedical Skills" project.9# Copyright (c) 2026 MD BABU MIA, PhD <md.babu.mia@mssm.edu>10# All Rights Reserved.11#12# This code is proprietary and confidential.13# Unauthorized copying of this file, via any medium is strictly prohibited.14#15# Provenance: Authenticated by MD BABU MIA1617-->18192021# scFoundation Model Agent2223The **scFoundation Model Agent** provides a unified interface to leverage state-of-the-art single-cell foundation models for diverse downstream tasks. It integrates scGPT, scBERT, Geneformer, scFoundation, and emerging models to enable cross-species cell annotation, in silico perturbation prediction, gene regulatory network inference, and batch integration.2425## When to Use This Skill2627* When annotating cell types across species (human, mouse, cross-species).28* For predicting perturbation effects (knockouts, drug treatments) in silico.29* To infer gene regulatory networks from single-cell data.30* When integrating batches without losing biological signal.31* For generating cell embeddings for downstream analysis.3233## Core Capabilities34351. **Cross-Species Cell Annotation**: Transfer cell type labels across species using unified embeddings.36372. **In Silico Perturbation**: Predict gene expression changes from knockouts/treatments.38393. **Gene Regulatory Network Inference**: Discover TF-target relationships from attention patterns.40414. **Batch Integration**: Remove technical variation while preserving biology.42435. **Cell Embedding Generation**: Generate universal cell representations for any downstream task.44456. **Multi-Model Ensemble**: Combine predictions from multiple foundation models.4647## Supported Foundation Models4849| Model | Parameters | Training Data | Strengths |50|-------|------------|---------------|-----------|51| scGPT | 50M | 33M human cells | General purpose, perturbations |52| Geneformer | 10M | 30M cells | Chromatin, gene networks |53| scBERT | 20M | 1.2M cells | Cell type annotation |54| scFoundation | 100M | 50M cells | Large-scale, multi-species |55| scTab | 15M | 22M cells | Tabular prediction |56| UCE (Universal Cell Embeddings) | 100M | 36M cells | Cross-species transfer |5758## Workflow59601. **Input**: Single-cell RNA-seq data (AnnData format).61622. **Model Selection**: Choose appropriate model(s) for task.63643. **Preprocessing**: Tokenize genes, normalize expression.65664. **Inference**: Generate embeddings or predictions.67685. **Task Execution**: Annotation, perturbation, or network inference.69706. **Ensemble (Optional)**: Combine multi-model predictions.71727. **Output**: Annotated data, predictions, networks.7374## Example Usage7576**User**: "Use scGPT to predict the effect of CRISPR knockout of TP53 on these cancer cells."7778**Agent Action**:79```bash80python3 Skills/Genomics/scFoundation_Model_Agent/foundation_predict.py \81 --input cancer_cells.h5ad \82 --model scgpt \83 --task perturbation \84 --perturbation "TP53 knockout" \85 --model_checkpoint scgpt_human_gene_v1.pt \86 --output tp53_ko_predictions.h5ad87```8889## Task-Specific Usage9091### Cell Type Annotation92```bash93python3 foundation_predict.py \94 --input query_cells.h5ad \95 --model geneformer \96 --task annotation \97 --reference tabula_sapiens.h5ad \98 --output annotated_cells.h5ad99```100101### Gene Network Inference102```bash103python3 foundation_predict.py \104 --input cells.h5ad \105 --model scgpt \106 --task grn_inference \107 --transcription_factors tf_list.txt \108 --output gene_network.csv109```110111### Batch Integration112```bash113python3 foundation_predict.py \114 --input multi_batch.h5ad \115 --model scfoundation \116 --task integration \117 --batch_key batch \118 --output integrated.h5ad119```120121## Output Formats122123| Task | Output | Format |124|------|--------|--------|125| Annotation | Cell type labels | .h5ad obs column |126| Perturbation | Predicted expression | .h5ad layer |127| GRN | TF-target edges | .csv, .graphml |128| Integration | Corrected embeddings | .h5ad obsm |129| Embeddings | Cell representations | .h5ad obsm |130131## Performance Benchmarks132133| Task | Model | Dataset | Performance |134|------|-------|---------|-------------|135| Annotation | scGPT | Tabula Sapiens | 93% accuracy |136| Annotation | Geneformer | HLCA | 91% accuracy |137| Perturbation (R²) | scGPT | Norman 2019 | 0.87 |138| Integration (kBET) | scFoundation | Multi-atlas | 0.92 |139| Cross-species | UCE | Human→Mouse | 85% F1 |140141## AI/ML Architecture142143**Transformer Backbone**:144- Gene-level tokenization145- Attention-based gene interactions146- Masked expression prediction pretraining147148**Perturbation Module**:149- Conditional generation150- Counterfactual prediction151- Dose-response modeling152153**Transfer Learning**:154- Zero-shot annotation155- Few-shot fine-tuning156- Domain adaptation157158## Prerequisites159160* Python 3.10+161* PyTorch 2.0+162* transformers, flash-attn163* Scanpy, AnnData164* Model-specific weights165* GPU with 16GB+ VRAM166167## Related Skills168169* Nicheformer_Spatial_Agent - For spatial foundation models170* scGPT_Agent - Dedicated scGPT workflows171* Cell_Type_Annotation - Traditional annotation methods172* Pathway_Analysis - Gene set enrichment173174## Model Selection Guide175176| Use Case | Recommended Model | Reason |177|----------|-------------------|--------|178| General annotation | scGPT | Broad training, robust |179| Cross-species | UCE | Species-agnostic embeddings |180| Perturbation | scGPT | Best perturbation performance |181| GRN inference | Geneformer | Attention → regulatory links |182| Large-scale | scFoundation | Efficient, scalable |183| Tabular prediction | scTab | Optimized for classification |184185## Special Considerations1861871. **Gene Coverage**: Models trained on variable gene sets; check overlap1882. **Species**: Some models human-only; use UCE for cross-species1893. **Compute**: Large models need significant GPU memory1904. **Fine-Tuning**: Task-specific fine-tuning improves performance1915. **Versioning**: Model weights update frequently; track versions192193## Ensemble Strategies194195| Strategy | Method | Benefit |196|----------|--------|---------|197| Majority Vote | Mode of predictions | Robust to outliers |198| Weighted Average | Confidence-weighted | Leverages uncertainty |199| Stacking | Meta-model | Learns model strengths |200| Attention Fusion | Cross-model attention | Deep integration |201202## Author203204AI Group - Biomedical AI Platform205206207<!-- AUTHOR_SIGNATURE: 9a7f3c2e-MD-BABU-MIA-2026-MSSM-SECURE -->