Description Usage Arguments Value Examples
Dataset containing number of Hi-C contact maps is used to sample interactions with or without replacement.
1 2 3 4 5 6 7 8 9 | bootstrap_dataset(
path,
ratio = list(c(0.5, 0.5)),
with.replacement = FALSE,
N = 3,
mtx.names = "all",
n.cores = 1,
save.path = NULL
)
|
path |
character path to Hi-C dataset in npz format |
ratio |
list with vectors - ratios for |
with.replacement |
logical which type of sampling |
N |
numeric number of repetitions, i.e. number of bootstraps; each bootstrap will have number of maps equal to length of corresponding entry in ratio list |
mtx.names |
character vector with subset of Hi-C maps names to be selected for analysis, by default all matrices are used |
n.cores |
numeric number of cores to be used for parallel processing |
list containing bootstraps of corresponding matrices of Hi-C dataset
1 2 3 4 5 6 7 8 9 10 11 12 | # say we have 2 Hi-C datasets: IMR90-MboI-1 and MSC-HindIII-1 in 40kb
npz1 <- read_npz("IMR90-MboI-1_40kb-raw.npz")
npz2 <- read_npz("MSC-HindIII-1_40kb-raw.npz")
# we want to produce 2*4 bootstraps of IMR90:
# 4 with the same number of interactions as in IMR90-MboI-1 and
# 4 with the same number of interactions as in MSC-HindIII-1
# first calculate number of interactions in both datasets on all chromosomes
nm <- intersect(names(npz1), names(npz2))
ratio <- lapply(nm, function(x) c(sum(npz1[[x]]$val), sum(npz2[[x]]$val)))
names(ratio) <- nm
# now produce bootstraps - pairs of bootstrap maps such that the number of interactions corresponds to first and second datasets can be used to asses technical variability including different sequencing depth
bts <- bootstrap_dataset("IMR90-MboI-1_40kb-raw.npz", N = 4, with.replacement = TRUE, ratio = ratio, save.path = "~/bootstrapped")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.