Fast imputation
Fast imputation via mode, mean, sampling according to allele frequencies, or 0.
snp_fastImputeSimple( Gna, method = c("mode", "mean0", "mean2", "random"), ncores = 1 )
Gna |
A FBM.code256
(typically |
method |
Either |
ncores |
Number of cores used. Default doesn't use parallelism. You may use nb_cores. |
A new FBM.code256
object (same file, but different code).
bigsnp <- snp_attachExtdata("example-missing.bed") G <- bigsnp$genotypes G[, 2] # some missing values G2 <- snp_fastImputeSimple(G) G2[, 2] # no missing values anymore G[, 2] # imputed, but still returning missing values G$copy(code = CODE_IMPUTE_PRED)[, 2] # need to decode imputed values G$copy(code = c(0, 1, 2, rep(0, 253)))[, 2] # "imputation" by 0
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.