← Về thư mục
📄 / / profiles / r-and-d / raw_evidence / OpenAI4S / skills / bioskills / bio-workflows-gwas-pipeline / references / usage-guide.md

GWAS Pipeline - Usage Guide

Overview

This workflow performs genome-wide association studies (GWAS) to identify genetic variants associated with traits or diseases.

Prerequisites

conda install -c bioconda plink plink2

# R packages for visualization
install.packages(c('qqman', 'ggplot2'))

Quick Start

Tell your AI agent what you want to do: - "Run a GWAS on my genotype data" - "Find variants associated with my phenotype" - "Perform case-control association testing"

Example Prompts

GWAS workflow

"Run QC and association testing on my VCF"

"Create Manhattan and QQ plots for my GWAS"

"Adjust for population structure using PCA"

Analysis options

"Run GWAS for a quantitative trait"

"Include age and sex as covariates"

"Extract genome-wide significant hits"

Input Requirements

Input Format Description
Genotypes VCF or PLINK SNP genotype data
Phenotypes Text file Case/control or quantitative
Covariates Text file Age, sex, PCs (optional)

What the Workflow Does

  1. QC Filtering - Remove poor quality samples/variants in order (variant missingness before sample missingness), with controls-only HWE and KING relatedness pruning
  2. Phasing and Imputation - Align to a reference panel, phase, impute to dosages, and filter by R2 (owned by the phasing-imputation skills; impute cases and controls together)
  3. LD Pruning - Get independent variants for PCA after excluding long-range-LD regions
  4. PCA - Calculate population structure covariates
  5. Association - Test variant-phenotype associations on dosages (PC-covariate GLM for unrelated samples, a linear mixed model for related/structured ones)
  6. Visualization - Manhattan and QQ plots

Case-Control vs Quantitative

Feature Case-Control Quantitative
Phenotype 1=control, 2=case Continuous value
Model Logistic regression Linear regression
Output Odds ratio Beta coefficient

Tips