Abstract
RATIONALE: The quality of analytical measurements is typically evaluated after completion of the entire, or possibly multiple, measurement batch(es). Automated, near real-time quality control (QC) during LC-HRMS acquisition can prevent reruns and sample loss by flagging issues as they occur. Functionality was evaluated by retrospective application to 5 years of river-water surveillance. METHODS: We present a modular MATLAB workflow that tracks isotopically labelled internal standards for peak height, retention time and mass error against rolling, method-specific expectations; applies multivariate statistical process control (MSPC; PCA with Hotelling's T(2) and SPE on intensity/retention time ratios and mass error); issues immediate email alerts; and logs outcomes to a PostgreSQL database/Grafana dashboard for trend analysis. Also, qualitative target screening via cosine-similarity MS(2) checks against a local library, retention time correction, robust peak-height/noise estimation, configurable limits and automated vendor-to-open format conversion. RESULTS: In a high-voltage power-supply failure, 25/25 injections were flagged due to abnormal intensity patterns; during an organic-pump malfunction, 17/25 were flagged for retention drift up to and beyond the extraction window; and during an air-conditioning (AC) outage, MSPC detected mass error anomalies even when the ±10 ppm univariate limit was not breached. MSPC closely agreed with univariate thresholds: 95.7% of samples flagged by univariate rules were also flagged by MSPC (≈4.3% Type II), while 92.5% of MSPC-flagged samples violated at least one univariate rule (≈7.5% Type I). CONCLUSION: These capabilities enable immediate detection, triage and documentation of performance excursions, support proactive maintenance (e.g., column aging or pump delivery issues), minimise downtime and safeguard precious samples. Although showcased on a specific LC-HRMS setup and matrix, the workflow is instrument-agnostic and broadly applicable to internal-standardised LC-HRMS methods.