Post date: Apr 17, 2014 7:35:16 PM
I tested for correlations between the model-average SNP effects across different experiments and combinations of experiments. All SNP effects are model-averaged from the BSLMM analysis in gemma, that is alpha + beta * gamma. The single experiment effects are based on the linear (weight) or probit (survival) likelihood, whereas the combined experiments all use the linear but after removing the effects of population or plant. The tables below give the pearson correlation coefficients (lower-triangle) and p-values (upper-triangle).
survival, individual experiments
weight, individual experiments
survival, combined
weight, combined
All correlations between effects on weight and survival were non-significant.
Figures summarizing these results, genArchCor*.png, are in ~/Documents/manuscripts/melissa_host_performance/figs/.
Here is the R code for the combined analysis (the scripts for each are in projects/lycaeides_hostplant/scripts/melGemma/ and are analyzeSnpEffects*.R):
## R code to compare individual SNP effects among experiment combinations
## survival, combined experiments, linear model on residuals
surv<-read.table("results/effectsCombSurvTotal.txt",header=TRUE)
surv<-surv[,c(1,2,5,7,3,6,4)]
cors<-matrix(NA,nrow=5,ncol=5)
for(i in 2:5){
for(j in 1:(i-1)){
out<-cor.test(surv[,i+2],surv[,j+2])
cors[i,j]<-out$estimate
cors[j,i]<-out$p.value
}
}
## adult weight, normal quantile transformed
wgt<-read.table("results/effectsCombWgtTotal.txt",header=TRUE)
wgt<-wgt[,c(1,2,5,7,3,6,4)]
corw<-matrix(NA,nrow=5,ncol=5)
for(i in 2:5){
for(j in 1:(i-1)){
out<-cor.test(wgt[,i+2],wgt[,j+2])
corw[i,j]<-out$estimate
corw[j,i]<-out$p.value
}
}
## cross index survival and wgt loci
cross<-rep(NA,dim(surv)[1])
for(i in 1:length(cross)){
out<-which((wgt[,1] == surv[i,1]) & (wgt[,2] == surv[i,2]))
if(length(out) == 1){
cross[i]<-out
}
}
X<-which(is.na(cross)==FALSE)
corsw<-matrix(NA,nrow=5,ncol=2)
for(i in 1:5){
out<-cor.test(surv[X,i+2],wgt[cross[X],i+2])
corsw[i,1]<-out$estimate
corsw[i,2]<-out$p.value
}
## plots
png("genArchCorComb.png",width=2965,height=2965)
layout(matrix(1:36,nrow=6,ncol=6,byrow=TRUE),widths=c(1,rep(4,5)),heights=c(1,rep(4,5)))
par(pty='m')
par(mar=c(0,0,0,0))
plot(c(0,1),type='n',axes=F,xlab="",ylab="")
explist<-c("GLA","SLA","Ac","Ms","all")
for(j in 1:5){
plot(c(0,1),c(0,1),type='n',axes=F,xlab="",ylab="")
text(0.3,0.4,explist[j],adj=0,cex=7)
}
for(i in 1:5){
par(pty='m')
par(mar=c(0,0,0,0))
plot(c(0,1),c(0,1),type='n',axes=F,xlab="",ylab="")
text(0.6,0.3,explist[i],srt=90,adj=0,cex=7)
par(pty='s')
par(mar=c(1.5,1.5,1,1))
for(j in 1:5){
if(i < j){## surv by surv
x<-surv[,i+2]
y<-surv[,j+2]
}
else if(i > j){## wgt by wgt
x<-wgt[,i+2]
y<-wgt[,j+2]
}
else{
x<-surv[X,i+2]
y<-wgt[cross[X],j+2]
}
plot(x,y,type='n',xlab="",ylab="",axes=FALSE,cex=2,pch=20)
abline(h=0,col="gray",lty=2,lwd=4)
abline(v=0,col="gray",lty=2,lwd=4)
points(x,y,xlab="",ylab="",cex=2.6,pch=20)
if ((i < j) & (cors[i,j] < 0.01)){## surv by surv
r<-round(cors[j,i],3)
title(main=paste(" r = ",r),line=-6,adj=0,cex.main=7)
}
if ((j < i) & (corw[j,i] < 0.01)){## wgt by wgt
r<-round(corw[i,j],3)
title(main=paste(" r = ",r),line=-6,adj=0,cex.main=7)
}
box()
}}
dev.off()