library(emBALVI)
#' @examples
data(phenotypes_potatoyield)
data(snp_NN_10_hmp)
# Prepare genotype
hmp <- as.data.frame(t(snp_NN_10_hmp),stringsAsFactors = FALSE)
colnames(hmp) <- hmp[1, ]
hmp <- hmp[-1, ]
hmp$Taxa <- rownames(hmp)
snp_matrix <- hmp[, -ncol(hmp)]
rownames(snp_matrix) <- hmp$Taxa
X <- convert_to_dosage(snp_matrix)
G <- buildGRM(X)
pheno <- phenotypes_potatoyield
Y <- pheno$y
B <- model.matrix(~1, pheno)

results <- emBALVI(Y, X, B, G, max_iter = 5)
plot_manhattan(results)
qq_plot <- plot_qq(results)
print(qq_plot)
head(results)
