Skip to content

Commit

Permalink
Avoid rare frequency genotype in the Random model
Browse files Browse the repository at this point in the history
  • Loading branch information
jiabowang committed Dec 12, 2023
1 parent 2d8d50a commit 95ca78a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 13 deletions.
16 changes: 3 additions & 13 deletions R/GAPIT.Numericalization.R
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ for(i in 1:len){
count[i]=length(x[(x==lev[i])])
}

#print(count)
# print(count)
# print(len)
# print()

if(Major.allele.zero){
if(len>1 & len<=3){
Expand Down Expand Up @@ -108,18 +110,6 @@ position=order(count)

#Jiabo creat this code to convert AT TA to 1 and 2.2018.5.29

# lev1=lev
# if(bit==2&len==3)
# {
# lev1[1]=lev[count==sort(count)[1]]
# lev1[2]=lev[count==sort(count)[2]]
# lev1[3]=lev[count==sort(count)[3]]
# position=c(1:3)
# lev=lev1
# }
#print(lev)
#print(position)
#print(inter)
#Jiabo code is end here
if(bit==1){
lev0=c("R","Y","S","W","K","M")
Expand Down
1 change: 1 addition & 0 deletions R/GAPIT.R
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,7 @@ if(!is.null(Y))
out=c(out,myG_simulation)
if(file.output)ViewPhenotype<-GAPIT.Phenotype.View(myY=myG_simulation$Y,traitname="Simulated.Phenotype",memo=memo0)
}
print("Now the GAPIT is cbind taxa and numeric genotype...")
out$GD=data.frame(cbind(as.data.frame(GT),as.data.frame(GD)))
out$GM=GI
out$G=myGenotype$G
Expand Down
4 changes: 4 additions & 0 deletions R/GAPIT.RandomModel.R
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ function(GWAS,Y,CV=NULL,X,cutOff=0.01,GT=NULL,name.of.trait=NULL,N.sig=NULL,n_ra
}
geneGD=X[,index,drop=FALSE]
geneGWAS=GWAS[index,,drop=FALSE]
var.gd=diag(var(geneGD))
var.index=var.gd>0.0001
geneGD=geneGD[,var.index]
geneGWAS=geneGWAS[var.index,]
if(ld.cut)
{
gene.licols=GAPIT.Licols(X=geneGD)
Expand Down

0 comments on commit 95ca78a

Please sign in to comment.