extract_subranges {multicrispr} | R Documentation

## Extract subranges

### Description

Extract subranges from a `GRanges-class` object

### Usage

    extract_subranges(gr, ir, plot = FALSE)

### Arguments

`gr` | `GRanges-class`
`ir` | `IRanges-class`: subranges to be extracted
`plot` | TRUE or FALSE (default)

### Value

`GRanges-class`.

### Examples

    # Extract a subrange
    gr <- GenomicRanges::GRanges(c(A = 'chr1:1-100:+', B = 'chr1:1-100:-'))
    gr$targetname <- 'AB'
    ir <- IRanges::IRanges(c(A = '1-10', A = '11-20', B = '1-10', B = '11-20'))
    extract_subranges(gr, ir, plot = TRUE)

    # Return empty GRanges for empty IRanges
    extract_subranges(GenomicRanges::GRanges('chr1:345-456'), IRanges::IRanges())

[Package multicrispr version 1.4.3 Index]