pca COLORS:
cols<-c("#A11E22","#E8A631","#494940","#0C6950")
cols<-c("#00AFBB", "#E7B800", "#FC4E07","darkgray")
shapes<-c(5,16,17,22)
plot(mtcars.pca$x[,1], mtcars.pca$x[,2], col=cols[factor(mtcars.country)], pch=shapes[factor(mtcars.country)], cex=2)
##clines
pdf("clineparams_by_length.pdf", width=9, height=10) par(mfrow=c(3,1)) #all chromosomes #alpha alpha_table<-as.data.frame(table(alpha_mp_f$linkage)) #par(mgp=c(3.5,1,0)) par(mar=c(4,6,6,3)) hialphamod<-lm(hialphaL[,4]~hialphaL[,5]) plot(hialphaL[,5], hialphaL[,4], pch = 19, type = 'p', las = 1,xlab = "LG size (bp)",ylab = expression(paste(alpha)), cex.axis=1.2, cex.lab=1.5, main=" ") abline(hialphamod$coefficients) title(main=expression(bold(paste("(A) High ", alpha))), adj =0, cex.main=1.4) #mylabel = cor(hialphaL[,4], hialphaL[,5]) #text(x = 9108081, y = 3, labels = paste("R =", round(mylabel,2), sep = " "), cex=1.5) #Low alpha par(mar=c(4,6,6,3)) loalphamod<-lm(loalphaL[,4]~loalphaL[,5]) plot(loalphaL[,5], loalphaL[,4], pch = 19, type = 'p', las = 1,xlab = "LG size (bp)",ylab = expression(paste(alpha)), cex.axis=1.2, cex.lab=1.5, main=" ") abline(loalphamod$coefficients) title(main=expression(bold(paste("(A) Low ", alpha))), adj =0, cex.main=1.4) #mylabel = cor(loalphaL[,4], loalphaL[,5]) #text(x = 9108081, y = 3, labels = paste("R =", round(mylabel,2), sep = " "), cex=1.5) #High beta # 2/86 1/51 31/225 hibeta_prop<-cbind(as.data.frame(table(hibetaL[,3])), c(86,51,225), c(18437071,13701709,21870511)) colnames(hibeta_prop)[3]<-"total" colnames(hibeta_prop)[4]<-"length" hibeta_prop<-cbind(hibeta_prop, hibeta_prop[,2]/hibeta_prop[,3]) par(mar=c(4,6,6,3)) hibetamod<-lm(hibeta_prop[,5]~hibeta_prop[,4]) plot(hibeta_prop[,4], hibeta_prop[,5], pch = 19, type = 'p', las = 1,xlab = "LG size (bp)",ylab = "Proportion of SNPs", cex.axis=1.2, cex.lab=1.5, main=" ") abline(hibetamod$coefficients) title(main=expression(bold(paste("(A) High ", beta))), adj =0, cex.main=1.4) #mylabel = cor(hibetaL[,4], hibetaL[,5]) #text(x = 9108081, y = 3, labels = paste("R =", round(mylabel,2), sep = " "), cex=1.5) dev.off()