segment {CODEX} | R Documentation

## Recursive segmentation algorithm for CNV detection and genotyping

### Description

Recursive segmentation algorithm for CNV detection and genotyping, using normalized read depth from whole exome sequencing.

### Usage

    segment(Y_qc, Yhat, optK, K, sampname_qc, ref_qc, chr, lmax, mode)

### Arguments

`Y_qc` | Raw read depth matrix after quality control procedure returned from `qc`
`Yhat` | Normalized read depth matrix returned from `normalize`
`optK` | Optimal value `K` returned from `choiceofK`
`K` | Number of latent Poisson factors. Can be an integer if optimal solution has been chosen or a vector of integers so that AIC, BIC, and RSS are computed for choice of optimal k.
`sampname_qc` | Vector of sample names after quality control procedure returned from `qc`
`ref_qc` | IRanges object of genomic positions of each exon after quality control procedure returned from `qc`
`chr` | Chromosome number returned from `getbambed`
`lmax` | Maximum CNV length in number of exons returned.
`mode` | Can be either "integer" or "fraction", which respectively correspond to format of the returned copy numbers.

### Value

Final callset of CNVs with genotyping results.

### Author(s)

Yuchao Jiang yuchaoj@wharton.upenn.edu

### See Also

`normalize`, `choiceofK`

### Examples

    Y_qc <- qcObjDemo$Y_qc
    Yhat <- normObjDemo$Yhat
    BIC <- normObjDemo$BIC
    K <- normObjDemo$K
    sampname_qc <- qcObjDemo$sampname_qc
    ref_qc <- qcObjDemo$ref_qc
    chr <- bambedObjDemo$chr
    finalcall <- segment(Y_qc, Yhat, optK = K[which.max(BIC)], K = K, sampname_qc,
        ref_qc, chr, lmax = 200, mode = "integer")
    finalcall

[Package CODEX version 1.16.0 Index]