runSegmentation: Run Segmentation

View source: R/runSegmentation.R

runSegmentationR Documentation

Run Segmentation

Description

Runs a segmentation algorithm using the ratio data.

Usage

runSegmentation(
  scCNA,
  method = c("CBS", "multipcf"),
  seed = 17,
  alpha = 1e-05,
  merge_levels_alpha = 1e-05,
  gamma = 40,
  undo.splits = "prune",
  name = "segment_ratios",
  BPPARAM = bpparam()
)

Arguments

scCNA

The scCNA object

method

A character with the segmentation method of choice.

seed

Numeric. Set seed for CBS permutation reproducibility

alpha

A numeric with the significance levels for the test to accept change-points for CBS segmentation. See segment.

merge_levels_alpha

A numeric with the significance levels for the merge levels test to accept two different segments.

gamma

A numeric passed on to 'multipcf' segmentation. Penalty for each discontinuity in the curve. multipcf.

undo.splits

A character string specifying how change-points are to be undone, if at all. Default is "none". Other choices are "prune", which uses a sum of squares criterion, and "sdundo", which undoes splits that are not at least this many SDs apart. See segment

name

Character. Target slot for the resulting segment ratios.

BPPARAM

A BiocParallelParam specifying how the function should be parallelized.

Details

  • CBS: #' runSegmentation Fits a piece-wise constant function to the transformed the smoothed bin counts. Bin counts are smoothed with smooth.CNA using the Circular Binary Segmentation (CBS) algorithm from segment with default it applies undo.prune with value of 0.05.

  • multipcf: Performs the joint segmentation from the copynumber package using the multipcf function. By fitting piecewise constant curves with common breakpoints for all samples.

The resulting segment means are further refined with MergeLevels to join adjacent segments with non-significant differences in segmented means.

Value

The segment profile for all cells inside the scCNA object.

Examples

copykit_obj <- mock_bincounts(ncells = 10)
copykit_obj <- runSegmentation(copykit_obj)

navinlabcode/copykit documentation built on Oct. 16, 2024, 2:55 p.m.