consensus_r: Calculate consensus segments from a list of segmentation...

Description Usage Arguments

View source: R/consseg_r.R

Description

This R implementation is maintained for debugging and testing Rcpp code against expected results. If test==TRUE the Delta of the recursion is additionally calculated directly (very inefficiently) to compare results with an explicitly correct calculation. This can also be useful when testing potential functions that can yield large numbers and thereby cause rounding errors.

Usage

1
2
3
4
5
6
7
8
9
consensus_r(
  b,
  n,
  w,
  e = function(L, n) L^2/2,
  store = FALSE,
  test = FALSE,
  rel.tol = 1e-08
)

Arguments

b

list of breakpoints of different segmentations.

n

total sequence length (max(b) if not provided).

w

weights vector, must sum up to 1 or will be normalized.

e

potential function, taking two arguments: the length L of the evaluated interval and the total sequence length n.

store

for debugging: store and return all internal vectors.

test

for debugging: calculate Delta directly without using delta helpers. This is very slow but straightforward to implement, the resulting Delta is tested against the Delta of the fast implementation, and results can be used to test other implementations (eg. in Rcpp).

rel.tol

relative error tolerance to report and count differences in Delta during test mode (test==TRUE).


Bierinformatik/consseg documentation built on March 18, 2021, 1:33 p.m.