if (FALSE) {
library(BigDataStatMeth)
# Create test SNP data
snps <- matrix(sample(c(0, 1, 2), 1000, replace = TRUE,
prob = c(0.7, 0.2, 0.1)), 100, 10)
# Save to HDF5
fn <- "snp_data.hdf5"
bdCreate_hdf5_matrix(fn, snps, "genotype", "raw_snps",
overwriteFile = TRUE)
# Remove SNPs with high MAF
bdRemoveMAF_hdf5(
filename = fn,
group = "genotype",
dataset = "raw_snps",
outgroup = "genotype_filtered",
outdataset = "filtered_snps",
maf = 0.1,
bycols = TRUE,
blocksize = 50
)
# Cleanup
if (file.exists(fn)) {
file.remove(fn)
}
}
Run the code above in your browser using DataLab