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.
Arguments
- object
A
QFeaturesobject- i
A
numeric()orcharacter()vector indicating from which assays therowDatashould be taken.- colvar
A
character(1)indicating the variable to take fromcolData(object)that gives the sample annotation.- samplePattern
A
character(1)pattern that matches the sample encoding incolvar. By default all samples are devided (using the regex wildcard.).- refPattern
A
character(1)pattern that matches the carrier encoding incolvar. Only one match per assay is allowed, otherwise only the first match is taken
Examples
data("scp1")
scp1 <- divideByReference(scp1,
i = 1,
colvar = "SampleType",
samplePattern = "Macrophage",
refPattern = "Ref")