subdivideGRanges: Subdivide ranges of a GRanges object into nearly equal width...

Description Usage Arguments Value See Also Examples

Description

Takes an input GRanges object and, splits each range into multiple ranges of nearly equal width. For an input range of width w and subdividing size s, it will subdivide the range into max(1,floor(w/s)) nearly equal width ranges. The output is then a new GRanges object. This function can be used to split the targeted region (such as exons in exome enrichment experiments) into nearly equal width ranges. The ranges will be sorted and reduced if they are not already so.

Usage

1
  subdivideGRanges(x,subsize=100)

Arguments

x

An object of type GRanges.

subsize

The desired width for the ranges in the output GRanges object.

Value

A GRanges object with ranges from the input GRanges object subdivided to nearly subsize.

See Also

GRanges

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
  ## read in target region BED file
  target.file <- system.file("extdata", "targets.bed", package="exomeCopy")
  target.df <- read.delim(target.file, header=FALSE,
col.names=c("seqname","start","end")) 

  ## create GRanges object with 5 ranges over 2 sequences
  target <- GRanges(seqname=target.df$seqname,
               IRanges(start=target.df$start,end=target.df$end))

  ## subdivide into 7 smaller genomic ranges
  target.sub <- subdivideGRanges(target)

Example output

Loading required package: IRanges
Loading required package: BiocGenerics
Loading required package: parallel

Attaching package: 'BiocGenerics'

The following objects are masked from 'package:parallel':

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
    clusterExport, clusterMap, parApply, parCapply, parLapply,
    parLapplyLB, parRapply, parSapply, parSapplyLB

The following objects are masked from 'package:stats':

    IQR, mad, sd, var, xtabs

The following objects are masked from 'package:base':

    Filter, Find, Map, Position, Reduce, anyDuplicated, append,
    as.data.frame, cbind, colMeans, colSums, colnames, do.call,
    duplicated, eval, evalq, get, grep, grepl, intersect, is.unsorted,
    lapply, lengths, mapply, match, mget, order, paste, pmax, pmax.int,
    pmin, pmin.int, rank, rbind, rowMeans, rowSums, rownames, sapply,
    setdiff, sort, table, tapply, union, unique, unsplit, which,
    which.max, which.min

Loading required package: S4Vectors
Loading required package: stats4

Attaching package: 'S4Vectors'

The following object is masked from 'package:base':

    expand.grid

Loading required package: GenomicRanges
Loading required package: GenomeInfoDb
Loading required package: Rsamtools
Loading required package: Biostrings
Loading required package: XVector

Attaching package: 'Biostrings'

The following object is masked from 'package:base':

    strsplit

exomeCopy documentation built on Nov. 8, 2020, 7:45 p.m.