Reputation: 11
I want to generate 200 random genomicranges that are 200kbp long each that can occur anywhere in the genome. I was recommended to try using nullranges, but I haven't figured out how to specify only generating 200 ranges / iteration. I think it takes the number of features from the original dataset. But if I am to use my original dataset (which has 200 features), how will it be genome-wide and different from my data?
I tried an example where we use the whole genome and segment by density, but it outputs 6000 ranges when I only want 200 ranges / iteration.
library(nullrangesData)
library(plyranges)
library(nullranges)
# loaded example genome
dhs <- DHSA549Hg38()
dhs <- dhs %>% plyranges::filter(signalValue > 100) %>%
mutate(id = seq_along(.)) %>%
plyranges::select(id, signalValue)
length(dhs)
# regions to exclude and segment based on gene density
suppressPackageStartupMessages(library(ExperimentHub))
eh = ExperimentHub()
exclude <- eh[["EH7306"]]
seg_cbs <- eh[["EH7307"]]
plotSegment(seg_cbs,exclude,type = "ranges")
# run bootstrap, but outputs same number of features as dhs in boots
set.seed(5)
R <- 1
blockLength <- 2e5
boots <- bootRanges(dhs, blockLength, R = R, seg = seg_cbs, exclude = exclude)
boots
Upvotes: 1
Views: 38