Skip to content

Commit

Permalink
DeBUG with BLUE in I and N
Browse files Browse the repository at this point in the history
  • Loading branch information
jiabowang committed Apr 11, 2024
1 parent f708935 commit cd01e77
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion R/GAPIT.Main.R
Original file line number Diff line number Diff line change
Expand Up @@ -1407,7 +1407,7 @@ if((!byPass)&(!Model.selection)){
print("GAPIT before BLUP and BLUE")
#print(dim(p3d$BLUE))
BLUE=data.frame(cbind(data.frame(CV.taxa),data.frame(p3d$BLUE)))
print(head(BLUE))
# print(head(BLUE))
colnames(BLUE)=c("Taxa","BLUE.N","BLUE.I")
QTNs=rep(0,nrow(BLUE))
#Initial BLUP as BLUe and add additional columns
Expand Down
10 changes: 8 additions & 2 deletions R/GAPIT.SS.R
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,14 @@ if(DP$SNP.test)
DPP=DP$DPP,file.output=DP$file.output,Multi_iter=DP$Multi_iter,num_regwas=DP$num_regwas )
GWAS=myBus$GWAS
Pred=myBus$Pred

p=GWAS[,4]
# print(head(GWAS))
# print(head(ic_GM))
myBus$seqQTN=match(as.character(GWAS[p<(DP$cutOff/length(p)),1]),as.character(ic_GM[,1]))
myBus$seqQTN=myBus$seqQTN[!is.na(myBus$seqQTN)]
# BUS Prediction with gBLUP
# lmpred=TRUE

print(myBus$seqQTN)
if(buspred)
{
Expand Down Expand Up @@ -207,7 +212,8 @@ if(DP$SNP.test)
}
# cv.licols=GAPIT.Licols(X=busCV[,-1])
# geneGD=cv.licols$Xsub
# print(table(cv.licols$idx))
# print(dim(busCV))
# print(head(busCV))
# busCV=as.data.frame(busCV[,cv.licols$idx])
busCV=cbind(as.data.frame(busCV[,1]),matrix(as.numeric(as.matrix(busCV[,-1])),nrow(busCV),ncol(busCV)-1))

Expand Down
10 changes: 5 additions & 5 deletions R/GAPIT.SUPER.GS.R
Original file line number Diff line number Diff line change
Expand Up @@ -506,14 +506,14 @@ if(is.null(X0)) X0 <- matrix(1, ncol(ys), 1)
X.idx=XX$idx
if (is.null(Z)) Z=diag(x=1,nrow(K),ncol(K))

# print(my_allCV)
# print(head(X))

emma_REMLE <- EMMREML::emmreml(y=as.numeric(ys), X=as.matrix(X), K=as.matrix(K), Z=Z,varbetahat=TRUE,varuhat=TRUE, PEVuhat=TRUE, test=TRUE)
}else{
emma_REMLE=emma_test
print("gBLUP with only one time emma")
}
# print(dim(X))
# print(dim(my_allCV))

if (is.null(my_allCV))
{
Expand All @@ -534,13 +534,13 @@ if(is.null(X0)) X0 <- matrix(1, ncol(ys), 1)
beta.I=emma_REMLE$betahat[c((2+CV.Extragenetic):(ncol(XCV)-QTN.gs))]
beta.N=emma_REMLE$betahat[c(1:(1+CV.Extragenetic))]
if(QTN.gs!=0)beta.QTN=emma_REMLE$betahat[c((ncol(XCV)-QTN.gs):ncol(XCV))]
# print(dim(XCVN))
# print(length(beta.N))
# print(dim(XCVI))
# print(length(beta.I))
BLUE.N=XCVN%*%beta.N
BLUE.QTN=rep(0,length(BLUE.N))
if(QTN.gs!=0)BLUE.QTN=XCVqtn%*%beta.QTN
BLUE.I=rep(0,length(BLUE.N))
if(CV.Extragenetic!=0)BLUE.I=XCVI%*%beta.I
if(CV.Extragenetic!=(ncol(XCV)))BLUE.I=XCVI%*%beta.I
#Interception only
# print(dim(my_allX))
# print(length(emma_REMLE$betahat))
Expand Down

0 comments on commit cd01e77

Please sign in to comment.