sweepMode {VanillaICE} | R Documentation

## Sweep the modal log R ratio (by row or column) from a matrix of log R ratios

### Description

This function simplifies the process of sweeping the modal log R ratio from the rows or columns of a `SnpArrayExperiment` object. It is most useful when a large number of samples (more than 10) are available and the dataset is a collection of germline samples. We assume that the samples are from a single batch and that the modal value will be a robust estimate of the mean log R ratio for diploid copy number. Variation in the modal estimates between markers is presumed to be attributable to probe effects (e.g., differences hybridization efficiency/PCR do to sequence composition). For sex chromosomes, one should apply this function separately to men and women and then recenter the resulting matrix according to the expected copy number.

### Usage

    sweepMode(x, MARGIN)

    ## S4 method for signature 'SnpArrayExperiment'
    sweepMode(x, MARGIN)

### Arguments

`x` | see `showMethods(sweepMode)`
`MARGIN` | integer indicating which margin (1=rows, 2=columns) to sweep the mode

### Value

an object of the same class as `x`

### Examples

    data(snp_exp)
    snp_exp_rowcentered <- sweepMode(snp_exp, 1)
    snp_exp_colcentered <- sweepMode(snp_exp, 2)
    x <- lrr(snp_exp)
    x_rowcentered <- sweep(x, 1, rowModes(x))
    all.equal(lrr(snp_exp_rowcentered), x_rowcentered)

[Package VanillaICE version 1.52.0 Index]