copy_number_segments: Collapse copy number bins into segments

Description Usage Arguments Details Value Examples

View source: R/utils.R

Description

Collapses copy number segments for the given copy number data frame.

Usage

1

Arguments

copy_number

a data frame containing sample, chromosome, start, end and segmented columns.

Details

Adjacent bins with the same segmented copy number (segmented column) for the same sample and on the same chromosome are treated as belonging to the same segment.

The returned data frame contains a row for each segment with columns for the segment number (segment), the number of bins or rows in the provided copy number data frame that were collapsed to form the segment (bin_count), the sum of lengths of those bins (sum_of_bin_lengths) and the weight for the segment weight). The segment weight is the median-scaled sum of bin lengths.

Value

a data frame containing copy number segments with segment, sample, chromosome, start, end, copy_number, bin_count, sum_of_bin_lengths and weight.

Examples

1
2
3
4
5
6
7
8
data(copy_number)

# segments for all samples
segments <- copy_number_segments(copy_number)

# segments for single sample
copy_number <- copy_number[copy_number$sample == "X17222", ]
segments <- copy_number_segments(copy_number)

crukci-bioinformatics/rascal documentation built on Dec. 19, 2021, 6:21 p.m.