computeSCR: Compute the sample over carrier ratio (SCR)

Description Usage Arguments Value Examples

View source: R/compute_metrics.R

Description

The function computes the ratio of the intensities of sample channels over the intentisty of the carrier channel for each feature. The ratios are averaged within the assay.

Usage

1
computeSCR(obj, i, colDataCol, samplePattern, carrierPattern)

Arguments

obj

A QFeatures object.

i

A character() or integer() indicating for which assay(s) the SCR needs to be computed.

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.

carrierPattern

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

Value

A QFeatures object for which the rowData of the given assay(s) is augmented with the mean SCR (.meanSCR variable).

Examples

1
2
3
4
5
6
7
8
data("scp1")
scp1 <- computeSCR(scp1, 
                   i = 1,
                   colDataCol = "SampleType",
                   carrierPattern = "Carrier",
                   samplePattern = "Blank|Macrophage|Monocyte")
## Check results
rowDataToDF(scp1, 1, ".meanSCR")

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