Difference between revisions of "Family-based Association Exercise"

From Statistical Genetics Courses

Jump to: navigation, search
 
(3 intermediate revisions by the same user not shown)
Line 2: Line 2:
  
 
==Family-based Association Exercise==
 
==Family-based Association Exercise==
 
+
cd exercises/cordell/FASTLMM_GCTA
cd exercises/cordell/FASTLMM_GCTA
+
ls -l
ls -l
+
plink --bfile quantfamdata --assoc --out plinkresults
plink --bfile quantfamdata --assoc --out plinkresults
+
R
R
+
res1<-read.table("plinkresults.qassoc", header=T)
res1<-read.table("plinkresults.qassoc", header=T)
+
head(res1)
head(res1)
+
source("qqmanHJCupdated.R")
source("qqmanHJCupdated.R")
+
jpeg("mh1.jpeg", height=500, width=800)
manhattan(res1, pch=20, suggestiveline=F, genomewideline=F, ymin=2, cex.x.axis=0.65, colors=c("black","dodgerblue"), cex=0.5)
+
manhattan(res1, pch=20, suggestiveline=F, genomewideline=F, ymin=2, cex.x.axis=0.65, colors=c("black","dodgerblue"), cex=0.5)
qq(res1$P)
+
dev.off()
chi<-(qchisq(1-res1$P,1))
+
jpeg("qqplot1.jpeg", height=500, width=500)
lambda=median(chi)/0.456
+
qq(res1$P)
lambda
+
dev.off()
fastlmmc -bfile quantfamdata -pheno quantfamdata.fam -mpheno 4 -bfileSim quantfamdata -ML -out FLMMresults
+
chi<-(qchisq(1-res1$P,1))
R
+
lambda=median(chi)/0.456
res2<-read.table("FLMMresults", header=T)
+
lambda
head(res2)
+
fastlmmc -bfile quantfamdata -pheno quantfamdata.fam -mpheno 4 -bfileSim quantfamdata -ML -out FLMMresults
chi<-(qchisq(1-res2$Pvalue,1))
+
R
lambda=median(chi)/0.456
+
res2<-read.table("FLMMresults", header=T)
lambda
+
head(res2)
new<-data.frame(res2$SNP, res2$Chromosome, res2$Position, res2$Pvalue)
+
chi<-(qchisq(1-res2$Pvalue,1))
names(new)<-c("SNP", "CHR", "BP", "P")
+
lambda=median(chi)/0.456
head(new)
+
lambda
qq(new$P)
+
new<-data.frame(res2$SNP, res2$Chromosome, res2$Position, res2$Pvalue)
manhattan(new, pch=20, suggestiveline=F, genomewideline=F, ymin=2, cex.x.axis=0.65, colors=c("black","dodgerblue"), cex=0.5)
+
names(new)<-c("SNP", "CHR", "BP", "P")
 +
head(new)
 +
jpeg("qqplot2.jpeg", height=500, width=500)
 +
qq(new$P)
 +
dev.off()
 +
jpeg("mh2.jpeg", height=500, width=800)
 +
manhattan(new, pch=20, suggestiveline=F, genomewideline=F, ymin=2, cex.x.axis=0.65, colors=c("black","dodgerblue"), cex=0.5)
 +
dev.off()

Latest revision as of 19:33, 24 January 2019

Family-based Association Exercise

cd exercises/cordell/FASTLMM_GCTA
ls -l
plink --bfile quantfamdata --assoc --out plinkresults
R
res1<-read.table("plinkresults.qassoc", header=T)
head(res1)
source("qqmanHJCupdated.R")
jpeg("mh1.jpeg", height=500, width=800)
manhattan(res1, pch=20, suggestiveline=F, genomewideline=F, ymin=2, cex.x.axis=0.65, colors=c("black","dodgerblue"), cex=0.5)
dev.off()
jpeg("qqplot1.jpeg", height=500, width=500)
qq(res1$P)
dev.off()
chi<-(qchisq(1-res1$P,1))
lambda=median(chi)/0.456
lambda
fastlmmc -bfile quantfamdata -pheno quantfamdata.fam -mpheno 4 -bfileSim quantfamdata -ML -out FLMMresults
R
res2<-read.table("FLMMresults", header=T)
head(res2)
chi<-(qchisq(1-res2$Pvalue,1))
lambda=median(chi)/0.456
lambda
new<-data.frame(res2$SNP, res2$Chromosome, res2$Position, res2$Pvalue)
names(new)<-c("SNP", "CHR", "BP", "P")
head(new)
jpeg("qqplot2.jpeg", height=500, width=500)
qq(new$P)
dev.off()
jpeg("mh2.jpeg", height=500, width=800)
manhattan(new, pch=20, suggestiveline=F, genomewideline=F, ymin=2, cex.x.axis=0.65, colors=c("black","dodgerblue"), cex=0.5)
dev.off()