# \donttest{
fn <- tempfile(fileext = ".h5")
snps <- matrix(sample(c(0, 1, 2), 200, replace = TRUE,
prob = c(.6, .3, .1)), 20, 10)
X <- hdf5_create_matrix(fn, "geno/raw", data = snps)
# Filter with auto output path (adds "_maf_filtered" suffix)
out <- filter_maf(X, maf_threshold = 0.05)
# Filter with explicit output
out2 <- filter_maf(X, out_group = "geno",
out_dataset = "maf_filtered", overwrite = TRUE)
hdf5_close_all()
unlink(fn)
# }
Run the code above in your browser using DataLab