if (FALSE) {
library(BigDataStatMeth)
# Create test data with missing values
data <- matrix(sample(c(0, 1, 2, NA), 100, replace = TRUE), 10, 10)
# Save to HDF5
fn <- "snp_data.hdf5"
bdCreate_hdf5_matrix(fn, data, "genotype", "snps",
overwriteFile = TRUE)
# Impute missing values
bdImputeSNPs_hdf5(
filename = fn,
group = "genotype",
dataset = "snps",
outgroup = "genotype_imputed",
outdataset = "snps_complete",
bycols = TRUE,
paral = TRUE
)
# Cleanup
if (file.exists(fn)) {
file.remove(fn)
}
}
Run the code above in your browser using DataLab