subsetSegments {copynumber} | R Documentation

## Retrieve a subset of segments

### Description

This function returns a subset of segments according to the input and the specified chromosomes and/or samples.

### Usage

     subsetSegments(segments, chrom = NULL, sample = NULL, sep="\t", ...)

### Arguments

`segments` | either a data frame or the name of a tab-separated file from which segmentation results can be read. Segmentation results may come from `pcf`, `multipcf` or `aspcf`.
`chrom` | a numeric or character vector with chromosome(s) for which segments should be selected. If unspecified, all chromosomes in `segments` will be selected.
`sample` | a numeric vector indicating for which sample(s) segments should be selected. The number(s) should correspond to the sample's place (in order of appearance) in `segments`.
`sep` | the separator of the input files if `segments` is a file. Default is tab.
`...` | optional parameters to be passed to `read.table` in the case where `segments` is to be read from file.

### Value

A data frame containing the desired subset of segments.

### Author(s)

Gro Nilsen

### Examples

    #Load lymphoma data
    data(lymphoma)

    #Select segments only for samples 1 and 6 and chromosomes 1:9:
    segments <- pcf(lymphoma,gamma=12)
    sub.segments <- subsetSegments(segments=segments,chrom=c(1:9),sample=c(1,6))

[Package copynumber version 1.22.0 Index]