Repository navigation
metabolomics: run targeted panels in raw mode (platforms, internal standards, LOD, tank units) - #69
Merged
Merged
Conversation
…andards, LOD, tank units) The raw feature-table path had never run. It fitted two groups with TIC normalization and log2(x + 1), which suits an untargeted table but not a targeted MRM panel like DUPERRET2025_POMS_STARVE's Table S12: four platforms on different scales, spiked internal standards, and 0.0001 below-detection placeholders that log2(x + 1) treats as real intensities. New params.metabolomics options, all defaulting to the old behaviour: - normalization: tic | median | internal_standard, run within each value of an optional platform column; is_internal_standard rows are used only for normalization and never tested - detection_limit: values at or below it become missing, not zero - replicate_unit: average log2 values per unit (e.g. tank) before limma, refusing a unit in both arms, like the RNA-seq and methylation option - min_detected_per_arm: test only features detected in enough replicates; every feature is listed with its status in a missingness report - acquisition: untargeted | targeted, written to analysis_method limma now also writes lfcSE (posterior SE), which aree harmonize carries into standard_error, and the manifest records every params.metabolomics value instead of only the mode. The report template defines %||% for R < 4.4 and summarizes normalization and the detection filter. CI runs the raw DAG for real on a simulated targeted-panel fixture and checks that the planted effects come back and untestable features stay out. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
8 tasks done
pak could not solve bioc::limma (limma suggests vsn, which imports limma), so the whole R setup failed before any workflow ran. Install limma in its own step with hard dependencies only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
8 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The metabolomics workflow's
raw_reanalysispath had never been run. It fitted only two groups, using TIC normalization andlog2(x + 1). That's reasonable for an untargeted feature table but wrong for a targeted MRM panel. DUPERRET2025_POMS_STARVE's Table S12 is the first real case:0.0001below-detection placeholders, whichlog2(x + 1)would read as real intensities.This PR adds what a targeted panel needs. Every option defaults to the old behaviour, and the processed-mode demo is unchanged.
New
params.metabolomicsoptionsnormalizationtic(default),medianorinternal_standard. Runs separately within each value of an optionalplatformcolumn. Rows withis_internal_standardtrue are used for normalization only and are never tested.detection_limitreplicate_unitmin_detected_per_arm*_missingness.tsvwith its status.acquisitionuntargetedortargeted. Written to each row'sanalysis_method.Other changes
lfcSE(its posterior standard error).aree harmonizecarries it intostandard_errorand readsanalysis_method. Older processed tables without these columns harmonize as before; a new test covers both cases.params.metabolomicsvalue. Before, it recorded onlymode.%||%when it's missing (R < 4.4) and summarizes normalization and the detection filter.tests/fixtures/metabolomics_raw/).scripts/check_metabolomics_raw_smoke.pychecks three things: the planted effects come back (+2.0 → +1.98, −1.5 → −1.61, +1.0 → +0.84); internal standards and undetected features stay out of the results; and the manifest records the parameters. The CI R setup gainsbioc::limma.Verified locally: the processed demo, the raw fixture (
check_metabolomics_raw_smoke.pyandcheck_manifest_versions.py), the real DUPERRET2025_POMS_STARVE panel, the full test suite (609 passed) and ruff.The DUPERRET study files will come in a separate study PR, once the curation decision on its batch confound is made.
🤖 Generated with Claude Code