Overlays QC thresholds/criteria parsed from the panel XML (<QCThresholds>) on top of the hardcoded defaults produced by QCSampleCriteria, QCPlateCriteria, or QCTargetCriteria. Only the value-like fields (thresholds, operators, format, properNames, explanations) are overridden. thresholdNames (which link a flag to its computed metric) always come from the defaults, so the XML retunes an existing criterion's value/metadata but cannot re-map its computation. A flag whose metric the R code does not compute cannot be evaluated; such XML entries are ignored with a warning rather than silently dropped.

mergeQCCriteria(defaults, xmlThresh, forceDefaults = FALSE, TAP = TRUE)

Arguments

defaults

A criteria list from one of the QC*Criteria builders, or NULL (e.g. QCTargetCriteria(advancedQC=FALSE) on a plain RQ run) – there is nothing to override, so NULL is returned as-is rather than warning that every xmlThresh key is unmatched.

xmlThresh

Parsed XML thresholds (from readQCThresholdXMLNode), or NULL.

forceDefaults

Logical. If TRUE, ignore xmlThresh entirely and return defaults unchanged.

TAP

Logical. Whether the run is a TAP experiment; gates appliesWhen="TAP" rows.

Value

A criteria list with the same shape as defaults.

Details

Rows carrying appliesWhen="TAP" are applied only when TAP is TRUE (matching the existing TAP vs non-TAP default split).

Some criteria have parameters that are not exposed as thresholds and so cannot be retuned from the XML: the target-level Target_Min_Reads percentage is overridable but its underlying raw-read cutoff (MIN_TARGET_READS) is fixed in code.

Detectability (sample-level per-matrix, keyed as Detectability_PLASMA, Detectability_SERUM, ... in the XML and normalized to the internal Detectability.plasma form; plate-level Detectability; and target-level Target_Detectability) is informational-only by design (never flags pass/warning) and is deliberately not overridable from the XML, in any field, for any existing or new per-matrix key: many panel XML files carry a <QCThresholds> entry for Detectability that mirrors what used to be the hardcoded default (e.g. a real numeric threshold with operator "<"), which would otherwise silently re-enable flagging for every such panel. Any XML entry for these keys is ignored (with its own distinct warning, not just silently dropped) so Detectability stays informational regardless of what a panel's XML specifies.