segmentBins: Segment log2-transformed and GC-adjusted counts using...

View source: R/segment.R

segmentBinsR Documentation

Segment log2-transformed and GC-adjusted counts using Circular Binary Segmentation.

Description

Segmentation of the transformed counts is performed by the Circular Binary Segmentation (CBS) algorithm implemented in the DNAcopy package.

Usage

segmentBins(bins, param = SegmentParam(), ...)

Arguments

bins

a GRanges object containing adjusted counts. Note, the adjusted counts must be stored in a column named log_ratio.

param

a SegmentParam object

...

additional arguments to segment in the DNAcopy package

Details

A default set of segmentation parameters are provided in SegmentParam() and can be altered by creating a new SegmentParam object if desired.

Some users may wish to control additional parameters to the CBS algorithm and therefore segmentBins is designed to take any argument from DNAcopy::segment as input (see examples).

See Also

segment for description of circular binary segmentation and references therein; see SegmentParam-class for a description of the default parameters settings passed to the segment function. See binNormalize for obtaining normalized counts for segmentation.

Examples

  library(svfilters.hg19)
  data(bins1kb)
  library(GenomeInfoDb)
  library(DNAcopy)
  bins1kb <- keepSeqlevels(bins1kb, "chr22", pruning.mode = "coarse")
  bins1kb$log_ratio <- c(rnorm(ceiling(length(bins1kb)/2), mean = 0, sd = 0.4),
                        rnorm(floor(length(bins1kb)/2), mean = -1, sd = 0.4))
  segmentBins(bins1kb) # Using default segmentation parameters
  segmentBins(bins1kb, param = SegmentParam(alpha = 0.01, undo.splits = "sdundo",
                                            undo.SD = 5, verbose = 1))
  segmentBins(bins1kb, param = SegmentParam(),
              weights = abs(rnorm(length(bins1kb))))


cancer-genomics/trellis documentation built on Feb. 2, 2023, 7:04 p.m.