← Về thư mục
📄 / / profiles / r-and-d / raw_evidence / OpenAI4S / skills / bioskills / bio-population-genetics-association-testing / references / usage-guide.md

Association Testing - Usage Guide

Overview

Single-variant GWAS fits one regression per variant with an additive genotype dosage as the predictor, and the statistic is honest only insofar as genotype is independent of unmodeled phenotype drivers after the chosen covariates and random effects. The engine is set by sample structure and case:control imbalance, not taste: a PC-adjusted GLM (plink2) for unrelated samples whose structure top PCs capture, a linear mixed model (GEMMA, BOLT-LMM, SAIGE, regenie) the moment relatedness or fine-scale structure is present, and SPA or Firth when case:control imbalance and low minor-allele count break the score/Wald tail. Genomic inflation above 1 is expected under a polygenic trait and is mostly true signal; the LDSC intercept, not lambda, is the confounding diagnostic.

Prerequisites

Quick Start

Tell your AI agent what you want to do: - "Run a single-variant GWAS for my case-control phenotype with PCs as covariates" - "My sample has related individuals, pick the right association model" - "My case:control ratio is 1:50, which test stays calibrated" - "Regress on imputed dosages instead of hard calls" - "Compute lambda and tell me whether it means confounding or polygenicity" - "Run a biobank-scale GWAS with regenie step 1 and step 2"

Example Prompts

Single-variant GWAS

"Run a logistic GWAS on my QC'd case-control data with the first 10 PCs, age, and sex as covariates, and write a Manhattan and QQ plot."

"Test association with my quantitative trait on imputed dosages, reporting A1 frequency and imputation R2."

Choosing the model

"I have a cohort with cryptic relatedness and a binary trait with a 1:80 case:control ratio. Which association engine should I use and why?"

"My quantitative-trait sample is 200,000 people with some families. Set up a mixed-model GWAS with LOCO."

Calibration and confounding

"My lambda is 1.18. Is that confounding or polygenicity, and what should I check?"

"Set up SPA or Firth so my rare, imbalanced variants are not anti-conservative."

Bookkeeping for downstream use

"Prepare my GWAS sumstats with harmonized effect alleles so they can be meta-analyzed and used for a PRS."

What the Agent Will Do

  1. Confirm the genotypes are post-QC, the phenotype coding is correct, and PCs are available.
  2. Diagnose sample structure and case:control balance to choose the engine: PC-adjusted GLM, an LMM, or an LMM with SPA/Firth.
  3. Run association on dosages where imputed, with LOCO enabled for any mixed model.
  4. Apply Firth or SPA when case:control imbalance or low MAC would break the score/Wald tail.
  5. Compute lambda and (where sumstats allow) the LDSC intercept, and interpret inflation as polygenicity vs confounding rather than auto-correcting.
  6. Report effect sizes with harmonized effect-allele/strand bookkeeping, flag winner's curse for downstream use, and route rare-variant aggregation to rare-variant-association.

Tips