Foundation Model Analysis logo

Foundation Model Analysis

Organization
omicverse
foundation-model-analysis

Foundation model workflows: scGPT, Geneformer, UCE, CellPLM cell embedding, annotation, integration via ov.fm unified API. 22 models.

Overview

Publisheromicverse
Repositoryomicclaw
Skill namefoundation-model-analysis
Stars
33
Forks
5
Bundled files
1
LicenseGPL-3.0
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 1 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by omicverse on GitHub. Read the source before you install it.

Installation

Install the Foundation Model Analysis AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/omicverse/omicclaw/tree/main/src/omicverse_skills/skills/fm-foundation-models
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/omicverse/omicclaw.git /tmp/omicclaw
mkdir -p .claude/skills
cp -r /tmp/omicclaw/src/omicverse_skills/skills/fm-foundation-models .claude/skills/foundation-model-analysis
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Foundation Model Analysis in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Foundation Model Analysis on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Foundation Model Analysis is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Foundation Model Analysis

Use this skill when a user wants to generate cell embeddings, annotate cell types, integrate batches, or predict perturbation effects using single-cell foundation models. The ov.fm module provides a unified 6-step API that works identically across all 22 supported models.

Model Selection Guide

Pick a model based on your task, species, and hardware. The 5 skill-ready models have full adapter support:

ModelTasksSpeciesGene IDsMin VRAMCPU?Best when
scGPTembed, integratehuman, mousesymbol8 GBYesGeneral RNA, multi-modal (RNA+ATAC+Spatial)
Geneformerembed, integratehumanensembl4 GBYesEnsembl IDs, CPU-only environments, network biology
UCEembed, integrate7 speciessymbol16 GBNoCross-species (zebrafish, macaque, pig, frog, lemur)
scFoundationembed, integratehumancustom16 GBNoxTrimoGene architecture, perturbation tasks
CellPLMembed, integratehumansymbol8 GBYesFastest inference (batch_size=128), cell-centric

12 additional partial models (scBERT, GeneCompass, Nicheformer, scMulan, tGPT, CellFM, scCello, scPrint, AiDocell, Pulsar, Atacformer, scPlantLLM) and 5+ experimental models are also registered.

Quick decision tree

  • Cross-species → UCE
  • Ensembl gene IDs or CPU-only → Geneformer
  • ATAC-seq data → Atacformer (partial) or scGPT
  • Multi-omics (RNA+ATAC+Protein) → scMulan (partial)
  • Spatial transcriptomics → Nicheformer (partial) or scGPT
  • Fastest throughput on large datasets → CellPLM
  • General RNA, no special needs → scGPT

6-Step Unified Workflow

Every FM analysis follows the same pipeline regardless of model choice:

Step 1: Discover available models

python
import omicverse as ov
models = ov.fm.list_models(task="embed", skill_ready_only=True)
# Returns: {"count": int, "models": [{name, version, tasks, species, ...}]}

Step 2: Profile your data

python
profile = ov.fm.profile_data("pbmc3k.h5ad")
# Auto-detects: species, gene_scheme (symbol/ensembl), modality, batch/celltype columns
# Returns model_compatibility per model (compatible: bool, issues: [], recommendations: [])

Step 3: Select best model

python
selection = ov.fm.select_model(
    "pbmc3k.h5ad",
    task="embed",
    prefer_zero_shot=True,   # No labeled data needed
    max_vram_gb=8,            # Hardware constraint
)
model_name = selection['recommended']['name']
# Returns: recommended model with rationale, fallbacks list, preprocessing_notes

Step 4: Validate compatibility

python
validation = ov.fm.preprocess_validate("pbmc3k.h5ad", model_name, "embed")
# Returns: status ("ready"/"needs_preprocessing"), diagnostics, auto_fixes suggestions

Step 5: Execute

python
result = ov.fm.run(
    task="embed",
    model_name=model_name,
    adata_path="pbmc3k.h5ad",
    output_path="pbmc3k_embedded.h5ad",
    device="auto",          # auto-detects cuda/mps/cpu
    batch_size=64,          # CellPLM can use 128
    batch_key=None,         # For integration tasks
    label_key=None,         # For annotation tasks
    checkpoint_dir=None,    # Auto-resolved from env vars or cache
)
# Returns: {output_path, output_keys, statistics} or {error: str}

Step 6: Interpret results

python
metrics = ov.fm.interpret_results(
    "pbmc3k_embedded.h5ad",
    task="embed",
    generate_umap=True,
    color_by=["cell_type"],
)
# Returns: metrics (silhouette scores), visualizations, embedding_keys

Gene ID Resolution

Gene ID mismatch is the most common failure mode. The profile_data() function detects your data's gene scheme automatically.

ModelExpected IDsExampleAuto-convert?
scGPTHGNC symbolsTP53, CD4No — data must use symbols
GeneformerEnsembl IDsENSG00000141510No — data must use Ensembl
UCEHGNC symbolsTP53, CD4No
scFoundationCustom vocab19,264 gene vocabAdapter handles mapping

