Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QUE about Heritability Estimation #47

Open
Yoledou opened this issue Apr 30, 2020 · 1 comment
Open

QUE about Heritability Estimation #47

Yoledou opened this issue Apr 30, 2020 · 1 comment

Comments

@Yoledou
Copy link

Yoledou commented Apr 30, 2020

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 !

@Yoledou
Copy link
Author

Yoledou commented May 6, 2020

Could you please help me to check the code ? Thanks a lot !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant