setQCFlags: Set flags for QC of the assayData in a NanoStringRccSet.

setQCFlagsR Documentation

Set flags for QC of the assayData in a NanoStringRccSet.

Description

This function takes a list containing the quality control (QC) thresholds for data in a NanoStringRccSet and then returns a matrix of QC retults by sample to protocolData.

Usage

       setQCFlags(object, ...)

Arguments

object

A valid NanoStringRccSet object with all housekeeping genes, positive control probes, and negative control probes present

...

Additional arguments to pass

Details

This function checks that the housekeeping genes, positive control, and negative control probes or genes are within acceptable boundaries. Additional parameters with NanoStringRccSet method include:

qcCutoffs An optional list with members named Housekeeper, Imaging, BindingDensity, ERCCLinearity, and ERCCLoD

hkGenes An optional vector of housekeeping gene names if alternative genes to those defined in the panel are to be used

ReferenceSampleColumn An optional character string indicating the pData column containing reference sample information

Borderline thresholds and fail thresholds are defined and each sample receives a row in a matrix that contains flags indicating either borderline or failing performance.

Housekeeper is a vector with names members. failingCutoff sets the lower bound of housekeeper gene expression such that samples with a value below this threshold are labeled as failures. passingCutoff sets a lower bound of housekeeper gene expression such that samples with a value below this threshold are labeled as borderline. Values greater than or equal to either threshold are labeled as either borderline or passing. The default values are failingCutoff = 32 and passingCutoff = 100.

Imaging is a vector with a single named member fovCutoff. This threshold determines the mimimum proportion of FOV to be counted. The default value is 0.75.

BindingDensity is a named vector with members minimumBD, maximumBD, and maximumBDSprint. minimumBD sets a minimum threshold for binding density across machine platforms. maximumBD sets a maxmimum binding density for non-Sprint machines while maximumBDSprint does the same for Sprint machines. The default values are minimumBD = 0.1, maximumBD = 2.25, and maximumBDSprint = 1.8.

ERCCLinearity is a named vector with a single member correlationValue. This member sets a minimum threshold for the correlation between the observed counts of positive controls and their theoretical concentration. The default value is 0.95.

ERCCLoD is a named vector with a single member standardDeviations. This sets a minimum threshold for the 0.5uMol concentration to be above the geoMean of the negative controls in units of standard deviation of the negative controls. The default value is 2.

Value

This function returns a new NanoStringRccSet with matrices of QC pass and QC borderline criteria added to the protocolData slots called QCFlags and QCBorderlineFlags, respectively.

Examples

# Create NanoStringRccSet from data files
datadir <- system.file("extdata", "3D_Bio_Example_Data",
                       package = "NanoStringNCTools")
rccs <- dir(datadir, pattern = "SKMEL.*\\.RCC$", full.names = TRUE)
rlf <- file.path(datadir, "3D_SolidTumor_Sig.rlf")
pheno <- file.path(datadir, "3D_SolidTumor_PhenoData.csv")
solidTumor <-
  readNanoStringRccSet(rccs, rlfFile = rlf, phenoDataFile = pheno)

#Set QC flags with default cutoffs
solidTumorDefaultQC <- setQCFlags(solidTumor)
head( protocolData( solidTumorDefaultQC )[["QCFlags"]] )
head( protocolData( solidTumorDefaultQC )[["QCBorderlineFlags"]] )

#Update cutoffs
newQCCutoffs <- list(
  Housekeeper = c("failingCutoff" = 32,"passingCutoff" = 100) ,
  Imaging = c("fovCutoff" = 0.75) ,
  BindingDensity = c("minimumBD" = 0.1, "maximumBD" = 2.25, "maximumBDSprint" = 1.8) ,
  ERCCLinearity = c("correlationValue" = 0.98) ,
  ERCCLoD = c("standardDeviations" = 2)
  )

#Set QC flags with new cutoffs
solidTumorNewQC <- setQCFlags(solidTumor, qcCutoffs=newQCCutoffs)

#Compare QC results with default and new cutoffs
head( protocolData( solidTumorDefaultQC )[["QCFlags"]] )
head( protocolData( solidTumorNewQC )[["QCFlags"]] )

Nanostring-Biostats/NanoStringNCTools documentation built on April 19, 2024, 8:21 p.m.