bootRanges {nullranges} | R Documentation

## Block bootstrap for genomic ranges

### Description

Performs a block bootstrap, optionally with respect to a genome segmentation. Returns a `bootRanges` object, which is a GRanges object with all the ranges concatenated, and iteration and block length indicated by metadata columns

### Usage

    bootRanges(
      y,
      blockLength,
      R = 1,
      seg = NULL,
      exclude = NULL,
      excludeOption = c("drop", "trim"),
      proportionLength = TRUE,
      type = c("bootstrap", "permute"),
      withinChrom = FALSE
    )

### Arguments

`y` | the GRanges to bootstrap sample
`blockLength` | the length of the blocks (for proportional blocks, this is the maximal length of a block)
`R` | the number of bootstrap samples to generate
`seg` | the segmentation GRanges, with a column ("state") indicating segmentation state (optional)
`exclude` | the GRanges of excluded regions (optional)
`excludeOption` | whether to `"drop"` or `"trim"` bootstrap ranges that overlap a excluded region
`proportionLength` | for the segmented block bootstrap, whether to use scaled block lengths, (scaling by the proportion of the segmentation state out of the total genome length)
`type` | the type of null generation (un-segmented bootstrap only)
`withinChrom` | whether to re-sample (bootstrap) ranges across chromosomes (default) or only within chromosomes (un-segmented bootstrap only)

### Value

a bootRanges (GRanges object) with the bootstrapped ranges, where iteration and block length are recorded as metadata columns

### Examples

    set.seed(1)
    library(GenomicRanges)
    gr <- GRanges("chr1", IRanges(0:4 * 10 + 1, width=5),
                  seqlengths=c(chr1=50))
    br <- bootRanges(gr, blockLength=10)

[Package nullranges version 1.0.1 Index]