Logo di Foundation Model Analysis

Foundation Model Analysis

Organizzazione
omicverse
foundation-model-analysis

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

Panoramica

Autoreomicverse
Repositoryomicclaw
Nome della skillfoundation-model-analysis
Stelle
33
Fork
5
File inclusi
1
LicenzaGPL-3.0
Link
  • Istruzioni in Markdown

    Un file SKILL.md che il modello carica quando serve, consumando token solo quando una richiesta è effettivamente pertinente.

  • Funziona con qualsiasi LLM

    Le skill IA sono in semplice Markdown, non in codice specifico di un fornitore, quindi funzionano con GPT, Claude, Gemini, Grok o un modello locale.

  • 1 file inclusi

    Script, modelli di documento e riferimenti che il modello può leggere mentre lavora. I file sono di sola lettura e non vengono mai eseguiti.

  • Open source

    Pubblicata da omicverse su GitHub. Leggi i sorgenti prima di installarla.

Installazione

Installa la skill IA Foundation Model Analysis in TypingMind per usarla con qualsiasi LLM, oppure copiala in un altro agente in grado di leggere SKILL.md.

1

Installa in TypingMind

TypingMind installa una skill direttamente dalla sua cartella GitHub: legge SKILL.md, raccoglie i file delle risorse e salva il risultato in locale.

  1. Apri l'app e vai su Plugin → Skill.
  2. Scegli "Installa da GitHub".
  3. Incolla l'URL della cartella della skill riportato qui sotto e conferma.
    https://github.com/omicverse/omicclaw/tree/main/src/omicverse_skills/skills/fm-foundation-models
  4. Attiva la skill in ogni chat in cui vuoi averla a disposizione.
Plugin → Skill → Nuova skill → Da URL GitHub, poi incolla l'URL della cartella e premi Continua.
2

Installa in un altro agente

Qualsiasi agente che legge il formato Agent Skills può usare questa skill: copia la cartella nella cartella delle skill di quell'agente.

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
Dopo la copia, riavvia Claude Code per caricare la nuova skill.

Usala in TypingMind

Attiva Foundation Model Analysis in qualsiasi chat di TypingMind e al resto pensa il modello. Il nome e la descrizione della skill sono nel prompt di sistema e, non appena arriva una richiesta pertinente, il modello carica da solo le istruzioni complete: non devi mai richiamarla manualmente e non consuma token finché non viene effettivamente usata.

Il modello carica automaticamente Foundation Model Analysis non appena riceve una richiesta pertinente.

Funziona con qualsiasi modello IA

Le skill IA sono semplici istruzioni in Markdown, non codice specifico di un fornitore, quindi Foundation Model Analysis non è vincolata al modello per cui è stata scritta. Installala una sola volta in TypingMind e usala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modello locale che esegui tu, sempre con le tue chiavi API.

  • Caricata solo quando serve

    Il prompt di sistema contiene solo il nome e la descrizione. Le istruzioni vengono recuperate alla prima richiesta pertinente, quindi una skill inutilizzata non costa nulla.

  • Cambia modello durante la chat

    Poiché la skill è composta da istruzioni e non da codice, continua a funzionare anche se cambi modello: il nuovo modello legge lo stesso file SKILL.md.

Istruzioni della skill

Questo è il contenuto di SKILL.md che il modello carica. Leggilo prima dell'installazione: una skill è un insieme di istruzioni che il tuo modello seguirà.

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

File inclusi

Il modello legge questi file quando servono, mentre la skill è caricata. Sono accessibili in sola lettura e non vengono mai eseguiti.

Domande frequenti

Cosa fa la skill IA Foundation Model Analysis?

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

Perché usare Foundation Model Analysis su TypingMind?

Perché la installi una volta e la usi con qualsiasi modello. Foundation Model Analysis è scritta in semplice Markdown anziché in codice specifico di un fornitore, quindi la stessa skill funziona con GPT-5, Claude, Gemini, Grok o un modello locale, e puoi cambiare modello durante la chat senza che smetta di funzionare. TypingMind usa le tue chiavi API, quindi paghi direttamente i fornitori anziché un abbonamento per posto utente, e le tue skill e chat restano nel tuo spazio di archiviazione.

Come installo Foundation Model Analysis in TypingMind?

Apri Plugin → Skill → Installa da GitHub in TypingMind e incolla https://github.com/omicverse/omicclaw/tree/main/src/omicverse_skills/skills/fm-foundation-models. TypingMind legge il file SKILL.md, include i file associati e installa la skill, che puoi abilitare per ogni singola chat.

Quali modelli IA possono usare Foundation Model Analysis?

Qualsiasi modello che colleghi in TypingMind. Le skill IA sono semplici istruzioni in Markdown anziché codice specifico di un fornitore, quindi GPT, Claude, Gemini, Grok e i modelli locali possono tutti caricare questa skill quando una richiesta corrisponde al suo scopo.

Quanti modelli IA posso usare con Foundation Model Analysis?

Quanti ne vuoi. Se un modello supporta le skill, puoi usarlo con Foundation Model Analysis: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama e molti altri, tutti su TypingMind con le tue chiavi API.

La skill IA Foundation Model Analysis è gratuita?

Sì. È pubblicata su GitHub da omicverse con licenza GPL-3.0. Paghi solo il tuo fornitore IA per i token che usi.

Cosa sono le skill IA?

Una skill IA è un pacchetto di istruzioni riutilizzabili che insegna a un modello IA come svolgere un'attività specifica. Segue il formato aperto Agent Skills: un file SKILL.md con un nome e una descrizione, più eventuali script, modelli o file di riferimento di cui il modello potrebbe aver bisogno. Il modello legge le istruzioni solo quando la tua richiesta corrisponde alla skill, quindi una skill installata non comporta costi finché non viene usata.

In cosa si differenziano le skill IA dai plugin o dai server MCP?

Un plugin o un server MCP fornisce a un modello nuovi strumenti da richiamare: codice che viene eseguito da qualche parte e restituisce un risultato. Una skill IA, invece, fornisce al modello conoscenze e procedure: come affrontare un'attività, quali passaggi seguire e quali caratteristiche deve avere un buon output. Le skill sono semplici istruzioni in Markdown, quindi non richiedono server, chiavi API né ambienti di esecuzione e funzionano con qualsiasi modello.

Vedi tutti

Crea subito la tua area di lavoro IA

Iscriviti alla nostra newsletter per ricevere aggiornamenti sulle nuove funzionalità e sulle prossime iniziative a premi 👇