🧬 GWAS Bioinformatics Tools

SNP statistics Β· Association testing Β· Multiple testing correction Β· Manhattan plot data

πŸ“˜ New to GWAS? Read the step-by-step tutorial and learn how to interpret every result.
Example: rs12345 120 85 30 rs67890 200 60 15 rs11111 50 40 45
Example: rs12345 50 40 10 40 35 25 rs67890 80 30 5 60 40 20
Example: 0.001 0.012 0.045 0.30 0.87
Example: rs12345 1 12345 0.0001 rs67890 1 45678 0.032 rs11111 2 11111 5e-9 rs22222 2 22222 0.000001 rs33333 3 33333 0.45

🧬 1. What is GWAS?

A Genome-Wide Association Study (GWAS) tests hundreds of thousands to millions of genetic variants (usually SNPs β€” Single Nucleotide Polymorphisms) across the genome to see whether any variant is statistically associated with a trait or disease.

Each SNP is tested independently, producing a p-value. Because so many tests are performed at once, raw p-values must be corrected for multiple testing β€” that's why GWAS uses thresholds like p < 5 Γ— 10⁻⁸.

Key idea: A significant SNP does not prove causation β€” it flags a genomic region that deserves biological follow-up.

πŸ“Š 2. SNP Statistics β€” HWE & Allele Frequency

Input format

One SNP per line: SNP_ID nAA nAa naa, where AA, Aa, aa are the three genotypes.

Hardy-Weinberg Equilibrium (HWE)

HWE states that in a large, randomly-mating population with no selection, mutation, or migration, genotype frequencies remain stable across generations. We test it with a χ² goodness-of-fit:

  • Expected AA = pΒ²Β·N
  • Expected Aa = 2pqΒ·N
  • Expected aa = qΒ²Β·N

where p = (2Β·nAA + nAa) / (2N) and q = 1 βˆ’ p.

How to interpret HWE p-value

HWE p-valueInterpretationAction
p β‰₯ 0.05 Consistent with HWE β€” SNP looks normal. Keep for downstream analysis.
0.001 ≀ p < 0.05 Mild deviation. Could be chance or mild genotyping issue. Inspect cluster plots; consider sensitivity analysis.
p < 0.001 Strong deviation β€” probable genotyping error, population stratification, or selection. Usually excluded from GWAS (QC filter).
Important: In case-control studies, a deviation from HWE in controls is more suspicious than in cases (cases may deviate due to true association).

Allele frequency & MAF

p(A) = (2Β·nAA + nAa) / (2N). The Minor Allele Frequency (MAF) is min(p, q).

MAFMeaningRecommendation
< 0.01Very rare variantUsually filtered out β€” low statistical power.
0.01 – 0.05Low-frequencyRetain with caution; larger sample needed.
β‰₯ 0.05Common variantStandard GWAS threshold.

πŸ§ͺ 3. Case-Control Association

Input format

SNP_ID case_AA case_Aa case_aa ctrl_AA ctrl_Aa ctrl_aa

Genotypic χ² test (2 df)

Compares the 3 genotype counts between cases and controls using a 2Γ—3 contingency table. A small p-value means genotype distribution differs between groups.

Allelic χ² test (1 df)

Collapses genotypes to allele counts (A vs a) and performs a 2Γ—2 χ². More powerful when the effect is additive.

Odds Ratio (OR) & 95% CI

OR quantifies effect size. Using the dominant model (AA + Aa vs aa):

OR = (case_carriers Β· ctrl_non_carriers) / (case_non_carriers Β· ctrl_carriers)

OR valueMeaning95% CI interpretation
OR β‰ˆ 1.0No associationCI includes 1.0
OR > 1.0Risk allele (increases odds)CI lower bound > 1.0 β†’ significant
OR < 1.0Protective allele (decreases odds)CI upper bound < 1.0 β†’ significant

Worked example

