Score immunopeptidomics samples for overall quality
Source:R/quality-score.R
score_sample_quality.RdComputes a per-sample composite quality score (and a traffic-light category)
from pep_all, combining several interpretable dimensions: length-window
fidelity, 9-mer dominance, anchor-motif clarity (nested-core families for
class II), non-tryptic specificity, charge plausibility, depth, and
mass/RT/ion-mobility accuracy. Each raw metric
(qc_metrics_by_sample()) is mapped to a 0-100 sub-score (score_curve())
against either built-in defaults (quality_thresholds_default()) or
thresholds calibrated from tagged QC samples (calibrate_thresholds_from_qc()).
The composite is the weighted mean of the available sub-scores, so
undefined dimensions (e.g. MHC-II anchors, DIA-NN ppm) drop out instead of
penalising the sample.
Arguments
- pep_all
A unified
pep_alldata frame.- shortpep_range
Length-2 numeric
c(min, max)ligand-length window.- mhcclass
"MHC1","MHC1_mouse"(7-11 AA window, 8/9-mer canonical lengths) or"MHC2"; also selects the default threshold table.- qc_samples
Optional character vector of
Samplevalues flagged as QC controls (e.g. from an annotationQCcolumn). Used to mark samples and, whenthreshold_mode = "qc_relative", to calibrate thresholds.- threshold_mode
"default"(absolute literature thresholds) or"qc_relative"(thresholds derived fromqc_samples)."qc_relative"falls back to defaults if no QC samples are supplied.- thresholds
Optional scoring table overriding the class-appropriate
quality_thresholds_default()(which is used when this isNULL).- weights
Optional named numeric vector overriding the
weightcolumn ofthresholds(names = metric names).