computeSCR {scp}R Documentation

Compute the sample over carrier ratio (SCR)

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

computeSCR(
  object,
  i,
  colDataCol,
  samplePattern,
  carrierPattern,
  rowDataName = "MeanSCR"
)

Arguments

object

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(object) 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

rowDataName

A character(1) giving the name of the new variable in the rowData where the computed SCR will be stored. The name cannot already exist in any of the assay rowData.

Value

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

Examples

data("scp1")
scp1 <- computeSCR(scp1, 
                   i = 1,
                   colDataCol = "SampleType",
                   carrierPattern = "Carrier",
                   samplePattern = "Blank|Macrophage|Monocyte",
                   rowDataName = "MeanSCR")
## Check results
rowDataToDF(scp1, 1, "MeanSCR")


[Package scp version 1.2.0 Index]