Suppose rs12345 gives OR = 2.10, 95% CI = 1.30 – 3.40, p = 0.002.

  • OR > 1 β†’ carriers of the risk allele have 2.1Γ— higher odds of disease.
  • CI (1.30–3.40) excludes 1.0 β†’ significant association.
  • p = 0.002 < 0.05 β†’ statistically significant β€” but not genome-wide significant.
Rule of thumb: A "candidate-gene" study may report p < 0.05, but a genome-wide study requires p < 5 Γ— 10⁻⁸. Don't confuse the two.

πŸ“ 4. Multiple Testing Correction

If you test 1,000,000 SNPs at Ξ± = 0.05, you expect ~50,000 false positives by chance. Corrections control this.

Bonferroni correction

p_adj = p Γ— m (m = number of tests), capped at 1.0.

  • Very strict β€” controls family-wise error rate (FWER).
  • Overly conservative when tests are correlated (common in GWAS due to LD).

Benjamini-Hochberg FDR

Controls the expected proportion of false discoveries among significant results.

  • Ranks p-values, then p_adj = p Γ— m / rank, enforcing monotonicity.
  • More powerful than Bonferroni β€” preferred in GWAS.

How to interpret the results table

ColumnWhat it meansInterpretation
Raw pUncorrected p-valueBaseline significance
BH FDRFDR-adjusted p< 0.05 β†’ significant after FDR control
BonferroniFWER-adjusted p< 0.05 β†’ significant after strict correction
Tip: A SNP with raw p = 0.001 may become non-significant after correction (e.g., FDR = 0.12). Always report corrected values.

πŸ“ˆ 5. Manhattan Plot Data

Input format

SNP_ID Chromosome BP P_value β€” one row per SNP.

What is a Manhattan plot?

A scatter plot with genomic position on the X-axis (chromosomes laid end-to-end) and βˆ’log₁₀(p) on the Y-axis. Points that rise high above the threshold form "skyscrapers" β€” these are candidate associations.

Significance thresholds

Thresholdp-valueβˆ’log₁₀(p)Meaning
Genome-wide significant< 5 Γ— 10⁻⁸> 7.3Strong evidence β€” report as a hit
Suggestive< 1 Γ— 10⁻⁡> 5.0Worth following up; not conclusive
Not significantβ‰₯ 1 Γ— 10⁻⁡< 5.0No evidence

Reading the output table

  • βˆ’log₁₀(P) β€” the Y value you'd plot; higher = more significant.
  • Status β€” automatically labelled based on thresholds.
  • Rows are sorted by chromosome and position β†’ ready for plotting in R, Python, or Excel.
Next step: Take this output into R (qqman), Python (matplotlib), or the UCSC Genome Browser to draw the plot.

βœ… 6. Recommended Workflow

  1. Quality control (QC) β€” filter SNPs with call rate < 95%, MAF < 0.01, or HWE p < 0.001 (in controls).
  2. Tab 1: SNP statistics β€” verify HWE and MAF for each SNP.
  3. Tab 2: Association testing β€” run χ² and OR for each SNP between cases and controls.
  4. Tab 3 or auto-FDR in Tab 2 β€” apply FDR correction.
  5. Tab 4: Manhattan data β€” format for plotting.
  6. Follow-up β€” replication in an independent cohort; functional annotation.

⚠️ 7. Common Pitfalls & QC Filters

Population stratification: Cases and controls from different ancestries can create spurious associations. Use PCA / mixed models to correct.
Cryptic relatedness: Duplicated or related samples inflate significance. Remove related individuals (e.g., PI_HAT > 0.185).
Low call rate: SNPs missing in many samples β†’ unreliable. Filter at β‰₯ 95–98%.
Batch effects: Genotyping platform / batch can bias results β€” include as covariates.
Best practice: Always report both raw and corrected p-values, effect sizes (OR/Ξ²), and confidence intervals. A p-value alone is not enough.

Reporting checklist

  • Sample size (cases / controls)
  • Number of SNPs tested
  • QC filters applied
  • Correction method used (FDR / Bonferroni)
  • Effect size with 95% CI, not just p-value
  • Replication status
Home