You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Dear Dr. Gustavo
The heritability I calculated using BGLR is significantly lower than the heritability reported in the literature. And no errors were reported during the BGLR operation.
The following is my own code. Is there something wrong? ?
(In the ETA settings, I set 'flock' and 'sex' in my dataset as fixed factors)
GBLUP: Heritability Estimation
library(BGLR)
setwd('F:\GS2\demo\275demo')
##dataset of phenotype
Y<-read.table("wool_1_2.txt",sep="\t",header=TRUE)
Y$SEX <- as.factor(Y$SEX) ##set sex into factor
Y$FLOCK <- as.factor(Y$FLOCK) ##set flock into factor
y<-Y[,7] select the trait “diameter of wool (DIA)”
##red_ped
out=read_ped("AMS286_QC_impute.ped")
p=out$p
n=out$n
out=out$x
out[out==2]=NA
out[out==3]=2
X=matrix(out,nrow=p,ncol=n, byrow=TRUE)
X=t(X)
X<-scale(X,center=TRUE,scale=TRUE)
G=tcrossprod(X)/ncol(X)
fm1=BGLR( y=y,ETA=list(list(~factor(FLOCK)+factor(SEX),data=Y,model='FIXED'),
list(K=G,model='RKHS')),
nIter=12000,burnIn=2000,saveAt='eig_'
)
The heritability of the diameter of wool in the literature is 0.57 ~ 0.59, but the heritability of the calculation after running the above code is 0.19, please help me check where the above code problems occur, why the difference is so great
Thanks a lot !
The text was updated successfully, but these errors were encountered:
Dear Dr. Gustavo
The heritability I calculated using BGLR is significantly lower than the heritability reported in the literature. And no errors were reported during the BGLR operation.
The following is my own code. Is there something wrong? ?
(In the ETA settings, I set 'flock' and 'sex' in my dataset as fixed factors)
GBLUP: Heritability Estimation
library(BGLR)
setwd('F:\GS2\demo\275demo')
##dataset of phenotype
Y<-read.table("wool_1_2.txt",sep="\t",header=TRUE)
Y$SEX <- as.factor(Y$SEX) ##set sex into factor
Y$FLOCK <- as.factor(Y$FLOCK) ##set flock into factor
y<-Y[,7] select the trait “diameter of wool (DIA)”
##red_ped
out=read_ped("AMS286_QC_impute.ped")
p=out$p
n=out$n
out=out$x
out[out==2]=NA
out[out==3]=2
X=matrix(out,nrow=p,ncol=n, byrow=TRUE)
X=t(X)
X<-scale(X,center=TRUE,scale=TRUE)
G=tcrossprod(X)/ncol(X)
fm1=BGLR( y=y,ETA=list(list(~factor(FLOCK)+factor(SEX),data=Y,model='FIXED'),
list(K=G,model='RKHS')),
nIter=12000,burnIn=2000,saveAt='eig_'
)
varE=scan( 'eig_varE.dat')
varU=scan('eig_ETA_G_varU.dat')
h2_2=varU/(varU+varE)
h2_2
mean(h2_2)
The heritability of the diameter of wool in the literature is 0.57 ~ 0.59, but the heritability of the calculation after running the above code is 0.19, please help me check where the above code problems occur, why the difference is so great
Thanks a lot !
The text was updated successfully, but these errors were encountered: