diff --git a/R/GAPIT.EMMAxP3D.R b/R/GAPIT.EMMAxP3D.R index 0f590cd..6a53a42 100644 --- a/R/GAPIT.EMMAxP3D.R +++ b/R/GAPIT.EMMAxP3D.R @@ -421,7 +421,8 @@ } m <- ncol(xs) #number of SNPs t <- nrow(xs) #number of individuals - + # print(m) + # print(t) Timmer=GAPIT.Timmer(Timmer=Timmer,Infor="Before cleaning") Memory=GAPIT.Memory(Memory=Memory,Infor="Before cleaning") #allocate spaces for SNPs @@ -620,6 +621,7 @@ #if(i == 1) {print("the head of X for running GWAS is")} #if(i == 1) {print(head(X))} } + # print(X) } #end of i >0 | file>file.from|frag>1 #Recalculate eig and REML if not using P3D NOTE THIS USED TO BE BEFORE the two solid lines if(SNP.P3D==FALSE & !is.null(K)) @@ -759,7 +761,9 @@ } beta <- crossprod(iXX,XY) #Note: we can use crossprod here becase iXX is symmetric - + # print(iXX) + # print(XY) + # print(beta) #--------------------------------------------------------------------------------------------------------------------< if(i ==0 &file==file.from &frag==1) { diff --git a/R/GAPIT.HapMap.R b/R/GAPIT.HapMap.R index 1d57cb4..4360b66 100644 --- a/R/GAPIT.HapMap.R +++ b/R/GAPIT.HapMap.R @@ -29,7 +29,8 @@ function(G,SNP.effect="Add",SNP.impute="Middle",heading=TRUE, Create.indicator = #print(paste("Number of bits for genotype: ", bit)) print("Perform numericalization") - + # Gtest=G[-1,-(1:11)] + # print(Gtest[1:5,1:6]) if(heading){ if(!Create.indicator) GD= apply(G[-1,-(1:11)],1,function(one) GAPIT.Numericalization(one,bit=bit,effect=SNP.effect,impute=SNP.impute, Major.allele.zero=Major.allele.zero)) if(Create.indicator) GD= t(G[-1,-(1:11)]) @@ -43,9 +44,7 @@ function(G,SNP.effect="Add",SNP.impute="Middle",heading=TRUE, Create.indicator = GT=NULL GI=NULL } - - #print("The dimension of GD is:") - #print(dim(GD)) + # print(GD[1:6,1:5]) if(!Create.indicator) {print(paste("Succesfuly finished converting HapMap which has bits of ", bit,sep="")) } diff --git a/R/GAPIT.Main.R b/R/GAPIT.Main.R index b06ac06..2b46ddb 100644 --- a/R/GAPIT.Main.R +++ b/R/GAPIT.Main.R @@ -692,7 +692,7 @@ function(Y, #Z1=matrix(as.numeric(as.matrix(zc$Z[,-1])),nrow=zrow,ncol=zcol) Timmer=GAPIT.Timmer(Timmer=Timmer,Infor="Prio PreP3D") Memory=GAPIT.Memory(Memory=Memory,Infor="Prio PreP3D") - # print(optOnly) + # print(colInclude) # print(head(CVI)) p3d <- GAPIT.EMMAxP3D(ys=ys, xs=as.matrix(as.data.frame(GD[,colInclude])), diff --git a/R/GAPIT.Numericalization.R b/R/GAPIT.Numericalization.R index d850087..f7a2c2d 100644 --- a/R/GAPIT.Numericalization.R +++ b/R/GAPIT.Numericalization.R @@ -114,9 +114,9 @@ position=order(count) if(bit==1){ lev0=c("R","Y","S","W","K","M") inter=intersect(lev,lev0) -}else{ - inter=lev -} +}#else{ + #inter=lev +#}# #1status other than 2 or 3 if(len<=1 | len> 3)x=0 @@ -124,17 +124,17 @@ if(len<=1 | len> 3)x=0 #2 status if(len==2) { - if(!setequal(character(0),inter)) { x=ifelse(x=="N",NA,ifelse(x==inter,1,0)) - }else{ + }else{ x=ifelse(x=="N",NA,ifelse(x==lev[1],0,2)) # the most is set 0, the least is set 2 } } #3 status -if(bit==1){ +if(bit==1) +{ if(len==3)x=ifelse(x=="N",NA,ifelse(x==lev[1],0,ifelse(x==lev[3],1,2))) }else{ if(len==3)x=ifelse(x=="N",NA,ifelse(x==lev[lev!=inter][1],0,ifelse(x==inter,1,2)))