[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7CVHB3C6BRA092CXGYSQFWJ":3,"skill-same:01M7CVHB3C6BRA092CXGYSQFWJ":56},{"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":25,"commitSha":26,"skillDirectory":27,"forksCount":28,"repositoryHtmlUrl":29,"repositoryHomepageUrl":6,"ownerHtmlUrl":30,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":31,"install":32,"resources":45},"01M7CVHB3C6BRA092CXGYSQFWJ","bio-causal-genomics-mediation-analysis",null,"Decompose genetic effects into direct and indirect paths through mediating variables using the mediation R package. Tests whether gene expression, methylation, or other molecular phenotypes mediate the effect of genetic variants on disease. Use when testing whether a molecular...","mrsonord2240\u002Fopenscience-specialists","mrsonord2240","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F76487430?v=4","01M7CTEM40S43GSJZ9A3YCCXZK","Samuel Nord","01M7CTEM4K69JD1GBYNHVJ9ZP4",2,"MIT","https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Fmendelian-randomization-specialist\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fbio-causal-genomics-mediation-analysis\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: bio-causal-genomics-mediation-analysis\ndescription: Decompose genetic effects into direct and indirect paths through mediating variables using the mediation R package. Tests whether gene expression, methylation, or other molecular phenotypes mediate the effect of genetic variants on disease. Use when testing whether a molecular...\nlicense: MIT\nauthor: AIPOCH\n---\n> **Source**: [https:\u002F\u002Fgithub.com\u002Faipoch\u002Fmedical-research-skills](https:\u002F\u002Fgithub.com\u002Faipoch\u002Fmedical-research-skills)\n\n\n## Version Compatibility\n\nReference examples tested with: R stats (base), 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# Mediation Analysis\n\n**\"Test whether gene expression mediates the effect of this variant on disease\"** → Decompose the total genetic effect into direct and indirect (mediated) paths through a molecular phenotype, estimating ACME, ADE, and proportion mediated with bootstrap confidence intervals.\n- R: `mediation::mediate()` for causal mediation analysis\n\n## Framework\n\nCausal mediation decomposes the total effect of a treatment (genotype) on an outcome\n(phenotype) into:\n\n- **ACME** (Average Causal Mediation Effect) - Indirect effect through the mediator\n- **ADE** (Average Direct Effect) - Direct effect not through the mediator\n- **Total effect** = ACME + ADE\n- **Proportion mediated** = ACME \u002F Total effect\n\nTypical genomic applications:\n- SNP -> gene expression (mediator) -> disease\n- SNP -> DNA methylation (mediator) -> gene expression\n- SNP -> protein levels (mediator) -> clinical outcome\n\n## Basic Mediation with the mediation Package\n\n**Goal:** Decompose a genetic effect into direct and indirect (mediated) paths through a molecular phenotype.\n\n**Approach:** Fit separate models for mediator and outcome, then run mediate() with bootstrap to estimate ACME (indirect), ADE (direct), and proportion mediated.\n\n```r\nlibrary(mediation)\n\n# --- Step 1: Fit mediator model ---\n# How does the treatment (genotype) affect the mediator (expression)?\nmediator_model \u003C- lm(expression ~ genotype + age + sex + pc1 + pc2, data = dat)\n\n# --- Step 2: Fit outcome model ---\n# How do treatment and mediator jointly affect the outcome?\n# For binary outcome, use glm with family = binomial\noutcome_model \u003C- glm(\n  disease ~ genotype + expression + age + sex + pc1 + pc2,\n  data = dat, family = binomial\n)\n\n# --- Step 3: Run mediation analysis ---\n# treat: name of treatment variable (genotype)\n# mediator: name of mediator variable (expression)\n# boot = TRUE: Use nonparametric bootstrap for CIs\n# sims: Number of bootstrap simulations (1000 minimum for publication)\nmed_result \u003C- mediate(\n  mediator_model, outcome_model,\n  treat = 'genotype', mediator = 'expression',\n  boot = TRUE, sims = 1000\n)\n\nsummary(med_result)\n# Key outputs:\n# ACME: Indirect effect (through expression)\n# ADE: Direct effect (not through expression)\n# Total Effect: ACME + ADE\n# Prop. Mediated: ACME \u002F Total\n```\n\n## Interpreting Results\n\n```r\n# Extract key quantities\nacme \u003C- med_result$d0           # Indirect (mediated) effect\nacme_ci \u003C- med_result$d0.ci     # 95% CI for ACME\nade \u003C- med_result$z0            # Direct effect\ntotal \u003C- med_result$tau.coef    # Total effect\nprop_med \u003C- med_result$n0       # Proportion mediated\n\ncat('ACME (indirect):', round(acme, 4), '\\n')\ncat('ACME 95% CI:', round(acme_ci[1], 4), 'to', round(acme_ci[2], 4), '\\n')\ncat('ADE (direct):', round(ade, 4), '\\n')\ncat('Total effect:', round(total, 4), '\\n')\ncat('Proportion mediated:', round(prop_med, 3), '\\n')\n\n# Significant ACME (CI excludes 0): Evidence for mediation\n# Proportion mediated > 0.2: Meaningful mediation\n# Proportion mediated > 0.8: Mediator explains most of the effect\n```\n\n## eQTL Mediation\n\n**Goal:** Test whether gene expression mediates the effect of an eQTL on a disease outcome across multiple genes.\n\n**Approach:** Wrap the mediation workflow in a function, loop over candidate genes, and adjust p-values for multiple testing.\n\n```r\nlibrary(mediation)\n\nrun_eqtl_mediation \u003C- function(dat, snp_col, expr_col, outcome_col, covariates) {\n  covar_formula \u003C- paste(covariates, collapse = ' + ')\n\n  med_formula \u003C- as.formula(paste(expr_col, '~', snp_col, '+', covar_formula))\n  out_formula \u003C- as.formula(paste(outcome_col, '~', snp_col, '+', expr_col, '+', covar_formula))\n\n  med_model \u003C- lm(med_formula, data = dat)\n\n  if (length(unique(dat[[outcome_col]])) == 2) {\n    out_model \u003C- glm(out_formula, data = dat, family = binomial)\n  } else {\n    out_model \u003C- lm(out_formula, data = dat)\n  }\n\n  result \u003C- mediate(\n    med_model, out_model,\n    treat = snp_col, mediator = expr_col,\n    boot = TRUE, sims = 1000\n  )\n\n  data.frame(\n    snp = snp_col, gene = expr_col,\n    acme = result$d0, acme_p = result$d0.p,\n    ade = result$z0, ade_p = result$z0.p,\n    total = result$tau.coef, total_p = result$tau.p,\n    prop_mediated = result$n0\n  )\n}\n\n# Example: test mediation for multiple genes\ngenes \u003C- c('GENE_A', 'GENE_B', 'GENE_C')\ncovars \u003C- c('age', 'sex', 'pc1', 'pc2', 'pc3')\n\nmediation_results \u003C- do.call(rbind, lapply(genes, function(g) {\n  run_eqtl_mediation(dat, 'rs12345', g, 'disease_status', covars)\n}))\n\n# Adjust for multiple testing\nmediation_results$acme_fdr \u003C- p.adjust(mediation_results$acme_p, method = 'BH')\n```\n\n## Multi-Omics Mediation\n\n**Goal:** Test cascading mediation chains across multiple molecular layers (e.g., SNP -> methylation -> expression -> disease).\n\n**Approach:** Fit sequential models for each link in the chain and run separate mediation analyses for each mediator-outcome pair.\n\n```r\n# Test mediation chains: SNP -> methylation -> expression -> disease\nlibrary(mediation)\n\n# Step 1: SNP -> methylation\nmod_meth \u003C- lm(methylation ~ genotype + age + sex, data = dat)\n\n# Step 2: methylation -> expression (controlling for genotype)\nmod_expr \u003C- lm(expression ~ methylation + genotype + age + sex, data = dat)\n\n# Step 3: expression -> disease (controlling for methylation and genotype)\nmod_disease \u003C- glm(\n  disease ~ expression + methylation + genotype + age + sex,\n  data = dat, family = binomial\n)\n\n# Test methylation as mediator of SNP -> expression\nmed_meth_expr \u003C- mediate(mod_meth, mod_expr, treat = 'genotype', mediator = 'methylation',\n                         boot = TRUE, sims = 1000)\n\n# Test expression as mediator of methylation -> disease\nmed_expr_disease \u003C- mediate(mod_expr, mod_disease, treat = 'methylation', mediator = 'expression',\n                            boot = TRUE, sims = 1000)\n```\n\n## High-Dimensional Mediation (HDMA)\n\n**Goal:** Test thousands of potential mediators simultaneously (e.g., all CpG sites) to identify which mediate a genetic effect.\n\n**Approach:** Use HIMA's penalized regression to jointly select significant mediators from a high-dimensional mediator matrix and estimate their indirect effects.\n\n```r\n# For testing many potential mediators simultaneously (e.g., all CpG sites)\n# install.packages('HIMA')\nlibrary(HIMA)\n\n# X: treatment (genotype), M: high-dimensional mediators, Y: outcome\n# HIMA uses penalized regression to select significant mediators\n\nresult \u003C- hima(\n  X = dat$genotype,\n  Y = dat$disease,\n  M = as.matrix(dat[, mediator_cols]),\n  COV.XM = as.matrix(dat[, covariate_cols]),\n  Y.family = 'binomial',\n  M.family = 'gaussian',\n  penalty = 'MCP'    # Minimax concave penalty (default)\n)\n\n# Results: significant mediators with estimated indirect effects\nsignificant_mediators \u003C- result[result$BH.FDR \u003C 0.05, ]\n```\n\n## Assumptions and Diagnostics\n\n```r\n# --- Sequential ignorability assumption ---\n# 1. No unmeasured confounders between treatment and mediator\n# 2. No unmeasured confounders between mediator and outcome\n# 3. No unmeasured confounders between treatment and outcome\n# This assumption is UNTESTABLE but can be probed with sensitivity analysis\n\n# --- Sensitivity analysis ---\n# Tests how robust results are to unmeasured confounding\nsens \u003C- medsens(med_result, rho.by = 0.1, effect.type = 'indirect', sims = 1000)\nsummary(sens)\n\n# rho: Correlation between residuals of mediator and outcome models\n# At what rho does ACME cross zero? (larger |rho| = more robust)\n# rho at which ACME = 0 is called the sensitivity parameter\n# |rho| > 0.3: Reasonably robust to unmeasured confounding\n\nplot(sens)\n```\n\n## Visualization\n\n```r\nlibrary(ggplot2)\n\nplot_mediation_diagram \u003C- function(acme, ade, total, prop_med) {\n  cat('Mediation Path Diagram:\\n\\n')\n  cat('  Genotype ---[a]---> Mediator ---[b]---> Outcome\\n')\n  cat('      |                                     ^\\n')\n  cat('      +----------[c\\' (ADE)]----------------+\\n')\n  cat('\\n')\n  cat('  Indirect (a*b = ACME):', round(acme, 4), '\\n')\n  cat('  Direct (c\\' = ADE):', round(ade, 4), '\\n')\n  cat('  Total (c):', round(total, 4), '\\n')\n  cat('  Proportion mediated:', round(prop_med, 3), '\\n')\n}\n\nplot_mediation_results \u003C- function(results_df) {\n  results_df$gene \u003C- factor(results_df$gene, levels = results_df$gene[order(results_df$prop_mediated)])\n\n  ggplot(results_df, aes(x = gene, y = prop_mediated)) +\n    geom_col(fill = 'steelblue', alpha = 0.7) +\n    geom_hline(yintercept = 0.2, linetype = 'dashed', color = 'red', alpha = 0.5) +\n    coord_flip() +\n    labs(x = NULL, y = 'Proportion Mediated', title = 'Mediation by Gene Expression') +\n    theme_minimal()\n}\n```\n\n## Related Skills\n\n- mendelian-randomization - Causal inference using genetic instruments\n- colocalization-analysis - Test if signals share a causal variant\n- population-genetics\u002Fassociation-testing - GWAS for treatment-outcome associations\n- multi-omics-integration\u002Fmofa-integration - Multi-omics data for mediation chains\n\n## Input Validation\n\nThis skill accepts requests that match the documented purpose of `bio-causal-genomics-mediation-analysis` and include enough context to complete the workflow safely.\n\nDo not continue the workflow when the request is out of scope, missing a critical input, or would require unsupported assumptions. Instead respond:\n\n> `bio-causal-genomics-mediation-analysis` only handles its documented workflow. Please provide the missing required inputs or switch to a more suitable skill.\n","> **Source**: [https:\u002F\u002Fgithub.com\u002Faipoch\u002Fmedical-research-skills](https:\u002F\u002Fgithub.com\u002Faipoch\u002Fmedical-research-skills)\n\n\n## Version Compatibility\n\nReference examples tested with: R stats (base), 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# Mediation Analysis\n\n**\"Test whether gene expression mediates the effect of this variant on disease\"** → Decompose the total genetic effect into direct and indirect (mediated) paths through a molecular phenotype, estimating ACME, ADE, and proportion mediated with bootstrap confidence intervals.\n- R: `mediation::mediate()` for causal mediation analysis\n\n## Framework\n\nCausal mediation decomposes the total effect of a treatment (genotype) on an outcome\n(phenotype) into:\n\n- **ACME** (Average Causal Mediation Effect) - Indirect effect through the mediator\n- **ADE** (Average Direct Effect) - Direct effect not through the mediator\n- **Total effect** = ACME + ADE\n- **Proportion mediated** = ACME \u002F Total effect\n\nTypical genomic applications:\n- SNP -> gene expression (mediator) -> disease\n- SNP -> DNA methylation (mediator) -> gene expression\n- SNP -> protein levels (mediator) -> clinical outcome\n\n## Basic Mediation with the mediation Package\n\n**Goal:** Decompose a genetic effect into direct and indirect (mediated) paths through a molecular phenotype.\n\n**Approach:** Fit separate models for mediator and outcome, then run mediate() with bootstrap to estimate ACME (indirect), ADE (direct), and proportion mediated.\n\n```r\nlibrary(mediation)\n\n# --- Step 1: Fit mediator model ---\n# How does the treatment (genotype) affect the mediator (expression)?\nmediator_model \u003C- lm(expression ~ genotype + age + sex + pc1 + pc2, data = dat)\n\n# --- Step 2: Fit outcome model ---\n# How do treatment and mediator jointly affect the outcome?\n# For binary outcome, use glm with family = binomial\noutcome_model \u003C- glm(\n  disease ~ genotype + expression + age + sex + pc1 + pc2,\n  data = dat, family = binomial\n)\n\n# --- Step 3: Run mediation analysis ---\n# treat: name of treatment variable (genotype)\n# mediator: name of mediator variable (expression)\n# boot = TRUE: Use nonparametric bootstrap for CIs\n# sims: Number of bootstrap simulations (1000 minimum for publication)\nmed_result \u003C- mediate(\n  mediator_model, outcome_model,\n  treat = 'genotype', mediator = 'expression',\n  boot = TRUE, sims = 1000\n)\n\nsummary(med_result)\n# Key outputs:\n# ACME: Indirect effect (through expression)\n# ADE: Direct effect (not through expression)\n# Total Effect: ACME + ADE\n# Prop. Mediated: ACME \u002F Total\n```\n\n## Interpreting Results\n\n```r\n# Extract key quantities\nacme \u003C- med_result$d0           # Indirect (mediated) effect\nacme_ci \u003C- med_result$d0.ci     # 95% CI for ACME\nade \u003C- med_result$z0            # Direct effect\ntotal \u003C- med_result$tau.coef    # Total effect\nprop_med \u003C- med_result$n0       # Proportion mediated\n\ncat('ACME (indirect):', round(acme, 4), '\\n')\ncat('ACME 95% CI:', round(acme_ci[1], 4), 'to', round(acme_ci[2], 4), '\\n')\ncat('ADE (direct):', round(ade, 4), '\\n')\ncat('Total effect:', round(total, 4), '\\n')\ncat('Proportion mediated:', round(prop_med, 3), '\\n')\n\n# Significant ACME (CI excludes 0): Evidence for mediation\n# Proportion mediated > 0.2: Meaningful mediation\n# Proportion mediated > 0.8: Mediator explains most of the effect\n```\n\n## eQTL Mediation\n\n**Goal:** Test whether gene expression mediates the effect of an eQTL on a disease outcome across multiple genes.\n\n**Approach:** Wrap the mediation workflow in a function, loop over candidate genes, and adjust p-values for multiple testing.\n\n```r\nlibrary(mediation)\n\nrun_eqtl_mediation \u003C- function(dat, snp_col, expr_col, outcome_col, covariates) {\n  covar_formula \u003C- paste(covariates, collapse = ' + ')\n\n  med_formula \u003C- as.formula(paste(expr_col, '~', snp_col, '+', covar_formula))\n  out_formula \u003C- as.formula(paste(outcome_col, '~', snp_col, '+', expr_col, '+', covar_formula))\n\n  med_model \u003C- lm(med_formula, data = dat)\n\n  if (length(unique(dat[[outcome_col]])) == 2) {\n    out_model \u003C- glm(out_formula, data = dat, family = binomial)\n  } else {\n    out_model \u003C- lm(out_formula, data = dat)\n  }\n\n  result \u003C- mediate(\n    med_model, out_model,\n    treat = snp_col, mediator = expr_col,\n    boot = TRUE, sims = 1000\n  )\n\n  data.frame(\n    snp = snp_col, gene = expr_col,\n    acme = result$d0, acme_p = result$d0.p,\n    ade = result$z0, ade_p = result$z0.p,\n    total = result$tau.coef, total_p = result$tau.p,\n    prop_mediated = result$n0\n  )\n}\n\n# Example: test mediation for multiple genes\ngenes \u003C- c('GENE_A', 'GENE_B', 'GENE_C')\ncovars \u003C- c('age', 'sex', 'pc1', 'pc2', 'pc3')\n\nmediation_results \u003C- do.call(rbind, lapply(genes, function(g) {\n  run_eqtl_mediation(dat, 'rs12345', g, 'disease_status', covars)\n}))\n\n# Adjust for multiple testing\nmediation_results$acme_fdr \u003C- p.adjust(mediation_results$acme_p, method = 'BH')\n```\n\n## Multi-Omics Mediation\n\n**Goal:** Test cascading mediation chains across multiple molecular layers (e.g., SNP -> methylation -> expression -> disease).\n\n**Approach:** Fit sequential models for each link in the chain and run separate mediation analyses for each mediator-outcome pair.\n\n```r\n# Test mediation chains: SNP -> methylation -> expression -> disease\nlibrary(mediation)\n\n# Step 1: SNP -> methylation\nmod_meth \u003C- lm(methylation ~ genotype + age + sex, data = dat)\n\n# Step 2: methylation -> expression (controlling for genotype)\nmod_expr \u003C- lm(expression ~ methylation + genotype + age + sex, data = dat)\n\n# Step 3: expression -> disease (controlling for methylation and genotype)\nmod_disease \u003C- glm(\n  disease ~ expression + methylation + genotype + age + sex,\n  data = dat, family = binomial\n)\n\n# Test methylation as mediator of SNP -> expression\nmed_meth_expr \u003C- mediate(mod_meth, mod_expr, treat = 'genotype', mediator = 'methylation',\n                         boot = TRUE, sims = 1000)\n\n# Test expression as mediator of methylation -> disease\nmed_expr_disease \u003C- mediate(mod_expr, mod_disease, treat = 'methylation', mediator = 'expression',\n                            boot = TRUE, sims = 1000)\n```\n\n## High-Dimensional Mediation (HDMA)\n\n**Goal:** Test thousands of potential mediators simultaneously (e.g., all CpG sites) to identify which mediate a genetic effect.\n\n**Approach:** Use HIMA's penalized regression to jointly select significant mediators from a high-dimensional mediator matrix and estimate their indirect effects.\n\n```r\n# For testing many potential mediators simultaneously (e.g., all CpG sites)\n# install.packages('HIMA')\nlibrary(HIMA)\n\n# X: treatment (genotype), M: high-dimensional mediators, Y: outcome\n# HIMA uses penalized regression to select significant mediators\n\nresult \u003C- hima(\n  X = dat$genotype,\n  Y = dat$disease,\n  M = as.matrix(dat[, mediator_cols]),\n  COV.XM = as.matrix(dat[, covariate_cols]),\n  Y.family = 'binomial',\n  M.family = 'gaussian',\n  penalty = 'MCP'    # Minimax concave penalty (default)\n)\n\n# Results: significant mediators with estimated indirect effects\nsignificant_mediators \u003C- result[result$BH.FDR \u003C 0.05, ]\n```\n\n## Assumptions and Diagnostics\n\n```r\n# --- Sequential ignorability assumption ---\n# 1. No unmeasured confounders between treatment and mediator\n# 2. No unmeasured confounders between mediator and outcome\n# 3. No unmeasured confounders between treatment and outcome\n# This assumption is UNTESTABLE but can be probed with sensitivity analysis\n\n# --- Sensitivity analysis ---\n# Tests how robust results are to unmeasured confounding\nsens \u003C- medsens(med_result, rho.by = 0.1, effect.type = 'indirect', sims = 1000)\nsummary(sens)\n\n# rho: Correlation between residuals of mediator and outcome models\n# At what rho does ACME cross zero? (larger |rho| = more robust)\n# rho at which ACME = 0 is called the sensitivity parameter\n# |rho| > 0.3: Reasonably robust to unmeasured confounding\n\nplot(sens)\n```\n\n## Visualization\n\n```r\nlibrary(ggplot2)\n\nplot_mediation_diagram \u003C- function(acme, ade, total, prop_med) {\n  cat('Mediation Path Diagram:\\n\\n')\n  cat('  Genotype ---[a]---> Mediator ---[b]---> Outcome\\n')\n  cat('      |                                     ^\\n')\n  cat('      +----------[c\\' (ADE)]----------------+\\n')\n  cat('\\n')\n  cat('  Indirect (a*b = ACME):', round(acme, 4), '\\n')\n  cat('  Direct (c\\' = ADE):', round(ade, 4), '\\n')\n  cat('  Total (c):', round(total, 4), '\\n')\n  cat('  Proportion mediated:', round(prop_med, 3), '\\n')\n}\n\nplot_mediation_results \u003C- function(results_df) {\n  results_df$gene \u003C- factor(results_df$gene, levels = results_df$gene[order(results_df$prop_mediated)])\n\n  ggplot(results_df, aes(x = gene, y = prop_mediated)) +\n    geom_col(fill = 'steelblue', alpha = 0.7) +\n    geom_hline(yintercept = 0.2, linetype = 'dashed', color = 'red', alpha = 0.5) +\n    coord_flip() +\n    labs(x = NULL, y = 'Proportion Mediated', title = 'Mediation by Gene Expression') +\n    theme_minimal()\n}\n```\n\n## Related Skills\n\n- mendelian-randomization - Causal inference using genetic instruments\n- colocalization-analysis - Test if signals share a causal variant\n- population-genetics\u002Fassociation-testing - GWAS for treatment-outcome associations\n- multi-omics-integration\u002Fmofa-integration - Multi-omics data for mediation chains\n\n## Input Validation\n\nThis skill accepts requests that match the documented purpose of `bio-causal-genomics-mediation-analysis` and include enough context to complete the workflow safely.\n\nDo not continue the workflow when the request is out of scope, missing a critical input, or would require unsupported assumptions. Instead respond:\n\n> `bio-causal-genomics-mediation-analysis` only handles its documented workflow. Please provide the missing required inputs or switch to a more suitable skill.\n",{"name":5,"author":24,"license":15,"description":7},"AIPOCH","main","e0956dc9606356ab78468936b502e55a365282e2","specialists\u002Fmendelian-randomization-specialist\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fbio-causal-genomics-mediation-analysis",0,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists","https:\u002F\u002Fgithub.com\u002Fmrsonord2240","2026-10-12 03:19:04",{"source":8,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add mrsonord2240\u002Fopenscience-specialists --skill bio-causal-genomics-mediation-analysis",{"tool":38,"command":39},"bunx","bunx skills add mrsonord2240\u002Fopenscience-specialists --skill bio-causal-genomics-mediation-analysis",{"tool":41,"command":42},"pnpm","pnpm dlx skills add mrsonord2240\u002Fopenscience-specialists --skill bio-causal-genomics-mediation-analysis","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Fmendelian-randomization-specialist\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fbio-causal-genomics-mediation-analysis\u002FSKILL.md",true,[46,52],{"path":47,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":50,"sourceHtmlUrl":51},"POLISH_CHANGELOG.md","REFERENCE","参考文档",633,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Fmendelian-randomization-specialist\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fbio-causal-genomics-mediation-analysis\u002FPOLISH_CHANGELOG.md",{"path":53,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":54,"sourceHtmlUrl":55},"usage-guide.md",2572,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Fmendelian-randomization-specialist\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fbio-causal-genomics-mediation-analysis\u002Fusage-guide.md",[57,65,72,79,86,93],{"skillNo":58,"name":59,"nameZh":6,"description":60,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":61,"licenseFileUrl":6,"sourceHtmlUrl":62,"categories":63,"keywords":64,"publishedAt":19},"01M7CW36A6QAGWFE2C008M1XPG","bio-workflows-metabolomics-pipeline","Orchestrates the untargeted LC-MS metabolomics pipeline end-to-end (xcms 4.x feature extraction, QC\u002Fdrift\u002Fnormalization, confidence-stratified annotation, permutation-validated statistics, background-aware pathway mapping), naming what each stage decides and where it silently fails. Use when running a full LC-MS metabolomics study from raw mzML to enriched pathways and needing the honest handoffs between stages. Each stage defers to its component skill for parameters and traps; for stable-isotope flux (a separate branch, not this untargeted flow) see metabolomics\u002Fisotope-tracing.","Apache-2.0","https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Funtargeted-metabolomics-analyst\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fbio-workflows-metabolomics-pipeline\u002FSKILL.md",[],[],{"skillNo":66,"name":67,"nameZh":6,"description":68,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":61,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":71,"publishedAt":19},"01M7CW2Y18623NA2S1Y30FRQW1","bio-metabolomics-xcms-preprocessing","Programmatic untargeted LC-MS feature extraction in R with the modern xcms 4.x MsExperiment\u002FXcmsExperiment API, taking raw mzML to a feature table via CentWave peak detection, retention-time alignment, peak-density correspondence, gap-filling, CAMERA redundancy collapse, and built-in QC feature filtering. Use when converting centroided LC-MS runs into a features-by-samples matrix and deciding centWave\u002Fgrouping\u002Falignment parameters. For drift correction and QC\u002FCV filtering execution see metabolomics\u002Fnormalization-qc; for metabolite identification see metabolomics\u002Fmetabolite-annotation; for the MS-DIAL GUI alternative with MS2Dec deconvolution see metabolomics\u002Fmsdial-preprocessing; for downstream statistics see metabolomics\u002Fstatistical-analysis.","https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Funtargeted-metabolomics-analyst\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fbio-metabolomics-xcms-preprocessing\u002FSKILL.md",[],[],{"skillNo":73,"name":74,"nameZh":6,"description":75,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":61,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":19},"01M7CW2M364HVWPNQEKE2WP4PP","bio-metabolomics-statistical-analysis","Decision-grade statistical analysis for metabolomics intensity tables. Covers transformation and scaling (Pareto vs unit-variance as a hidden hypothesis), unsupervised structure (PCA\u002FHCA for QC), permutation-validated PLS-DA\u002FOPLS-DA (R2 vs Q2, double CV, VIP as heuristic), univariate testing (Welch\u002FMann-Whitney\u002FANOVA\u002FLMM with covariate adjustment), and dependence-aware multiple testing. Use when testing which metabolites differ, building or validating a discriminant model, choosing a scaling, or correcting many correlated tests. For sample-wise normalization\u002Fdrift correction see metabolomics\u002Fnormalization-qc; for ML classifiers and selection-inside-CV leakage see machine-learning\u002Fbiomarker-discovery and machine-learning\u002Fmodel-validation; for pathway interpretation see metabolomics\u002Fpathway-mapping; for design\u002Fpower\u002Fmultiplicity regime see experimental-design\u002Fmultiple-testing.","https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Funtargeted-metabolomics-analyst\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fbio-metabolomics-statistical-analysis\u002FSKILL.md",[],[],{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":61,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":19},"01M7CW2BCBF851WYE03Z8XPEDQ","bio-metabolomics-pathway-mapping","Maps metabolomics results to biological pathways via over-representation (ORA), metabolite-set enrichment (MSEA\u002FQEA), mummichog\u002FPSEA on raw m\u002Fz peaks, and network-diffusion enrichment (FELLA), with correct background-set construction and honest interpretive ceilings. Use when interpreting differential metabolites or an untargeted LC-MS feature table in pathway context, choosing ORA vs MSEA vs mummichog vs topology, or setting the reference\u002Fbackground set. For annotation confidence levels feeding ORA see metabolomics\u002Fmetabolite-annotation; for gene-set concepts see pathway-analysis\u002Fgo-enrichment and pathway-analysis\u002Fgsea; for joint gene+metabolite pathways see multi-omics-integration\u002Fmofa-integration.","https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Funtargeted-metabolomics-analyst\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fbio-metabolomics-pathway-mapping\u002FSKILL.md",[],[],{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":61,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":19},"01M7CW21NSZMCPMF7D9CHJM718","bio-metabolomics-normalization-qc","Designs QC, corrects signal drift, removes batch effects, filters features, normalizes samples, and imputes missing values for untargeted LC-MS\u002FGC-MS metabolomics, framing each step as a measurement model that can create or erase biological signal. Use when processing a peak\u002Ffeature table before statistical analysis, choosing a drift-correction or sample-normalization method, deciding QC RSD vs D-ratio filtering, or handling left-censored missing values. The feature table is produced by metabolomics\u002Fxcms-preprocessing or metabolomics\u002Fmsdial-preprocessing; transformation\u002Fscaling for modeling defers to metabolomics\u002Fstatistical-analysis; cross-study design issues link to experimental-design\u002Fbatch-design.","https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Funtargeted-metabolomics-analyst\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fbio-metabolomics-normalization-qc\u002FSKILL.md",[],[],{"skillNo":94,"name":95,"nameZh":6,"description":96,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":61,"licenseFileUrl":6,"sourceHtmlUrl":97,"categories":98,"keywords":99,"publishedAt":19},"01M7CW1SWVM0NYHVE6Q7MA3G7R","bio-metabolomics-msdial-preprocessing","Runs the MS-DIAL preprocessing workflow (peak picking, MS2Dec spectral deconvolution, alignment, gap-filling) and imports the alignment-result table into R or Python with honest filtering. Use when preprocessing LC-MS DDA\u002FDIA (SWATH) or GC-MS raw data with MS-DIAL, deciding MS-DIAL vs XCMS, configuring the MSDIALCUI console run, or parsing an MS-DIAL export into a clean feature matrix. For programmatic R peak detection and the feature-table-as-artifact framing see metabolomics\u002Fxcms-preprocessing; for lipid annotation mode see metabolomics\u002Flipidomics; for MSI-level confidence honesty see metabolomics\u002Fmetabolite-annotation; for drift correction and QC see metabolomics\u002Fnormalization-qc.","https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Funtargeted-metabolomics-analyst\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fbio-metabolomics-msdial-preprocessing\u002FSKILL.md",[],[]]