# \donttest{
library(data.table)
library(kmeRtone)
# 1. Randomly generate genomic positions and save results
temp_dir <- tempdir()
set.seed(1234)
temp_files <- character(1)
for(chr in 1){
genomic_coor <- data.table::data.table(
seqnames = paste0("chr", chr),
start = sample(
x = 10000:10000000,
size = 100000,
replace = FALSE
),
width = 2
)
f <- file.path(temp_dir, paste0("chr", chr, ".csv"))
fwrite(genomic_coor, f)
temp_files[chr] <- f
}
rm_files <- file.remove(temp_files)
# }
Run the code above in your browser using DataLab