Tutorial: EMMAX GotCloud STOM

From Genome Analysis Wiki
Revision as of 15:32, 5 January 2014 by Hmkang (talk | contribs) (→‎Lecture 2)
Jump to navigationJump to search

STOM 2014 Workshop - Practical Sessions

Welcome to Hyun Min Kang's practical session guide page for STOM 2014 workshop. If you do not know what STOM 2014 workshop is please follow the [[ http://bibs.snu.ac.kr/board/index.php?catid=201&bcid=344 | link]]

This page is intended to supplement the slides presented in the practical sessions of STOM 2014 workshop by facilitating easy copy-and paste of commands illustrated in the example, in the case the speed of the lecture is too fast for you.

This page only covers lecture 2, 5, 6, 8 that are taught by Hyun Min Kang.

Here I assume that

  • The audience has basic knowledge of Unix system, basic utilities, and pipes
  • The audience has the account in the cluster system and know how to access to the resources presented here

Note that some commands can be very long and may go farther than the browser's width

Lecture 2

  • To see the files for the session, type
ls /data/stom2014/session2/

If you see any errors, please let me know now!

  • For convenience, let’s set some variables
export S2=/data/stom2014/session2
mkdir ~/out
  • Run naive association test using PLINK
$S2/bin/plink --noweb --bfile $S2/data/1000G.auto.omni.phased.EUR --pheno $S2/data/1000G_EUR_20_1459060.phe --linear --out ~/out/naive
  • Check your output file and see what it looks like
less ~/out/naive.assoc.linear
  • Check the p-value at the causal variant
grep -w ADD ~/out/naive.assoc.linear | grep 20:1459060
  • Draw QQ plot using the following R commands
> source('/data/stom2014/session2/r/qqconf.r')
> T <- read.table('~/out/naive.assoc.linear',header=TRUE)
> pdf('~/out/naive.pdf')
> qq.conf.beta(T$P)
> dev.off()
  • Add --adjust option to enable genomic control
$S2/bin/plink --noweb --bfile $S2/data/1000G.auto.omni.phased.EUR --pheno $S2/data/1000G_EUR_20_1459060.phe --linear --adjust --out ~/out/naive
  • Calculate inflation factor on your own
> T <- read.table('~/out/naive.assoc.linear',header=TRUE)
    • First, find the median p-value
> median(T$P)
> 0.4814
    • Convert p-value into chi-square using R, and compute lambda
> qchisq(0.4814,1,lower.tail=FALSE)
[1] 0,4956901
> 0.4958032/0.456
[1] 1.08704