Rgb (version 1.5.1)

segMerge:

Description

Given a set of segments defined by "chrom", "start", "end" and various data, it merges consecutive rows (sorted by "chrom" then "start") that share same data. As an example, it is useful to merge consecutive regions of the genome sharing same copy numbers after modelization, or filling small gaps.

Usage

segMerge(segTable, on = names(segTable), fun = list(unique, start=min, end=max))

Arguments

segTable
A data.frame of segments, with at least "chrom", "start" and "end" columns. Standard behavior (default fun value) assumes "start" and "end" to be at least numeric, preferably integer.
on
Character vector, segTable columns that must all be identical for the consecutive rows to be merged. For convenience, "chrom" is forced in and "start" / "end" are forced out.
fun
A list of functions, defining how to merge values when merging rows. It should contain an unamed element for the default function, and named elements to deal with specific columns.

Value

Returns a data.frame similar to segTable.

See Also

segOverlap