[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7EGR65REESVGQFJKD1VE6ZM":3,"skill-same:01M7EGR65REESVGQFJKD1VE6ZM":79},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":48,"commitSha":49,"skillDirectory":50,"forksCount":14,"repositoryHtmlUrl":51,"repositoryHomepageUrl":51,"ownerHtmlUrl":52,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":53,"install":54,"resources":66},"01M7EGR65REESVGQFJKD1VE6ZM","bio-workflows-multi-omics-pipeline",null,"Orchestrates VERTICAL bulk multi-omics integration (RNA + protein + methylation on the SAME samples) from harmonization to a validated result, routing to MOFA2 (shared factors), mixOmics\u002FDIABLO (predictive signature), or SNF (patient subtypes). Use when confirming the correspondence is vertical (not horizontal same-features-different-cohorts), joining on a stable sample primary key rather than cbind on assumed row order, normalizing each omic in its OWN space and equalizing block variance BEFORE stacking (or the widest omic hijacks every shared factor), correcting batch ONCE in one place, and validating in a HELD-OUT cohort because in-cohort CV at n\u003C\u003Cp is optimistically biased. Hands mechanism to the multi-omics-integration component skills; not a re-teach of any single step.","Mr-Nobody-Anonymous\u002FAll-skills","Mr-Nobody-Anonymous","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F184253119?v=4","01M7AEXFJHKTYQW5R0ZCQQTWFV","anonymous","01M7C00M3GQR4QKP9GZA42GFAK",0,"MIT","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-workflows-multi-omics-pipeline\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: bio-workflows-multi-omics-pipeline\ndescription: Orchestrates VERTICAL bulk multi-omics integration (RNA + protein + methylation on the SAME samples) from harmonization to a validated result, routing to MOFA2 (shared factors), mixOmics\u002FDIABLO (predictive signature), or SNF (patient subtypes). Use when confirming the correspondence is vertical (not horizontal same-features-different-cohorts), joining on a stable sample primary key rather than cbind on assumed row order, normalizing each omic in its OWN space and equalizing block variance BEFORE stacking (or the widest omic hijacks every shared factor), correcting batch ONCE in one place, and validating in a HELD-OUT cohort because in-cohort CV at n\u003C\u003Cp is optimistically biased. Hands mechanism to the multi-omics-integration component skills; not a re-teach of any single step.\ntool_type: r\nprimary_tool: MOFA2\nworkflow: true\ndepends_on:\n  - multi-omics-integration\u002Fintegration-design\n  - multi-omics-integration\u002Fdata-harmonization\n  - multi-omics-integration\u002Fmofa-integration\n  - multi-omics-integration\u002Fmixomics-analysis\n  - multi-omics-integration\u002Fsimilarity-network\nqc_checkpoints:\n  - after_harmonization: \"Sample overlap >80% across blocks; join on a stable primary key (MAE sampleMap \u002F MuData obs), never cbind on row order\"\n  - after_per_block_norm: \"Each omic normalized in its OWN space (VST\u002FM-values\u002Flog2+MNAR\u002FCLR); missingness per modality \u003C20%\"\n  - after_scaling: \"Per-VIEW variance equalized (scale_views) BEFORE stacking; no single view's feature count dominates\"\n  - after_integration: \"Per-(factor,view) R2 balanced; drop factors \u003C1-2% R2 in ALL views; no single view dominates every factor\"\n  - after_validation: \"Held-out cohort (not in-cohort CV, biased at n\u003C\u003Cp); batch correlated with every factor; batch corrected ONCE\"\nsource: \"https:\u002F\u002Fgithub.com\u002FGPTomics\u002FbioSkills\"\nsource_repository: \"GPTomics\u002FbioSkills\"\nsource_path: \"workflows\u002Fmulti-omics-pipeline\u002FSKILL.md\"\nlicense: \"MIT\"\nimported_at: \"2026-09-20\"\n---\n\n## Version Compatibility\n\nReference examples tested with: MOFA2 1.12+, mixOmics 6.26+, SNFtool 2.3+, clusterProfiler 4.10+, ggplot2 3.5+\n\nBefore using code patterns, verify installed versions match. If versions differ:\n- R: `packageVersion('\u003Cpkg>')` then `?function_name` to verify parameters\n\nIf code throws ImportError, AttributeError, or TypeError, introspect the installed\npackage and adapt the example to match the actual API rather than retrying.\n\n# Multi-omics Integration Pipeline\n\n**\"Integrate my multi-omics datasets\"** -> Decide the strategy first, then orchestrate harmonization, the chosen integration method (MOFA2, mixOmics, or SNF), interpretation, and validation - because bulk multi-omics is small-n, huge-p, so an unvalidated integrated result is the default noise outcome.\n\nBefore any tool runs, settle the design with multi-omics-integration\u002Fintegration-design: confirm the data is vertical (different omics on the SAME samples, not the same features across cohorts), map the question to a method (shared factors -> MOFA2, predictive signature -> DIABLO, patient subtypes -> SNF), and plan a held-out cohort because in-cohort cross-validation at small n is optimistically biased. Inspect the per-view variance-explained table to confirm no single omic dominates the shared structure.\n\n## The governing principle\n\nBulk multi-omics is small-n, huge-p, so an UNVALIDATED integrated result is the DEFAULT noise outcome, not the exception. Every honesty decision is made at a seam before the integrator runs.\n\n1. **The sample-matching key must be VERTICAL, and joined on a stable primary key.** Vertical = different features, SAME samples (what this category is FOR); horizontal (same features, different cohorts) is meta-analysis\u002Fbatch, a different problem — conflating them is the deepest category error. The shared latent factor is indexed by SAMPLE, so establish the subject primary key ONCE and externalize it (MAE `sampleMap` \u002F consistent MuData `obs_names`); NEVER `cbind`\u002F`pd.concat` on assumed row order (silently mis-pairs subjects). Gene SYMBOLS are display labels, not join keys (MARCH1->MARCHF1, Excel corruption) — join on stable Ensembl IDs.\n2. **Each omic is normalized in its OWN space FIRST, then block variance is equalized BEFORE stacking.** A shared-latent integrator decomposes total variance and assumes each feature is ~continuous\u002FGaussian; the non-negotiable per-omic transforms (RNA-seq -> VST\u002FlogCPM never raw counts; methylation -> M-values; prot\u002Fmetab -> log2 + MNAR-aware; microbiome -> CLR) come first, then per-VIEW scaling (MOFA `scale_views=TRUE`) equalizes each block's CONTRIBUTION. Variance is additive across features, so a block with more features (850k CpGs vs 100 metabolites) casts more votes and hijacks the shared space regardless of biological importance. Both failures are silent.\n3. **No factor\u002Fsubtype\u002Fsignature is credible until it reproduces in a HELD-OUT cohort.** In-cohort CV at n\u003C\u003Cp is optimistically biased (tuning feature selection on the full data then reporting same-data CV inflates AUC by up to ~0.15); the gold standard is an external test set or fully nested CV. Spurious cross-omic correlation is the DEFAULT at p>>n. Batch is corrected ONCE, in ONE place (ComBat each omic AND modeling batch downstream removes it twice and over-shrinks real biology).\n\n**The single best honesty check:** if every shared factor is dominated by one view, the pipeline did not integrate — it re-discovered the biggest omic.\n\n## Made-once commitments\n\n| Commitment | Consequence inherited downstream |\n|------------|----------------------------------|\n| Correspondence axis (VERTICAL, not horizontal) | Whether the integrator's math has anything to align on; conflating the two is the deepest category error |\n| Sample primary key (externalized in MAE\u002FMuData) | Correct subject-to-assay linkage; cbind-on-row-order silently mis-pairs subjects |\n| Per-block normalization + per-view variance scaling | Whether the widest omic hijacks every factor; done before stacking, never after |\n| Validation plan (held-out cohort) | Whether any factor\u002Fsignature is credible; in-cohort CV at n\u003C\u003Cp is optimistically biased |\n\n## Pipeline Overview\n\n```\nRNA-seq Data ─────┐\n                  │\nProteomics Data ──┼──> Data Harmonization ──> Integration ──> Factors\u002FComponents\n                  │                                                    │\nMetabolomics ─────┘                                                    ▼\n                        ┌─────────────────────────────────────────────────────┐\n                        │           multi-omics-pipeline                      │\n                        ├─────────────────────────────────────────────────────┤\n                        │  1. Data Preprocessing per Modality                 │\n                        │  2. Sample Harmonization (matching samples)         │\n                        │  3. Feature Selection\u002FFiltering                     │\n                        │  4. Integration (MOFA2 \u002F mixOmics \u002F SNF)            │\n                        │  5. Factor\u002FComponent Interpretation                 │\n                        │  6. Downstream Analysis                             │\n                        └─────────────────────────────────────────────────────┘\n                                                                       │\n                                                                       ▼\n                              Integrated Factors + Biomarker Signatures\n```\n\n## Complete MOFA2 Workflow\n\n**Goal:** Discover unsupervised shared and view-specific factors across the harmonized omics, then interpret and validate them.\n\n**Approach:** Harmonize to common samples, feature-select per view, train MOFA2, read the per-view variance decomposition first, label factors against biological and technical covariates, and run enrichment on the signed weights.\n\n```r\nlibrary(MOFA2)\nlibrary(MOFAdata)\nlibrary(ggplot2)\nlibrary(tidyverse)\n\n# === 1. LOAD AND HARMONIZE DATA ===\n# RNA-seq data (samples x genes)\nrna \u003C- read.csv('rnaseq_normalized.csv', row.names = 1)\ncat('RNA:', nrow(rna), 'samples,', ncol(rna), 'genes\\n')\n\n# Proteomics data (samples x proteins)\nprotein \u003C- read.csv('proteomics_normalized.csv', row.names = 1)\ncat('Protein:', nrow(protein), 'samples,', ncol(protein), 'proteins\\n')\n\n# Metabolomics data (samples x metabolites)\nmetab \u003C- read.csv('metabolomics_normalized.csv', row.names = 1)\ncat('Metabolites:', nrow(metab), 'samples,', ncol(metab), 'metabolites\\n')\n\n# Find common samples\ncommon_samples \u003C- Reduce(intersect, list(rownames(rna), rownames(protein), rownames(metab)))\ncat('Common samples:', length(common_samples), '\\n')\n\n# Subset to common samples\nrna \u003C- rna[common_samples, ]\nprotein \u003C- protein[common_samples, ]\nmetab \u003C- metab[common_samples, ]\n\n# === 2. FEATURE SELECTION ===\n# Select most variable features per modality\nselect_variable \u003C- function(data, n = 2000) {\n    vars \u003C- apply(data, 2, var, na.rm = TRUE)\n    top_features \u003C- names(sort(vars, decreasing = TRUE))[1:min(n, ncol(data))]\n    data[, top_features]\n}\n\nrna_var \u003C- select_variable(rna, n = 2000)\nprotein_var \u003C- select_variable(protein, n = 1000)\nmetab_var \u003C- select_variable(metab, n = 500)\n\n# === 3. CREATE MOFA OBJECT ===\n# Prepare data as list of matrices (features x samples)\ndata_list \u003C- list(\n    RNA = t(as.matrix(rna_var)),\n    Protein = t(as.matrix(protein_var)),\n    Metabolome = t(as.matrix(metab_var))\n)\n\n# Create MOFA object\nmofa \u003C- create_mofa(data_list)\n\n# Add sample metadata (samples_metadata\u003C- requires a literal 'sample' column)\nsample_metadata \u003C- read.csv('sample_metadata.csv')\nrownames(sample_metadata) \u003C- sample_metadata$sample_id\nsample_metadata$sample \u003C- sample_metadata$sample_id\nsamples_metadata(mofa) \u003C- sample_metadata[common_samples, ]\n\n# === 4. CONFIGURE AND TRAIN MODEL ===\n# Data options\ndata_opts \u003C- get_default_data_options(mofa)\ndata_opts$scale_views \u003C- TRUE  # Scale each view\n\n# Model options\nmodel_opts \u003C- get_default_model_options(mofa)\nmodel_opts$num_factors \u003C- 15  # Number of factors to learn\n\n# Training options\ntrain_opts \u003C- get_default_training_options(mofa)\ntrain_opts$maxiter \u003C- 1000\ntrain_opts$convergence_mode \u003C- 'slow'\ntrain_opts$seed \u003C- 42\n\n# Prepare and train\nmofa \u003C- prepare_mofa(mofa, data_options = data_opts,\n                      model_options = model_opts,\n                      training_options = train_opts)\n\ncat('Training MOFA model...\\n')\nmofa \u003C- run_mofa(mofa, outfile = 'mofa_model.hdf5', use_basilisk = TRUE)\n\n# === 5. ANALYZE FACTORS ===\n# Variance explained per factor per view\nplot_variance_explained(mofa, max_r2 = 15)\nggsave('variance_explained.png', width = 10, height = 6)\n\n# Factor values\nfactor_values \u003C- get_factors(mofa)[[1]]\n\n# Correlate factors with biological AND technical covariates; a factor that tracks batch is a batch factor\ncorrelate_factors_with_covariates(mofa, covariates = c('condition', 'batch', 'depth'))\n\n# Factor plots\nplot_factor(mofa, factors = 1:4, color_by = 'condition', dot_size = 3)\nggsave('factor_scatter.png', width = 12, height = 10)\n\n# === 6. INTERPRET FACTORS ===\n# Get top weights per factor per view\nfor (f in 1:5) {\n    cat('\\nFactor', f, ':\\n')\n    weights \u003C- get_weights(mofa, factors = f, as.data.frame = TRUE)\n\n    for (view in unique(weights$view)) {\n        view_weights \u003C- weights[weights$view == view, ]\n        view_weights \u003C- view_weights[order(abs(view_weights$value), decreasing = TRUE), ]\n        cat('  ', view, ':', paste(head(view_weights$feature, 5), collapse = ', '), '\\n')\n    }\n}\n\n# Heatmap of top features per factor\nplot_top_weights(mofa, view = 'RNA', factors = 1:5, nfeatures = 10)\nggsave('top_weights_rna.png', width = 10, height = 8)\n\n# === 7. ENRICHMENT ANALYSIS ===\nlibrary(clusterProfiler)\nlibrary(org.Hs.eg.db)\n\n# Get RNA weights for factor 1\nrna_weights \u003C- get_weights(mofa, views = 'RNA', factors = 1)[[1]][, 1]\ntop_genes \u003C- names(sort(abs(rna_weights), decreasing = TRUE))[1:200]\n\n# GO enrichment -- use all RNA features as background (not the full genome)\nall_rna_genes \u003C- names(rna_weights)\nego \u003C- enrichGO(gene = top_genes,\n                universe = all_rna_genes,\n                OrgDb = org.Hs.eg.db,\n                keyType = 'SYMBOL',\n                ont = 'BP',\n                pvalueCutoff = 0.05)\nego \u003C- simplify(ego, cutoff = 0.7, by = 'p.adjust')\n\ndotplot(ego, showCategory = 15)\nggsave('factor1_enrichment.png', width = 8, height = 10)\n\n# === 8. DOWNSTREAM: SURVIVAL ANALYSIS ===\nlibrary(survival)\nlibrary(survminer)\n\n# Add factor values to metadata\nsurv_data \u003C- data.frame(\n    sample = rownames(factor_values),\n    factor1 = factor_values[, 1],\n    time = sample_metadata[rownames(factor_values), 'survival_time'],\n    status = sample_metadata[rownames(factor_values), 'survival_status']\n)\n\n# Median split\nsurv_data$factor1_group \u003C- ifelse(surv_data$factor1 > median(surv_data$factor1), 'High', 'Low')\n\n# Kaplan-Meier\nfit \u003C- survfit(Surv(time, status) ~ factor1_group, data = surv_data)\nggsurvplot(fit, data = surv_data, pval = TRUE, risk.table = TRUE)\nggsave('survival_factor1.png', width = 8, height = 8)\n\n# === 9. EXPORT RESULTS ===\n# Factor values\nwrite.csv(factor_values, 'mofa_factor_values.csv')\n\n# Weights\nall_weights \u003C- get_weights(mofa, as.data.frame = TRUE)\nwrite.csv(all_weights, 'mofa_weights.csv', row.names = FALSE)\n\ncat('\\nMOFA analysis complete!\\n')\n```\n\n## mixOmics DIABLO Workflow\n\n**Goal:** Build a supervised cross-omic signature that discriminates a known outcome, with an honest performance estimate.\n\n**Approach:** Set the design matrix from the goal, tune the component count then keepX inside cross-validation folds with balanced error rate, fit, and report performance from data not used in tuning.\n\n```r\nlibrary(mixOmics)\n\n# === 1. PREPARE DATA ===\n# Same preprocessing as above\nX \u003C- list(\n    RNA = as.matrix(rna_var),\n    Protein = as.matrix(protein_var),\n    Metabolome = as.matrix(metab_var)\n)\n\n# Outcome variable\nY \u003C- factor(sample_metadata[common_samples, 'condition'])\n\n# === 2. DESIGN MATRIX (the central DIABLO decision) ===\n# off-diagonal trades discrimination vs cross-block correlation: ~1 for a coherent network,\n# \u003C0.5 for prediction. 0.1 leans toward prediction and is tutorial convention, not a default.\ndesign \u003C- matrix(0.5, ncol = length(X), nrow = length(X),\n                 dimnames = list(names(X), names(X)))\ndiag(design) \u003C- 0\n\n# === 3. TUNE MODEL ===\n# Tune number of components\nperf.diablo \u003C- perf(block.splsda(X, Y, ncomp = 5, design = design),\n                    validation = 'Mfold', folds = 5, nrepeat = 10)\n\nncomp \u003C- perf.diablo$choice.ncomp$WeightedVote['Overall.BER', 'max.dist']\ncat('Optimal components:', ncomp, '\\n')\n\n# Tune number of variables per component\ntest.keepX \u003C- list(\n    RNA = c(10, 25, 50, 100),\n    Protein = c(5, 10, 25, 50),\n    Metabolome = c(5, 10, 25)\n)\n\ntune.diablo \u003C- tune.block.splsda(X, Y, ncomp = ncomp, test.keepX = test.keepX,\n                                  design = design, validation = 'Mfold', folds = 5)\n\noptimal.keepX \u003C- tune.diablo$choice.keepX\n\n# === 4. FINAL MODEL ===\ndiablo.model \u003C- block.splsda(X, Y, ncomp = ncomp,\n                              keepX = optimal.keepX, design = design)\n\n# === 5. VISUALIZATION ===\n# Sample plot\nplotIndiv(diablo.model, ind.names = FALSE, legend = TRUE, title = 'DIABLO Sample Plot')\n\n# Variable plot\nplotVar(diablo.model, var.names = FALSE, style = 'graphics', legend = TRUE)\n\n# Circos plot\ncircosPlot(diablo.model, cutoff = 0.7, line = TRUE,\n           color.blocks = c('darkorchid', 'brown1', 'lightgreen'))\n\n# Heatmap\ncimDiablo(diablo.model, color.blocks = c('darkorchid', 'brown1', 'lightgreen'),\n          margins = c(10, 5))\n\n# === 6. PERFORMANCE (report from data not used to tune; an external test set is the honest estimate) ===\nperf.final \u003C- perf(diablo.model, validation = 'Mfold', folds = 5, nrepeat = 10)\nperf.final$WeightedVote.error.rate   # matrix: classes + Overall.BER by component\n\n# ROC curves\nauc.diablo \u003C- auroc(diablo.model, roc.block = 'RNA', roc.comp = 1)\n```\n\n## Similarity Network Fusion (SNF)\n\n**Goal:** Stratify patients into candidate subtypes from the fused multi-omic similarity network.\n\n**Approach:** Standardize each omic, build local-scaled affinity networks, fuse by cross-diffusion, estimate a plausible cluster number, and defend it with a fused-versus-single-omic concordance check before claiming subtypes.\n\n```r\nlibrary(SNFtool)\n\n# === 1. CREATE SIMILARITY MATRICES ===\nK \u003C- 20       # neighbors for the local kernel bandwidth (10-30)\nsigma \u003C- 0.5  # affinityMatrix width (the arg is sigma, not alpha); 0.3-0.8\n\n# standardize per feature, then squared-Euclidean -> root -> local-scaled kernel\nviews \u003C- lapply(list(rna_var, protein_var, metab_var), function(x) standardNormalization(as.matrix(x)))\naffinities \u003C- lapply(views, function(x) affinityMatrix(dist2(x, x)^(1\u002F2), K, sigma))   # dist2 returns SQUARED distance\n\n# === 2. FUSE NETWORKS ===\nW \u003C- SNF(affinities, K, t = 20)\n\n# === 3. CLUSTER ON FUSED NETWORK (defend the count, do not assume it) ===\nestimateNumberOfClustersGivenGraph(W, NUMC = 2:8)   # four eigengap\u002Frotation estimates - plausibility, not truth\nclusters \u003C- spectralClustering(W, K = 3)            # here K is the CLUSTER COUNT\nconcordanceNetworkNMI(c(affinities, list(W)), 3)    # did fusion beat the best single omic? (Rappoport and Shamir 2018)\n\n# === 4. VISUALIZATION ===\n# Plot fused network\ndisplayClustersWithHeatmap(W, clusters)\n```\n\n## QC Checkpoints\n\n| Stage | Check | Action if Failed |\n|-------|-------|------------------|\n| Sample matching | >80% samples shared | Check sample IDs |\n| Missing values | \u003C20% per modality | Impute or remove |\n| Feature variance | Features vary | Filter low variance |\n| Model convergence | ELBO plateau | Increase iterations |\n| Factor variance | drop factors below ~1-2% in all views | set drop_factor_threshold; keep fewer factors |\n| Variance imbalance | no single view dominates every factor | per-view scaling or filter the wider view harder |\n| Validation | held-out cohort, not in-cohort CV | replicate before claiming a biomarker\u002Fsubtype |\n\n## Workflow Variants\n\n### With Missing Samples\n```r\n# MOFA2 handles missing views gracefully; create_mofa_from_df wants one row per (sample, feature, value)\nto_long \u003C- function(mat, view) {\n    df \u003C- as.data.frame(as.table(as.matrix(mat)))   # samples x features -> Var1=sample, Var2=feature, Freq=value (alignment preserved)\n    data.frame(sample = as.character(df$Var1), feature = as.character(df$Var2), view = view, value = df$Freq)\n}\ndata_long \u003C- rbind(to_long(rna, 'RNA'), to_long(protein, 'Protein'))\nmofa \u003C- create_mofa_from_df(data_long)\n```\n\n### Single-cell Multi-omics\nSingle-cell multimodal data (CITE-seq, 10x Multiome) is a different paradigm - per-cell generative models with abundant observations rather than the bulk small-n regime. Route it to single-cell\u002Fmultimodal-integration rather than applying this bulk pipeline.\n\n## Common Errors\n\n| Symptom | Cause | Fix |\n|---------|-------|-----|\n| Integrated result on mislabeled subjects (both axes have plausible lengths) | `cbind`\u002F`pd.concat` on assumed sample order | Enforce sample linkage via a container (MAE `sampleMap` \u002F MuData `intersect_obs`); assert shape after every cross-language hop |\n| One view dominates every factor | Block scale\u002Ffeature-count imbalance (850k CpGs vs 100 metabolites) | Per-VIEW scaling (`scale_views=TRUE`), NOT per-feature; filter larger views harder; check per-(factor,view) R2 |\n| A near-constant noise feature blown up to variance 1 | Per-feature scaling (`scale=TRUE` in mixOmics) | Aggressive low-variance filtering BEFORE scaling; prefer per-view scaling |\n| A \"biological\" factor that is really batch | Technical variance not regressed out | Correlate every factor with technical covariates (run date, plate, site); exclude a factor tracking batch more than biology |\n| AUC inflated by up to ~0.15 | In-cohort CV with feature selection outside the folds | CV must WRAP selection (nested); gold standard is an external test set (`predict()`\u002F`auroc()`) |\n| Batch removed twice, real biology over-shrunk | ComBat each omic AND batch in the downstream model | Correct batch ONCE: pre-correct and do not re-enter, OR leave raw and model batch as a covariate |\n| Transposed matrices make every gene a \"sample\" | Bioconductor (samples=cols) vs mixOmics\u002FMOFA (samples=rows) mismatch | Transpose deliberately + assert shape on every cross-package hop |\n\n## References\n\n- Argelaguet R, Velten B, Arnol D, et al (2018) Multi-Omics Factor Analysis - a framework for unsupervised integration of multi-omics data sets. *Molecular Systems Biology* 14:e8124. DOI 10.15252\u002Fmsb.20178124. (MOFA.)\n- Rohart F, Gautier B, Singh A, Le Cao KA (2017) mixOmics: an R package for 'omics feature selection and multiple data integration. *PLoS Computational Biology* 13:e1005752. DOI 10.1371\u002Fjournal.pcbi.1005752.\n- Singh A, Shannon CP, Gautier B, et al (2019) DIABLO: an integrative approach for identifying key molecular drivers from multi-omics assays. *Bioinformatics* 35:3055-3062. DOI 10.1093\u002Fbioinformatics\u002Fbty1054.\n- Wang B, Mezlini AM, Demir F, et al (2014) Similarity network fusion for aggregating data types on a genomic scale. *Nature Methods* 11:333-337. DOI 10.1038\u002Fnmeth.2810. (SNF.)\n- Rappoport N, Shamir R (2018) Multi-omic and multi-view clustering algorithms: review and cancer benchmark. *Nucleic Acids Research* 46:10546-10562. DOI 10.1093\u002Fnar\u002Fgky889. (integration is not automatically better than the best single omic.)\n- Nygaard V, Rodland EA, Hovig E (2016) Methods that remove batch effects while retaining group differences may lead to exaggerated confidence in downstream analyses. *Biostatistics* 17:29-39. DOI 10.1093\u002Fbiostatistics\u002Fkxv027.\n\n## Related Skills\n\n- multi-omics-integration\u002Fintegration-design - Method selection, correspondence, and the n\u003C\u003Cp discipline (decide first)\n- multi-omics-integration\u002Fmofa-integration - MOFA2 unsupervised factor analysis\n- multi-omics-integration\u002Fmixomics-analysis - mixOmics DIABLO\u002FsPLS\u002FMINT methods\n- multi-omics-integration\u002Fsimilarity-network - SNF patient stratification\n- multi-omics-integration\u002Fdata-harmonization - Cross-omic preprocessing and scaling\n- pathway-analysis\u002Fgo-enrichment - Factor\u002Fsignature interpretation\n- differential-expression\u002Fbatch-correction - Batch effects\n- clinical-biostatistics\u002Fsurvival-analysis - Survival validation of factors and subtypes\n- single-cell\u002Fmultimodal-integration - Single-cell multimodal integration (different paradigm)\n","## Version Compatibility\n\nReference examples tested with: MOFA2 1.12+, mixOmics 6.26+, SNFtool 2.3+, clusterProfiler 4.10+, ggplot2 3.5+\n\nBefore using code patterns, verify installed versions match. If versions differ:\n- R: `packageVersion('\u003Cpkg>')` then `?function_name` to verify parameters\n\nIf code throws ImportError, AttributeError, or TypeError, introspect the installed\npackage and adapt the example to match the actual API rather than retrying.\n\n# Multi-omics Integration Pipeline\n\n**\"Integrate my multi-omics datasets\"** -> Decide the strategy first, then orchestrate harmonization, the chosen integration method (MOFA2, mixOmics, or SNF), interpretation, and validation - because bulk multi-omics is small-n, huge-p, so an unvalidated integrated result is the default noise outcome.\n\nBefore any tool runs, settle the design with multi-omics-integration\u002Fintegration-design: confirm the data is vertical (different omics on the SAME samples, not the same features across cohorts), map the question to a method (shared factors -> MOFA2, predictive signature -> DIABLO, patient subtypes -> SNF), and plan a held-out cohort because in-cohort cross-validation at small n is optimistically biased. Inspect the per-view variance-explained table to confirm no single omic dominates the shared structure.\n\n## The governing principle\n\nBulk multi-omics is small-n, huge-p, so an UNVALIDATED integrated result is the DEFAULT noise outcome, not the exception. Every honesty decision is made at a seam before the integrator runs.\n\n1. **The sample-matching key must be VERTICAL, and joined on a stable primary key.** Vertical = different features, SAME samples (what this category is FOR); horizontal (same features, different cohorts) is meta-analysis\u002Fbatch, a different problem — conflating them is the deepest category error. The shared latent factor is indexed by SAMPLE, so establish the subject primary key ONCE and externalize it (MAE `sampleMap` \u002F consistent MuData `obs_names`); NEVER `cbind`\u002F`pd.concat` on assumed row order (silently mis-pairs subjects). Gene SYMBOLS are display labels, not join keys (MARCH1->MARCHF1, Excel corruption) — join on stable Ensembl IDs.\n2. **Each omic is normalized in its OWN space FIRST, then block variance is equalized BEFORE stacking.** A shared-latent integrator decomposes total variance and assumes each feature is ~continuous\u002FGaussian; the non-negotiable per-omic transforms (RNA-seq -> VST\u002FlogCPM never raw counts; methylation -> M-values; prot\u002Fmetab -> log2 + MNAR-aware; microbiome -> CLR) come first, then per-VIEW scaling (MOFA `scale_views=TRUE`) equalizes each block's CONTRIBUTION. Variance is additive across features, so a block with more features (850k CpGs vs 100 metabolites) casts more votes and hijacks the shared space regardless of biological importance. Both failures are silent.\n3. **No factor\u002Fsubtype\u002Fsignature is credible until it reproduces in a HELD-OUT cohort.** In-cohort CV at n\u003C\u003Cp is optimistically biased (tuning feature selection on the full data then reporting same-data CV inflates AUC by up to ~0.15); the gold standard is an external test set or fully nested CV. Spurious cross-omic correlation is the DEFAULT at p>>n. Batch is corrected ONCE, in ONE place (ComBat each omic AND modeling batch downstream removes it twice and over-shrinks real biology).\n\n**The single best honesty check:** if every shared factor is dominated by one view, the pipeline did not integrate — it re-discovered the biggest omic.\n\n## Made-once commitments\n\n| Commitment | Consequence inherited downstream |\n|------------|----------------------------------|\n| Correspondence axis (VERTICAL, not horizontal) | Whether the integrator's math has anything to align on; conflating the two is the deepest category error |\n| Sample primary key (externalized in MAE\u002FMuData) | Correct subject-to-assay linkage; cbind-on-row-order silently mis-pairs subjects |\n| Per-block normalization + per-view variance scaling | Whether the widest omic hijacks every factor; done before stacking, never after |\n| Validation plan (held-out cohort) | Whether any factor\u002Fsignature is credible; in-cohort CV at n\u003C\u003Cp is optimistically biased |\n\n## Pipeline Overview\n\n```\nRNA-seq Data ─────┐\n                  │\nProteomics Data ──┼──> Data Harmonization ──> Integration ──> Factors\u002FComponents\n                  │                                                    │\nMetabolomics ─────┘                                                    ▼\n                        ┌─────────────────────────────────────────────────────┐\n                        │           multi-omics-pipeline                      │\n                        ├─────────────────────────────────────────────────────┤\n                        │  1. Data Preprocessing per Modality                 │\n                        │  2. Sample Harmonization (matching samples)         │\n                        │  3. Feature Selection\u002FFiltering                     │\n                        │  4. Integration (MOFA2 \u002F mixOmics \u002F SNF)            │\n                        │  5. Factor\u002FComponent Interpretation                 │\n                        │  6. Downstream Analysis                             │\n                        └─────────────────────────────────────────────────────┘\n                                                                       │\n                                                                       ▼\n                              Integrated Factors + Biomarker Signatures\n```\n\n## Complete MOFA2 Workflow\n\n**Goal:** Discover unsupervised shared and view-specific factors across the harmonized omics, then interpret and validate them.\n\n**Approach:** Harmonize to common samples, feature-select per view, train MOFA2, read the per-view variance decomposition first, label factors against biological and technical covariates, and run enrichment on the signed weights.\n\n```r\nlibrary(MOFA2)\nlibrary(MOFAdata)\nlibrary(ggplot2)\nlibrary(tidyverse)\n\n# === 1. LOAD AND HARMONIZE DATA ===\n# RNA-seq data (samples x genes)\nrna \u003C- read.csv('rnaseq_normalized.csv', row.names = 1)\ncat('RNA:', nrow(rna), 'samples,', ncol(rna), 'genes\\n')\n\n# Proteomics data (samples x proteins)\nprotein \u003C- read.csv('proteomics_normalized.csv', row.names = 1)\ncat('Protein:', nrow(protein), 'samples,', ncol(protein), 'proteins\\n')\n\n# Metabolomics data (samples x metabolites)\nmetab \u003C- read.csv('metabolomics_normalized.csv', row.names = 1)\ncat('Metabolites:', nrow(metab), 'samples,', ncol(metab), 'metabolites\\n')\n\n# Find common samples\ncommon_samples \u003C- Reduce(intersect, list(rownames(rna), rownames(protein), rownames(metab)))\ncat('Common samples:', length(common_samples), '\\n')\n\n# Subset to common samples\nrna \u003C- rna[common_samples, ]\nprotein \u003C- protein[common_samples, ]\nmetab \u003C- metab[common_samples, ]\n\n# === 2. FEATURE SELECTION ===\n# Select most variable features per modality\nselect_variable \u003C- function(data, n = 2000) {\n    vars \u003C- apply(data, 2, var, na.rm = TRUE)\n    top_features \u003C- names(sort(vars, decreasing = TRUE))[1:min(n, ncol(data))]\n    data[, top_features]\n}\n\nrna_var \u003C- select_variable(rna, n = 2000)\nprotein_var \u003C- select_variable(protein, n = 1000)\nmetab_var \u003C- select_variable(metab, n = 500)\n\n# === 3. CREATE MOFA OBJECT ===\n# Prepare data as list of matrices (features x samples)\ndata_list \u003C- list(\n    RNA = t(as.matrix(rna_var)),\n    Protein = t(as.matrix(protein_var)),\n    Metabolome = t(as.matrix(metab_var))\n)\n\n# Create MOFA object\nmofa \u003C- create_mofa(data_list)\n\n# Add sample metadata (samples_metadata\u003C- requires a literal 'sample' column)\nsample_metadata \u003C- read.csv('sample_metadata.csv')\nrownames(sample_metadata) \u003C- sample_metadata$sample_id\nsample_metadata$sample \u003C- sample_metadata$sample_id\nsamples_metadata(mofa) \u003C- sample_metadata[common_samples, ]\n\n# === 4. CONFIGURE AND TRAIN MODEL ===\n# Data options\ndata_opts \u003C- get_default_data_options(mofa)\ndata_opts$scale_views \u003C- TRUE  # Scale each view\n\n# Model options\nmodel_opts \u003C- get_default_model_options(mofa)\nmodel_opts$num_factors \u003C- 15  # Number of factors to learn\n\n# Training options\ntrain_opts \u003C- get_default_training_options(mofa)\ntrain_opts$maxiter \u003C- 1000\ntrain_opts$convergence_mode \u003C- 'slow'\ntrain_opts$seed \u003C- 42\n\n# Prepare and train\nmofa \u003C- prepare_mofa(mofa, data_options = data_opts,\n                      model_options = model_opts,\n                      training_options = train_opts)\n\ncat('Training MOFA model...\\n')\nmofa \u003C- run_mofa(mofa, outfile = 'mofa_model.hdf5', use_basilisk = TRUE)\n\n# === 5. ANALYZE FACTORS ===\n# Variance explained per factor per view\nplot_variance_explained(mofa, max_r2 = 15)\nggsave('variance_explained.png', width = 10, height = 6)\n\n# Factor values\nfactor_values \u003C- get_factors(mofa)[[1]]\n\n# Correlate factors with biological AND technical covariates; a factor that tracks batch is a batch factor\ncorrelate_factors_with_covariates(mofa, covariates = c('condition', 'batch', 'depth'))\n\n# Factor plots\nplot_factor(mofa, factors = 1:4, color_by = 'condition', dot_size = 3)\nggsave('factor_scatter.png', width = 12, height = 10)\n\n# === 6. INTERPRET FACTORS ===\n# Get top weights per factor per view\nfor (f in 1:5) {\n    cat('\\nFactor', f, ':\\n')\n    weights \u003C- get_weights(mofa, factors = f, as.data.frame = TRUE)\n\n    for (view in unique(weights$view)) {\n        view_weights \u003C- weights[weights$view == view, ]\n        view_weights \u003C- view_weights[order(abs(view_weights$value), decreasing = TRUE), ]\n        cat('  ', view, ':', paste(head(view_weights$feature, 5), collapse = ', '), '\\n')\n    }\n}\n\n# Heatmap of top features per factor\nplot_top_weights(mofa, view = 'RNA', factors = 1:5, nfeatures = 10)\nggsave('top_weights_rna.png', width = 10, height = 8)\n\n# === 7. ENRICHMENT ANALYSIS ===\nlibrary(clusterProfiler)\nlibrary(org.Hs.eg.db)\n\n# Get RNA weights for factor 1\nrna_weights \u003C- get_weights(mofa, views = 'RNA', factors = 1)[[1]][, 1]\ntop_genes \u003C- names(sort(abs(rna_weights), decreasing = TRUE))[1:200]\n\n# GO enrichment -- use all RNA features as background (not the full genome)\nall_rna_genes \u003C- names(rna_weights)\nego \u003C- enrichGO(gene = top_genes,\n                universe = all_rna_genes,\n                OrgDb = org.Hs.eg.db,\n                keyType = 'SYMBOL',\n                ont = 'BP',\n                pvalueCutoff = 0.05)\nego \u003C- simplify(ego, cutoff = 0.7, by = 'p.adjust')\n\ndotplot(ego, showCategory = 15)\nggsave('factor1_enrichment.png', width = 8, height = 10)\n\n# === 8. DOWNSTREAM: SURVIVAL ANALYSIS ===\nlibrary(survival)\nlibrary(survminer)\n\n# Add factor values to metadata\nsurv_data \u003C- data.frame(\n    sample = rownames(factor_values),\n    factor1 = factor_values[, 1],\n    time = sample_metadata[rownames(factor_values), 'survival_time'],\n    status = sample_metadata[rownames(factor_values), 'survival_status']\n)\n\n# Median split\nsurv_data$factor1_group \u003C- ifelse(surv_data$factor1 > median(surv_data$factor1), 'High', 'Low')\n\n# Kaplan-Meier\nfit \u003C- survfit(Surv(time, status) ~ factor1_group, data = surv_data)\nggsurvplot(fit, data = surv_data, pval = TRUE, risk.table = TRUE)\nggsave('survival_factor1.png', width = 8, height = 8)\n\n# === 9. EXPORT RESULTS ===\n# Factor values\nwrite.csv(factor_values, 'mofa_factor_values.csv')\n\n# Weights\nall_weights \u003C- get_weights(mofa, as.data.frame = TRUE)\nwrite.csv(all_weights, 'mofa_weights.csv', row.names = FALSE)\n\ncat('\\nMOFA analysis complete!\\n')\n```\n\n## mixOmics DIABLO Workflow\n\n**Goal:** Build a supervised cross-omic signature that discriminates a known outcome, with an honest performance estimate.\n\n**Approach:** Set the design matrix from the goal, tune the component count then keepX inside cross-validation folds with balanced error rate, fit, and report performance from data not used in tuning.\n\n```r\nlibrary(mixOmics)\n\n# === 1. PREPARE DATA ===\n# Same preprocessing as above\nX \u003C- list(\n    RNA = as.matrix(rna_var),\n    Protein = as.matrix(protein_var),\n    Metabolome = as.matrix(metab_var)\n)\n\n# Outcome variable\nY \u003C- factor(sample_metadata[common_samples, 'condition'])\n\n# === 2. DESIGN MATRIX (the central DIABLO decision) ===\n# off-diagonal trades discrimination vs cross-block correlation: ~1 for a coherent network,\n# \u003C0.5 for prediction. 0.1 leans toward prediction and is tutorial convention, not a default.\ndesign \u003C- matrix(0.5, ncol = length(X), nrow = length(X),\n                 dimnames = list(names(X), names(X)))\ndiag(design) \u003C- 0\n\n# === 3. TUNE MODEL ===\n# Tune number of components\nperf.diablo \u003C- perf(block.splsda(X, Y, ncomp = 5, design = design),\n                    validation = 'Mfold', folds = 5, nrepeat = 10)\n\nncomp \u003C- perf.diablo$choice.ncomp$WeightedVote['Overall.BER', 'max.dist']\ncat('Optimal components:', ncomp, '\\n')\n\n# Tune number of variables per component\ntest.keepX \u003C- list(\n    RNA = c(10, 25, 50, 100),\n    Protein = c(5, 10, 25, 50),\n    Metabolome = c(5, 10, 25)\n)\n\ntune.diablo \u003C- tune.block.splsda(X, Y, ncomp = ncomp, test.keepX = test.keepX,\n                                  design = design, validation = 'Mfold', folds = 5)\n\noptimal.keepX \u003C- tune.diablo$choice.keepX\n\n# === 4. FINAL MODEL ===\ndiablo.model \u003C- block.splsda(X, Y, ncomp = ncomp,\n                              keepX = optimal.keepX, design = design)\n\n# === 5. VISUALIZATION ===\n# Sample plot\nplotIndiv(diablo.model, ind.names = FALSE, legend = TRUE, title = 'DIABLO Sample Plot')\n\n# Variable plot\nplotVar(diablo.model, var.names = FALSE, style = 'graphics', legend = TRUE)\n\n# Circos plot\ncircosPlot(diablo.model, cutoff = 0.7, line = TRUE,\n           color.blocks = c('darkorchid', 'brown1', 'lightgreen'))\n\n# Heatmap\ncimDiablo(diablo.model, color.blocks = c('darkorchid', 'brown1', 'lightgreen'),\n          margins = c(10, 5))\n\n# === 6. PERFORMANCE (report from data not used to tune; an external test set is the honest estimate) ===\nperf.final \u003C- perf(diablo.model, validation = 'Mfold', folds = 5, nrepeat = 10)\nperf.final$WeightedVote.error.rate   # matrix: classes + Overall.BER by component\n\n# ROC curves\nauc.diablo \u003C- auroc(diablo.model, roc.block = 'RNA', roc.comp = 1)\n```\n\n## Similarity Network Fusion (SNF)\n\n**Goal:** Stratify patients into candidate subtypes from the fused multi-omic similarity network.\n\n**Approach:** Standardize each omic, build local-scaled affinity networks, fuse by cross-diffusion, estimate a plausible cluster number, and defend it with a fused-versus-single-omic concordance check before claiming subtypes.\n\n```r\nlibrary(SNFtool)\n\n# === 1. CREATE SIMILARITY MATRICES ===\nK \u003C- 20       # neighbors for the local kernel bandwidth (10-30)\nsigma \u003C- 0.5  # affinityMatrix width (the arg is sigma, not alpha); 0.3-0.8\n\n# standardize per feature, then squared-Euclidean -> root -> local-scaled kernel\nviews \u003C- lapply(list(rna_var, protein_var, metab_var), function(x) standardNormalization(as.matrix(x)))\naffinities \u003C- lapply(views, function(x) affinityMatrix(dist2(x, x)^(1\u002F2), K, sigma))   # dist2 returns SQUARED distance\n\n# === 2. FUSE NETWORKS ===\nW \u003C- SNF(affinities, K, t = 20)\n\n# === 3. CLUSTER ON FUSED NETWORK (defend the count, do not assume it) ===\nestimateNumberOfClustersGivenGraph(W, NUMC = 2:8)   # four eigengap\u002Frotation estimates - plausibility, not truth\nclusters \u003C- spectralClustering(W, K = 3)            # here K is the CLUSTER COUNT\nconcordanceNetworkNMI(c(affinities, list(W)), 3)    # did fusion beat the best single omic? (Rappoport and Shamir 2018)\n\n# === 4. VISUALIZATION ===\n# Plot fused network\ndisplayClustersWithHeatmap(W, clusters)\n```\n\n## QC Checkpoints\n\n| Stage | Check | Action if Failed |\n|-------|-------|------------------|\n| Sample matching | >80% samples shared | Check sample IDs |\n| Missing values | \u003C20% per modality | Impute or remove |\n| Feature variance | Features vary | Filter low variance |\n| Model convergence | ELBO plateau | Increase iterations |\n| Factor variance | drop factors below ~1-2% in all views | set drop_factor_threshold; keep fewer factors |\n| Variance imbalance | no single view dominates every factor | per-view scaling or filter the wider view harder |\n| Validation | held-out cohort, not in-cohort CV | replicate before claiming a biomarker\u002Fsubtype |\n\n## Workflow Variants\n\n### With Missing Samples\n```r\n# MOFA2 handles missing views gracefully; create_mofa_from_df wants one row per (sample, feature, value)\nto_long \u003C- function(mat, view) {\n    df \u003C- as.data.frame(as.table(as.matrix(mat)))   # samples x features -> Var1=sample, Var2=feature, Freq=value (alignment preserved)\n    data.frame(sample = as.character(df$Var1), feature = as.character(df$Var2), view = view, value = df$Freq)\n}\ndata_long \u003C- rbind(to_long(rna, 'RNA'), to_long(protein, 'Protein'))\nmofa \u003C- create_mofa_from_df(data_long)\n```\n\n### Single-cell Multi-omics\nSingle-cell multimodal data (CITE-seq, 10x Multiome) is a different paradigm - per-cell generative models with abundant observations rather than the bulk small-n regime. Route it to single-cell\u002Fmultimodal-integration rather than applying this bulk pipeline.\n\n## Common Errors\n\n| Symptom | Cause | Fix |\n|---------|-------|-----|\n| Integrated result on mislabeled subjects (both axes have plausible lengths) | `cbind`\u002F`pd.concat` on assumed sample order | Enforce sample linkage via a container (MAE `sampleMap` \u002F MuData `intersect_obs`); assert shape after every cross-language hop |\n| One view dominates every factor | Block scale\u002Ffeature-count imbalance (850k CpGs vs 100 metabolites) | Per-VIEW scaling (`scale_views=TRUE`), NOT per-feature; filter larger views harder; check per-(factor,view) R2 |\n| A near-constant noise feature blown up to variance 1 | Per-feature scaling (`scale=TRUE` in mixOmics) | Aggressive low-variance filtering BEFORE scaling; prefer per-view scaling |\n| A \"biological\" factor that is really batch | Technical variance not regressed out | Correlate every factor with technical covariates (run date, plate, site); exclude a factor tracking batch more than biology |\n| AUC inflated by up to ~0.15 | In-cohort CV with feature selection outside the folds | CV must WRAP selection (nested); gold standard is an external test set (`predict()`\u002F`auroc()`) |\n| Batch removed twice, real biology over-shrunk | ComBat each omic AND batch in the downstream model | Correct batch ONCE: pre-correct and do not re-enter, OR leave raw and model batch as a covariate |\n| Transposed matrices make every gene a \"sample\" | Bioconductor (samples=cols) vs mixOmics\u002FMOFA (samples=rows) mismatch | Transpose deliberately + assert shape on every cross-package hop |\n\n## References\n\n- Argelaguet R, Velten B, Arnol D, et al (2018) Multi-Omics Factor Analysis - a framework for unsupervised integration of multi-omics data sets. *Molecular Systems Biology* 14:e8124. DOI 10.15252\u002Fmsb.20178124. (MOFA.)\n- Rohart F, Gautier B, Singh A, Le Cao KA (2017) mixOmics: an R package for 'omics feature selection and multiple data integration. *PLoS Computational Biology* 13:e1005752. DOI 10.1371\u002Fjournal.pcbi.1005752.\n- Singh A, Shannon CP, Gautier B, et al (2019) DIABLO: an integrative approach for identifying key molecular drivers from multi-omics assays. *Bioinformatics* 35:3055-3062. DOI 10.1093\u002Fbioinformatics\u002Fbty1054.\n- Wang B, Mezlini AM, Demir F, et al (2014) Similarity network fusion for aggregating data types on a genomic scale. *Nature Methods* 11:333-337. DOI 10.1038\u002Fnmeth.2810. (SNF.)\n- Rappoport N, Shamir R (2018) Multi-omic and multi-view clustering algorithms: review and cancer benchmark. *Nucleic Acids Research* 46:10546-10562. DOI 10.1093\u002Fnar\u002Fgky889. (integration is not automatically better than the best single omic.)\n- Nygaard V, Rodland EA, Hovig E (2016) Methods that remove batch effects while retaining group differences may lead to exaggerated confidence in downstream analyses. *Biostatistics* 17:29-39. DOI 10.1093\u002Fbiostatistics\u002Fkxv027.\n\n## Related Skills\n\n- multi-omics-integration\u002Fintegration-design - Method selection, correspondence, and the n\u003C\u003Cp discipline (decide first)\n- multi-omics-integration\u002Fmofa-integration - MOFA2 unsupervised factor analysis\n- multi-omics-integration\u002Fmixomics-analysis - mixOmics DIABLO\u002FsPLS\u002FMINT methods\n- multi-omics-integration\u002Fsimilarity-network - SNF patient stratification\n- multi-omics-integration\u002Fdata-harmonization - Cross-omic preprocessing and scaling\n- pathway-analysis\u002Fgo-enrichment - Factor\u002Fsignature interpretation\n- differential-expression\u002Fbatch-correction - Batch effects\n- clinical-biostatistics\u002Fsurvival-analysis - Survival validation of factors and subtypes\n- single-cell\u002Fmultimodal-integration - Single-cell multimodal integration (different paradigm)\n",{"name":5,"source":24,"license":15,"workflow":25,"tool_type":26,"depends_on":27,"description":7,"imported_at":33,"source_path":34,"primary_tool":35,"qc_checkpoints":36,"source_repository":47},"https:\u002F\u002Fgithub.com\u002FGPTomics\u002FbioSkills",true,"r",[28,29,30,31,32],"multi-omics-integration\u002Fintegration-design","multi-omics-integration\u002Fdata-harmonization","multi-omics-integration\u002Fmofa-integration","multi-omics-integration\u002Fmixomics-analysis","multi-omics-integration\u002Fsimilarity-network","2026-09-20","workflows\u002Fmulti-omics-pipeline\u002FSKILL.md","MOFA2",[37,39,41,43,45],{"after_harmonization":38},"Sample overlap >80% across blocks; join on a stable primary key (MAE sampleMap \u002F MuData obs), never cbind on row order",{"after_per_block_norm":40},"Each omic normalized in its OWN space (VST\u002FM-values\u002Flog2+MNAR\u002FCLR); missingness per modality \u003C20%",{"after_scaling":42},"Per-VIEW variance equalized (scale_views) BEFORE stacking; no single view's feature count dominates",{"after_integration":44},"Per-(factor,view) R2 balanced; drop factors \u003C1-2% R2 in ALL views; no single view dominates every factor",{"after_validation":46},"Held-out cohort (not in-cohort CV, biased at n\u003C\u003Cp); batch correlated with every factor; batch corrected ONCE","GPTomics\u002FbioSkills","main","2d1750717747097b602acf30bd09a7cbd4b4c6ea","awesome_skills\u002Fbiology\u002Fbio-workflows-multi-omics-pipeline","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous","2026-11-09 11:45:36",{"source":8,"skillName":5,"commands":55,"prompt":65,"zipAvailable":25},[56,59,62],{"tool":57,"command":58},"npx","npx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill bio-workflows-multi-omics-pipeline",{"tool":60,"command":61},"bunx","bunx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill bio-workflows-multi-omics-pipeline",{"tool":63,"command":64},"pnpm","pnpm dlx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill bio-workflows-multi-omics-pipeline","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-workflows-multi-omics-pipeline\u002FSKILL.md",[67,73],{"path":68,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":71,"sourceHtmlUrl":72},"examples\u002Fmofa_integration.R","OTHER","其他",2954,"https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-workflows-multi-omics-pipeline\u002Fexamples\u002Fmofa_integration.R",{"path":74,"resourceType":75,"resourceTypeDesc":76,"sizeBytes":77,"sourceHtmlUrl":78},"usage-guide.md","REFERENCE","参考文档",5844,"https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-workflows-multi-omics-pipeline\u002Fusage-guide.md",[80,88,95,102,109,116],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":87},"01M7FFFZPC2025JQQHPHDX154J","dei-assessment","Assess diversity, equity, and inclusion with metrics. TRIGGERS - Use when user needs help with dei-assessment related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fdei-assessment\u002FSKILL.md",[],[],"2026-11-16 10:05:34",{"skillNo":89,"name":90,"nameZh":6,"description":91,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":92,"categories":93,"keywords":94,"publishedAt":87},"01M7FFFWN8H4WA7A6Y398QKB6J","dei-action-plan","Create DEI action plans with goals and initiatives. TRIGGERS - Use when user needs help with dei-action-plan related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fdei-action-plan\u002FSKILL.md",[],[],{"skillNo":96,"name":97,"nameZh":6,"description":98,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":99,"categories":100,"keywords":101,"publishedAt":87},"01M7FFFSHTM0QZRVZ2NRJTJ0PY","culture-fit-assessment","Design culture add assessment processes. TRIGGERS - Use when user needs help with culture-fit-assessment related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fculture-fit-assessment\u002FSKILL.md",[],[],{"skillNo":103,"name":104,"nameZh":6,"description":105,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":106,"categories":107,"keywords":108,"publishedAt":87},"01M7FFFMA12RKEQA38KHJSXXPS","cowork-to-code-bridge","Use an already-installed, independently verified cowork-to-code bridge to run narrowly approved actions on the user's own macOS, Linux, or WSL2 machine through a local file queue.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fcowork-to-code-bridge\u002FSKILL.md",[],[],{"skillNo":110,"name":111,"nameZh":6,"description":112,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":113,"categories":114,"keywords":115,"publishedAt":87},"01M7FFFH1F6M8YRGW5V487GH1K","counter-offer-response","Draft counter-offer responses for retention. TRIGGERS - Use when user needs help with counter-offer-response related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fcounter-offer-response\u002FSKILL.md",[],[],{"skillNo":117,"name":118,"nameZh":6,"description":119,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":120,"categories":121,"keywords":122,"publishedAt":87},"01M7FFFDGEHV8Y7J9N40HZXW52","continuous-feedback-system","Design continuous feedback systems. TRIGGERS - Use when user needs help with continuous-feedback-system related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fcontinuous-feedback-system\u002FSKILL.md",[],[]]