Post date: Aug 14, 2015 5:35:37 PM
Variation among LGs in the density of trait QTN and candidate DSRs could lead to variation in Fst at this same level. This would be consistent with the hypothesis that a more concentrated architecture would lead to greater genome divergence. We tested this with our data using estimates of QTN per LG and the number of DSR each standardized by number of SNPs or number of 20 kb windows (this is a little odd as different draft genomes were used). I then took the mean Fst from the 20 kb windows for each of the four T. cristinae ecotype pairs. This was all done on my laptop, but the files are also on the DoRC cluster. The R code is below. The short answer is that the only signal is is a significant (spearman) or marginally significant (pearson) positive correlation between QTN density and Fst in HVA x HVC. T
Spearman's rank correlation rho
S = 94, p-value = 0.02044
alternative hypothesis: true rho is not equal to 0
sample estimates:
rho
0.6713287
Pearson's product-moment correlation
t = 2.0971, df = 10, p-value = 0.06238
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
-0.03109397 0.85529171
sample estimates:
cor
0.55267
R code:
TrBL<-as.matrix(read.table("pip_2013_BL_.txt",header=F))
TrBW<-as.matrix(read.table("pip_2013_BW_.txt",header=F))
TrHW<-as.matrix(read.table("pip_2013_HW_.txt",header=F))
TrlatGB<-as.matrix(read.table("pip_2013_latGB_.txt",header=F))
TrlatL<-as.matrix(read.table("pip_2013_latL_.txt",header=F))
TrlatRG<-as.matrix(read.table("pip_2013_latRG_.txt",header=F))
Trfpent<-as.matrix(read.table("pip_2013_fpent_.txt",header=F))
Trfhepta<-as.matrix(read.table("pip_2013_fhept_.txt",header=F))
Trfnona<-as.matrix(read.table("pip_2013_fnona_.txt",header=F))
Trmpent<-as.matrix(read.table("pip_2013_mpent_.txt",header=F))
Trmhepta<-as.matrix(read.table("pip_2013_mhept_.txt",header=F))
Trmnona<-as.matrix(read.table("pip_2013_mnona_.txt",header=F))
Trpatln<-as.matrix(read.table("pip_2013_patln_.txt",header=F))
Tlist<-list(TrBL,TrBW,TrHW,TrlatGB,TrlatL,TrlatRG,Trfpent,Trfhepta,Trfnona,Trmpent,Trmhepta,Trmnona)
lgPips<-matrix(NA,nrow=13,ncol=13)
for(i in 1:13){
lgPips[i,]<-1-tapply(X=1-Tlist[[i]][,4],INDEX=Tlist[[i]][,1],prod)
}
lgPipsN<-matrix(NA,nrow=13,ncol=13)
for(i in 1:13){
lgPipsN[i,]<-tapply(X=Tlist[[i]][,4],INDEX=Tlist[[i]][,1],sum)
}
lgNsnps<-matrix(NA,nrow=13,ncol=13)
for(i in 1:13){
lgNsnps[i,]<-tapply(X=Tlist[[i]][,4] > -10,INDEX=Tlist[[i]][,1],sum)
}
qtnStan<-lgPipsN/lgNsnps
qtnStanAll<-apply(qtnStan,2,sum)
## fst
parname<-c("pi","Dxy","Da","Fst")
d1<-matrix(scan("nei20k_tcrist_MR1",n=n1*7,sep=" "),nrow=n1,ncol=7,byrow=T)
d2<-matrix(scan("nei20k_tcrist_R12",n=n1*7,sep=" "),nrow=n1,ncol=7,byrow=T)
d3<-matrix(scan("nei20k_tcrist_L",n=n1*7,sep=" "),nrow=n1,ncol=7,byrow=T)
d4<-matrix(scan("nei20k_tcrist_HV",n=n1*7,sep=" "),nrow=n1,ncol=7,byrow=T)
parm<-7
lgScaf<-read.table("lgByScaf.txt",header=FALSE)
lgs<-rep(NA,n1)
for(i in 1:n1){lgs[i]<-lgScaf[which(lgScaf[,2]==d1[i,1]),1]}
fstLgMr1<-tapply(X=d1[,7], INDEX=lgs, mean)
fstLgR12<-tapply(X=d2[,7], INDEX=lgs, mean)
fstLgL<-tapply(X=d3[,7], INDEX=lgs, mean)
fstLgHV<-tapply(X=d4[,7], INDEX=lgs, mean)
fstmn<-(fstLgMr1+fstLgR12+fstLgL+fstLgHV)/4
fst<-c(fstLgMr1,fstLgR12,fstLgL,fstLgHV)
qtn<-rep(qtnStanAll[-9],4)
##
sc<-read.table("selectionCandidates.csv",header=TRUE,sep=",")
regs<-read.table("region20klist.txt",header=FALSE)
ll<-read.table("lgByScaf.txt",header=FALSE)
lgs<-rep(NA,dim(regs)[1])
for(i in 1:dim(regs)[1]){
lgs[i]<-ll[which(ll[,2]==regs[i,1]),1]
}
regs<-regs[order(lgs),]
slgs<-sort(lgs)
indxs<-which(regs[,1] %in% sc[,1] & regs[,2] %in% sc[,2])
dsr<-rep(0,13)
dsr[c(1:3,5:8,11:13)]<-table(slgs[indxs])
dsr<-dsr/table(slgs)
dsr<-dsr[-9]