ct.keyCheck {gCrisprTools} | R Documentation

## Check compatibility of a sample key with a supplied ExpressionSet or similar object

### Description

For many gCrisprTools functions, a sample key must be provided that specifies sample mapping to experimental groups. The sample key should be provided as a single, named factor whose names exactly correspond to the 'colnames()' of the 'ExpressionSet' containing the count data to be processed (or coercible as such). By convention, the first level corresponds to the control sample group.

This function checks whether the specified sample key is of the proper format and has properties consistent with the specified object.

### Usage

    ct.keyCheck(sampleKey, object)

### Arguments

`sampleKey` | A named factor, where the `levels` indicate the experimental replicate groups and the `names` match the `colnames` of the expression matrix contained in `object`. The first `level` should correspond to the control samples, but obviously there is no way to algorithmically control this.
`object` | An `ExpressionSet`, `EList`, or other matrix-like object with defined 'colnames()'.

### Value

Invisibly, a properly formatted 'sampleKey'.

### Author(s)

Russell Bainer

### Examples

    data('es')
    library(limma)
    library(Biobase)

    #Build the sample key
    sk <- relevel(as.factor(pData(es)$TREATMENT_NAME), 'ControlReference')
    names(sk) <- row.names(pData(es))
    ct.keyCheck(sk, es)

[Package gCrisprTools version 2.0.0 Index]