PLINK Association Tests - ohsu-comp-bio/cedar-gwas GitHub Wiki
Convert Minimac3 VCF to PLINK
PLINK has its own file formats including: .bim
, .bed
, .fam
. Note the .bed
file is not the same as UCSC's BED format. Example conversion:
plink --vcf [minimac3 vcf] --out [plink prefix]
Decide best association test
PLINK comes with its own suite of association tests to choose from, such as: Case/Control, Fisher's Exact Test, Cochran-Armitage test, linear/logistic models. Docs for plink association tests.
You can also write your own Rscript to perform a custom test. Example here. Docs for using the PLINK Rplugin.
Run PLINK
To run a plink association test, you need the plink binary files, Rscript with chosen association test (optional), and a phenotype file (optional). The phenotype file contains 3 columns: Family ID, Individual ID, Phenotype. Example:
TCGA-EJ-5499 TCGA-EJ-5499 0.198680431181652
TCGA-EJ-5498 TCGA-EJ-5498 0.083903480054661
TCGA-CH-5772 TCGA-CH-5772 0.207180609292677
It's also a good idea to filter out variants that have a minor allele of less than 10% (--maf 0.1
) and fail hardy-weinberg test (--hwe 1e-8
).
Example Command using Spearman Correlation (see wiki for using the R-plugin):
plink --bfile [prefix to plink files] --R Rplink.spearman.correlation.R --pheno [phenotype file] --maf 0.1 --hwe 1e-8 --out [prefix for output files] --noweb --allow-no-sex
Example Command using Case/Control Association:
plink --bfile [prefix to plink files] --pheno [phenotype file] --assoc --noweb --maf 0.1 --hwe 1e-8 --out [prefix for output files] --allow-no-sex
Output
The output includes information about the SNP/Allele being tested, the Spearman coefficient, p-value, and confidence intervals.
CHR SNP BP Allele Spearman P LCI UCI
10 rs376835509 65030 A 0.0042604 0.938356 -0.103425 0.111847
10 rs72635988 69083 C -0.0555186 0.313186 -0.162187 0.0524324