YinLiLin / hibayes

:swimmer: Individual-Level, Summary-Level and Single-Step Bayesian Regression Models for Genomic Prediction and Genome-Wide Association Studies
GNU General Public License v3.0
48 stars 7 forks source link

Error in as.vector(data) : no method for coercing this S4 class to a vector #6

Open wtchoga opened 4 years ago

wtchoga commented 4 years ago

Hi Li

I am getting this error: Error in as.vector(data) : no method for coercing this S4 class to a vector; when I try to run

pve <- apply(geno,2,var) * (fit$g^2) / var(pheno[,1]).

Can you please advise.

YinLiLin commented 4 years ago

Thanks for using hibayes. Please try pve <- apply(as.matrix(geno),2,var) * (fit$g^2) / var(pheno[,1]).

wtchoga commented 4 years ago

fit <- bayes(y=pheno[, 1], X=geno, map=map, windsize=1e6, wppa=0.01, model="BayesCpi", niter=20000, nburn=10000, outfreq=10) Error in bayes(y = pheno[, 1], X = geno, map = map, windsize = 1e+06, : Factors or characters are not allowed in physical position.

YinLiLin commented 4 years ago

If you are trying to do GWAS using Bayes model, please make sure that all the physical positions in the map information should be in digital values, any character is unacceptable.