divideByReference {scp} | R Documentation

## Divide assay columns by a reference column

### Description

The function divides the sample columns by a reference column. The sample and reference columns are defined based on the provided `colvar` variable and on regular expression matching.

### Usage

    divideByReference(object, i, colvar, samplePattern = ".", refPattern)

### Arguments

`object` | A `QFeatures` object
`i` | A `numeric()` or `character()` vector indicating from which assays the `rowData` should be taken.
`colvar` | A `character(1)` indicating the variable to take from `colData(object)` that gives the sample annotation.
`samplePattern` | A `character(1)` pattern that matches the sample encoding in `colvar`. By default all samples are devided (using the regex wildcard `.`).
`refPattern` | A `character(1)` pattern that matches the carrier encoding in `colvar`. Only one match per assay is allowed, otherwise only the first match is taken

### Details

The supplied assay(s) are replaced with the values computed after reference division.

### Value

A `QFeatures` object

### Examples

    data("scp1")
    scp1 <- divideByReference(scp1,
                              i = 1,
                              colvar = "SampleType",
                              samplePattern = "Macrophage",
                              refPattern = "Ref")

[Package scp version 1.4.0 Index]