Simulation with GAPIT

source("http://zzlab.net/GAPIT/gapit_functions.txt") 
myGD=read.table(file="http://zzlab.net/GAPIT/data/mdp_numeric.txt",head=T) 
myGM=read.table(file="http://zzlab.net/GAPIT/data/mdp_SNP_information.txt",head=T)
index1to5=myGM[,2]<6 

set.seed(99164) 
mySim=GAPIT.Phenotype.Simulation(GD=myGD[,c(TRUE,index1to5)],
GM=myGM[index1to5,],
h2=.7,
NQTN=40, 
effectunit =.95,
QTNDist="normal")

FarmCPU within GAPIT

setwd("~/Desktop/CROP_545/Liang_Lab/Lab10/FarmCPU")
myGAPIT_FarmCPU <- GAPIT(
Y=mySim$Y,
GD=myGD,#Genotype
GM=myGM,#Map information
PCA.total=3,
QTN.position=mySim$QTN.position,
model="FarmCPU")
p1<-myGAPIT_FarmCPU$GWAS$P.value
color.vector <- rep(c("deepskyblue", "orange", "forestgreen", "indianred3"), 10)
# number of SNPs
m = nrow(myGM) 
plot(-log10(p1) ~ seq(1:m), col = color.vector[myGM[, 2]]) 
# True QTN position
abline(v = mySim$QTN.position, lty = 2, lwd = 1, col = "gray")
abline(h = -log10(0.05/m), lty = 1, lwd = 2, col = "black")