divideByReference: Divide assay columns by a reference column

Description Usage Arguments Details Value Examples

View source: R/transform.R

Description

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

Usage

1
divideByReference(obj, i, colDataCol, samplePattern = ".", refPattern)

Arguments

obj

A QFeatures object

i

A numeric() or character() vector indicating from which assays the rowData should be taken.

colDataCol

A character(1) indicating the variable to take from colData(obj) that gives the sample annotation.

samplePattern

A character(1) pattern that matches the sample encoding in colDataCol. By default all samples are devided (using the regex wildcard .).

refPattern

A character(1) pattern that matches the carrier encoding in colDataCol. 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

1
2
3
4
5
6
7
data("scp1")
scp1 <- divideByReference(scp1, 
                          i = 1, 
                          colDataCol = "SampleType",
                          samplePattern = "Macrophage",
                          refPattern = "Ref")
                          

scp documentation built on Nov. 8, 2020, 8:20 p.m.