If profile_data() reports gene_scheme: "ensembl" but you selected scGPT (which needs symbols), either convert gene IDs first or switch to Geneformer.

Hardware Requirements

ModelGPU RequiredMin VRAMCPU FallbackDefault Batch Size
scGPTRecommended8 GBYes (slow)64
GeneformerNo4 GBYes (full speed)64
UCEYes16 GBNo64
scFoundationYes16 GBNo64
CellPLMRecommended8 GBYes128

Device auto-detection priority: CUDA → MPS (Apple Silicon) → CPU.

Checkpoint resolution priority:

  1. checkpoint_dir parameter in ov.fm.run()
  2. Model-specific env var: OV_FM_CHECKPOINT_DIR_SCGPT
  3. Base env var + subfolder: OV_FM_CHECKPOINT_DIR/scgpt/
  4. OmicVerse model cache (auto-download if available)

Critical API Reference

TaskType values

"embed", "annotate", "integrate", "perturb", "spatial", "drug_response"

Output keys are model-specific

python
# After running, embeddings are stored in adata.obsm with model-specific keys:
# scGPT → adata.obsm['X_scGPT']
# Geneformer → adata.obsm['X_geneformer']
# UCE → adata.obsm['X_uce']
# Check result['output_keys'] for the exact keys written

Provenance tracking

python
# Every run writes provenance to adata.uns['fm']:
# {"runs_json": [...], "latest_json": "..."}
# Contains: model_name, version, task, timestamp, output_keys

Defensive Validation Patterns

python
import os

# Before any FM workflow: verify input file exists
assert os.path.isfile(adata_path), f"Input file not found: {adata_path}"

# After profile_data: check species was detected
profile = ov.fm.profile_data(adata_path)
assert 'unknown' not in profile.get('species', 'unknown').lower(), \
    f"Species not detected. Check gene names — use HGNC symbols (human) or standard names (mouse)."

# After select_model: verify a model was recommended
selection = ov.fm.select_model(adata_path, task="embed")
assert 'recommended' in selection and selection['recommended'], \
    "No compatible model found. Check species, gene IDs, and hardware constraints."

# Before run: verify checkpoint exists (for models requiring local weights)
desc = ov.fm.describe_model(model_name)
if desc.get('resources', {}).get('checkpoint_url'):
    print(f"Model may need checkpoint download. Check OV_FM_CHECKPOINT_DIR env var.")

Troubleshooting

  • Gene ID mismatch warning in profile: Your data uses Ensembl IDs but the selected model expects symbols (or vice versa). Convert with adata.var_names = adata.var['gene_symbols'] or switch to a compatible model.
  • CUDA out of memory: Reduce batch_size (try 32 or 16). For UCE/scFoundation (16GB VRAM), ensure no other GPU processes are running.
  • Model not installed or ImportError: Some models need separate packages. Install via pip install scgpt / pip install geneformer or use conda isolation (OV_FM_DISABLE_CONDA_SUBPROCESS=0).
  • Species unsupported: Most models only support human. For mouse, use scGPT or UCE. For zebrafish/pig/frog, only UCE works.
  • Empty embeddings (all zeros): Input data may have constant or near-zero expression. Filter genes with sc.pp.filter_genes(adata, min_cells=10) before running.
  • Checkpoint not found: Set the environment variable OV_FM_CHECKPOINT_DIR_<MODEL>=/path/to/weights or pass checkpoint_dir directly to ov.fm.run().
  • device='auto' picks CPU despite GPU available: Check torch.cuda.is_available(). If False, verify CUDA drivers and PyTorch CUDA build.

Examples

  • "Generate scGPT embeddings for my PBMC dataset and visualize on UMAP."
  • "Which foundation model works best for my mouse brain scRNA-seq data?"
  • "Embed my ATAC-seq data using a foundation model — I only have 8GB VRAM."
  • "Profile my h5ad file and tell me which models are compatible."

References

  • Quick copy/paste commands: reference.md
  • FM API source: omicverse/fm/api.py
  • Model registry: omicverse/fm/registry.py

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Foundation Model Analysis AI skill do?

Foundation model workflows: scGPT, Geneformer, UCE, CellPLM cell embedding, annotation, integration via ov.fm unified API. 22 models.

Why use Foundation Model Analysis on TypingMind?

Because you install it once and use it with any model. Foundation Model Analysis is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Foundation Model Analysis in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/omicverse/omicclaw/tree/main/src/omicverse_skills/skills/fm-foundation-models. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Foundation Model Analysis?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Foundation Model Analysis?

As many as you like. As long as a model supports skills, you can use Foundation Model Analysis with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Foundation Model Analysis AI skill free?

Yes. It is published on GitHub by omicverse under the GPL-3.0 license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