Difference between revisions of "Family-based Association Exercise"

From Statistical Genetics Courses

Jump to: navigation, search
 
Line 28: Line 28:
 
  names(new)<-c("SNP", "CHR", "BP", "P")
 
  names(new)<-c("SNP", "CHR", "BP", "P")
 
  head(new)
 
  head(new)
  jpeg("qqplot1.jpeg", height=500, width=500)
+
  jpeg("qqplot2.jpeg", height=500, width=500)
 
  qq(new$P)
 
  qq(new$P)
 
  dev.off()
 
  dev.off()
  jpeg("mh1.jpeg", height=500, width=800)
+
  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)
 
  manhattan(new, pch=20, suggestiveline=F, genomewideline=F, ymin=2, cex.x.axis=0.65, colors=c("black","dodgerblue"), cex=0.5)
 
  dev.off()
 
  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()