mofa-framework

Routes multi-omics factor analysis tasks across the four MOFA implementations.

1|Updated Nov 20, 2025
One-click install
npx skills add https://github.com/tony-zhelonkin/scio --skill mofa-framework-tony-zhelonkin
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: mofa-framework
Source: https://github.com/tony-zhelonkin/scio/tree/main/skills/mofa-framework
Command: npx skills add https://github.com/tony-zhelonkin/scio --skill mofa-framework-tony-zhelonkin

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires mofapy2, mofax, cupy, and includes references (resource) components.

What problem does it solve? Choosing among the four MOFA implementations (mofapy2, MOFA2, MOFAcellulaR, mofax) and handling cross-cutting concerns like per-view likelihood selection, R-squared semantics, sign ambiguity, and GPU/SVI configuration is error-prone without a shared contract. This Skill acts as the router for the MOFA family, defining the common input/output contract and decision tree so every child skill behaves consistently. ## Core Features & Use Cases - Model-selection decision tree: Routes by working language (Python vs R) and data grain (cells vs donor pseudo-bulk) to the correct mofa-* implementation skill. - Shared contract: Enforces features-by-samples matrices, one likelihood per view (gaussian/bernoulli/poisson), NaN-based missingness, group declaration before build, and explicit seeds. - Cross-cutting references: In-depth documents on architecture, variance-explained semantics, geometric caveats (no biplot, sign/order ambiguity), interop via the shared HDF5 format, and a troubleshooting log. - Use Case: A bioinformatician with RNA log-CPM, binarized ATAC peaks, and raw counts needs to fit a multi-view factor model; this Skill routes them to mofa-mofapy2 with gaussian/bernoulli/poisson likelihoods and the pre-fit checklist before calling run(). ## Quick Start Ask the agent to help you choose the right MOFA implementation for your multi-omics dataset and walk the pre-fit checklist before training.

Frequently Asked Questions about mofa-framework

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I choose between mofapy2, MOFA2, MOFAcellulaR, and mofax?▼

Choose by language and task: mofapy2 for fitting in Python, MOFA2 for fitting and plotting in R, MOFAcellulaR for donor-level pseudo-bulk single-cell analysis in R, and mofax for Python downstream analysis of a trained HDF5 model. All four share the same HDF5 format written by mofapy2.

Which likelihood should I use for each MOFA view?▼

Use gaussian for log-normalized continuous data like log-CPM or VST, bernoulli for 0/1 data like binarized ATAC peaks, and poisson for raw integer counts. Set likelihoods explicitly because the auto-detector classifies all-integer data as poisson even if you forgot to log-normalize.

Does MOFA2 in R reimplement the model math?▼

No. MOFA2 is an R interface that calls the Python mofapy2 engine via reticulate and basilisk, adding plotting and convenience functions. The R and Python environments must agree on the mofapy2 version for interop to work.

Can MOFA produce a biplot like PCA or FAMD?▼

No. MOFA has no shared singular values, no transition formula, and no biplot function in any implementation. The documented workaround is an L1 supplementary-projection overlay on the factor scatter, or use FAMD/MFA via the factor-analysis-framework for a true Benzécri biplot.

Why did the sign of a MOFA factor flip between runs?▼

The bilinear likelihood is sign-flip equivariant per factor, and variational inference has no preferred sign. Impose a canonical sign convention such as largest-absolute-loading-positive before downstream use, and match factors across runs by Tucker congruence rather than index.

When should I not use MOFA for my analysis?▼

Avoid MOFA for single-omic Gaussian PCA (use scanpy), nonlinear visualization (use UMAP or t-SNE), or when you need negative binomial likelihoods for overdispersed counts (use scvi-tools). MOFA also does not provide inertia budgets or cos2/contribution statistics.