imaging-genetics-models

Runs variant-imaging association, kinship-aware LMM, polygenic scoring, and PLS/CCA analyses on genotype and phenotype matrices.

89|5|Updated Mar 25, 2026
One-click install
npx skills add https://github.com/CUHK-AIM-Group/NeuroDiscovery --skill imaging-genetics-models-cuhk-aim-group
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: imaging-genetics-models
Source: https://github.com/CUHK-AIM-Group/NeuroDiscovery/tree/main/skills/imaging-genetics-models
Command: npx skills add https://github.com/CUHK-AIM-Group/NeuroDiscovery --skill imaging-genetics-models-cuhk-aim-group

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires numpy, pandas, scipy, scikit-learn, statsmodels, joblib, and includes scripts (resource) components.

What problem does it solve? Researchers studying how genetic variation relates to brain imaging phenotypes need reproducible, covariate-aware statistical workflows. This Skill performs matrix-based imaging-genetics analyses—variant association scans, kinship-aware linear mixed models, polygenic scores, and multivariate PLS/CCA—while generating audited PLINK2 commands without redistributing the external executable. ## Core Features & Use Cases - Variant-Imaging Association & LMM: Run covariate-adjusted variant tests from NPZ bundles containing genotype, phenotype, and optional kinship matrices, producing multiplicity-ready P values. - Polygenic & Pathway Scoring: Compute subject-level polygenic scores from genotype arrays and variant weights. - Multivariate PLS/CCA: Link genetic features to imaging phenotypes through paired latent components and canonical variates. - Use Case: Given an NPZ bundle of genotyped subjects with cortical thickness phenotypes and a kinship matrix, run the lmm mode to obtain kinship-aware association results in association_results.csv with full run manifests. ## Quick Start Ask the assistant to run an imaging-genetics association analysis on your NPZ bundle of genotype and phenotype arrays using the imaging-genetics-models skill, choosing the lmm mode if a kinship matrix is available.

Frequently Asked Questions about imaging-genetics-models

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

FAQPage Schema
How do I run a variant-imaging association analysis with genotype data?

Create an NPZ bundle with genotype [subjects, variants] and phenotype arrays, optionally including variant_id and covariates. Then run train_reference.py with --model association and an output directory to get association_results.csv with effect estimates and P values.

How to compute a polygenic score from genotype and variant weights?

Prepare an NPZ file containing a genotype matrix and a weights array of matching variant length, optionally with subject_id. Run the skill's training script with --model prs to produce predictions.csv containing a polygenic_score column per subject.

When should I use the LMM mode instead of standard association?

Use the lmm mode when your sample contains related individuals and you can supply a kinship matrix in the NPZ bundle. Kinship-aware linear mixed models correct for relatedness and population structure that standard association tests ignore.

Does this skill include the PLINK2 executable?

No, PLINK2 remains an external executable with independent installation terms. The skill only builds audited PLINK2 command lines, which you execute separately through an approved shell workflow after installing PLINK2 yourself.

What input format does the imaging genetics analysis require?

All modes consume NPZ bundles with named arrays: genotype and phenotype for association, plus kinship for LMM, weights for PRS, or X and Y matrices for PLS/CCA. Outputs include metrics.json, config.json, and run_manifest.json for provenance.

What pitfalls should I avoid when splitting imaging genetics data?

Never split related individuals across train and test folds, and fit dimensionality reduction and covariate residualization inside training data only. Record genome build, allele orientation, QC thresholds, ancestry definition, and phenotype construction with every analysis.