Repository navigation
[FEATURE] Simple, targeted, fast IsobaricWorkflow - #7298
Conversation
| file_it != consensus_map.getColumnHeaders().end(); | ||
| ++file_it) | ||
| { | ||
| // TODO I think this does not work if you are normalizing a consensus map including multiple files |
There was a problem hiding this comment.
so this works for IsobaricAnalyzer but not for the workflow?
There was a problem hiding this comment.
I think IsobaricNormalizer was not yet used on a ConsensusMap from multiple files. I expect it to fail/yield bogus results.
I did not add normalization yet for IsobaricWorkflow. Not sure if very relevant, since most downstream tools will do it anyway and probably better than we do. I only see advantage if we can normalize based on information that will not be present anymore downstream.
|
@jpfeuffer unexpected load of draft PRs. Someone has been busy over the holidays... ;) |
|
I would say this completely replaces a IsobaricAnalyzer - IDMapper- FileMerger - ProteinInference - ProteinQuantifier workflow as in quantms. mzTab/quantms.io output support is planned. EDIT: Maybe normalization should be done in ProteinQuantifier instead and ProteinQuantifier kept separately? Such that you have raw intensities for sophisticated downstream analysis and processed quantified intensities as an immediate output if you want it. |
At least for the "unidentified quantities" I know that this feature is sometimes used with unknown PTMs / sequences. So maybe one needs to consider to optionally add this feature or keep IsobaricAnalyzer in the future... |
True but wouldn't you do it in multiple stages of just identifying then (i.e. before even looking at quants)? Or do you really really want the quants before you decide what to search additionally. I think this use-case is pretty niche. |
|
ok I agree it is a bit niche. |
|
You would not. You would re-write it. |
|
For such a project, I think one should first re-implement a simpler FFID from scratch in a way that is easier readable and parallelizable and preferably does not use SWATH datastructures.
|
|
If someone wants to tackle IsobaricWithMBR, I designed the following pseudocode yesterday evening: |
I feel personally offended! ;-)
I don't understand why you would do a whole MS1 feature detection to match MS2 spectra between runs. Why not just cluster the MS2 spectra (after RT alignment, which is easy to do based on IDs)? |
|
Current approaches (implemented by different software tools MSFragger, Sage, IonQuant, FlashLFQ) seem to be quite successful in doing very fast MS1 feature extraction (e.g., as little as 2-5 seconds per file) so they can do advanced target and decoy feature detection schemes and FDR controlled MBR. This seems to be necessary to do, e.g., single cell studies or to analyze large datasets with pooled channels etc. |
Haha sorry! Some of the hacks were actually added by me and Timo, so it is also our fault (see e.g. seeding). The main hack that was there from the beginning was just the squeezing of MS1 data into both MS1 and MS2 transitions and trying to disable MS1 scores as much as possible. I think there are still some scores that are actually unused and we just cannot get rid of. Also I bet the pre-trained LDA parameters for scoring might not be accurate for our tasks. There must be a cleaner way that is also probably faster (with more development effort though). If one would store fitting parameters on the way or even make use of (i.e. hill climbing) heuristics instead of non-linear optimization, we could even get rid of the bottleneck of doing a triple fit at different stages through the many classes that are used. To clarify, I am happy the tool exists and I think once could even do a first version of an IsobaricMBRWorkflow with it but the more it gets used, the simpler and faster we should actually do it and spend more develop time on it. And in our case even vote to write something new that makes use of the actually slightly simpler task than actual DIA quantification.
Worth a try, indeed! I think as Timo said, you might have more info on if it might actually be the same feature and can do an FDR. |
As far as I can see, the "more info" you get from feature detection is:
Anything I missed? I'm pretty sure you could do an FDR without features, just based on the confidently identified MS2 spectra. |
|
I would be interested to hear how this can work only with MS2, but if it works it would be great :). |
If you apply your MBR procedure to (some) MS2 spectra that were identified on both sides, you can count how often you match the same IDs versus different ones. From that you should be able to estimate the FDR for matching unidentified MS2 spectra. (Then somehow conflate with the MS2 identification FDR, although I'm not enough of a statistician to say how.) |
|
hmm it is not a bad idea for TMT but sounds a bit like a research topic. No idea how well that could work. And maybe not enough if you want the other things... don't know. |
|
For the first version that does rely on the existing algorithms, it sounds like this will be replicating most of the ProtemicsLFQ part, right? |
|
Yes. I guess the merging could be done on-the-fly in plfq as well. Or if you require fasta anyway, proteins can be removed in the beginning and indexed only once we are sure about the final list of peptides and then re-index. |
…ows to helper class
There was a problem hiding this comment.
Actionable comments posted: 1
♻️ Duplicate comments (1)
src/openms/include/OpenMS/ANALYSIS/QUANTITATION/IsobaricChannelExtractor.h (1)
25-25: Remove the redundant blank line.Multiple reviewers and static analysis have flagged this empty line after the struct opening brace. It should be removed for consistency with the codebase style.
Apply this diff:
struct ChannelQC { - std::vector<double> mz_deltas; ///< m/z distance between expected and observed reporter ion closest to expected position
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/openms/include/OpenMS/ANALYSIS/QUANTITATION/IsobaricChannelExtractor.h(6 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
src/openms/**/*.{cpp,h,hpp,cc,cxx}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
src/openms/**/*.{cpp,h,hpp,cc,cxx}: Follow the existing C++ coding conventions in the codebase
Use the established naming patterns for classes, methods, and variables
Use OpenMS data structures (e.g., MSExperiment, FeatureMap, PeptideIdentification)
Follow the established error handling patterns
Utilize OpenMS logging mechanisms
Be mindful of memory usage when processing large datasets
Consider algorithmic complexity for data processing operations
Use appropriate OpenMS containers and algorithms
Files:
src/openms/include/OpenMS/ANALYSIS/QUANTITATION/IsobaricChannelExtractor.h
src/openms/include/OpenMS/**/*.h
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Add Doxygen comments for new public methods and classes
Files:
src/openms/include/OpenMS/ANALYSIS/QUANTITATION/IsobaricChannelExtractor.h
🧬 Code graph analysis (1)
src/openms/include/OpenMS/ANALYSIS/QUANTITATION/IsobaricChannelExtractor.h (1)
src/openms/source/ANALYSIS/QUANTITATION/IsobaricChannelExtractor.cpp (17)
extractSingleSpec(687-765)extractSingleSpec(687-687)registerChannelsInOutputMap(652-685)registerChannelsInOutputMap(652-652)printStats(767-770)printStats(767-767)printStats(772-812)printStats(772-772)printStatsWithMissing(814-863)printStatsWithMissing(814-814)clearStats(868-871)clearStats(868-868)getStats(876-879)getStats(876-876)PurityState_(32-48)computePrecursorPurity_(370-403)computePrecursorPurity_(370-370)
🪛 GitHub Check: CodeFactor
src/openms/include/OpenMS/ANALYSIS/QUANTITATION/IsobaricChannelExtractor.h
[notice] 25-25: src/openms/include/OpenMS/ANALYSIS/QUANTITATION/IsobaricChannelExtractor.h#L25
Redundant blank line at the start of a code block should be deleted. (whitespace/blank_line)
🔇 Additional comments (5)
src/openms/include/OpenMS/ANALYSIS/QUANTITATION/IsobaricChannelExtractor.h (5)
78-88: LGTM! Excellent Doxygen documentation.The method is well-documented with clear parameter descriptions and return value documentation, meeting the coding guidelines requirement for public methods in header files.
90-99: LGTM! Documentation addresses previous review feedback.The Doxygen documentation has been properly added as requested in prior reviews, clearly describing the method's purpose and parameters.
101-113: LGTM! Well-documented statistics printing methods.Both overloads are properly documented. The non-const reference in the second overload is justified by the implementation's need to sort data for median calculation.
133-133: LGTM! Good typo fix.The rename from
PuritySate_toPurityState_corrects a typo and has been consistently applied throughout the class (lines 133, 150, 226).
198-201: LGTM! Well-designed private members.The
qc_dist_mzconstant is properly declared asstatic constexprwith clear documentation warning not to change it. Thechannel_mz_deltamember is appropriately typed and documented.
…lExtractor.h Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/openms/include/OpenMS/ANALYSIS/QUANTITATION/IsobaricChannelExtractor.h (1)
22-30: Add Doxygen documentation for public API elements.The
ChannelQCstruct andChannelQCSettypedef are part of the public API but lack Doxygen documentation. Per the coding guidelines, new public classes and types should have Doxygen comments.Apply this diff:
+ /** + * @brief Quality control data structure for a single isobaric channel. + * + * Holds temporary QC metrics collected during channel extraction. + */ struct ChannelQC { - std::vector<double> mz_deltas; ///< m/z distance between expected and observed reporter ion closest to expected position int signal_not_unique{0}; ///< counts if more than one peak was found within the search window of each reporter position }; + /** + * @brief Map of channel names to their corresponding QC data. + */ typedef std::map<String, ChannelQC> ChannelQCSet;As per coding guidelines
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
doc/doxygen/public/TOPP.doxygen(1 hunks)src/openms/include/OpenMS/ANALYSIS/QUANTITATION/IsobaricChannelExtractor.h(6 hunks)src/tests/topp/CMakeLists.txt(1 hunks)
✅ Files skipped from review due to trivial changes (2)
- src/tests/topp/CMakeLists.txt
- doc/doxygen/public/TOPP.doxygen
🧰 Additional context used
📓 Path-based instructions (2)
src/openms/**/*.{cpp,h,hpp,cc,cxx}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
src/openms/**/*.{cpp,h,hpp,cc,cxx}: Follow the existing C++ coding conventions in the codebase
Use the established naming patterns for classes, methods, and variables
Use OpenMS data structures (e.g., MSExperiment, FeatureMap, PeptideIdentification)
Follow the established error handling patterns
Utilize OpenMS logging mechanisms
Be mindful of memory usage when processing large datasets
Consider algorithmic complexity for data processing operations
Use appropriate OpenMS containers and algorithms
Files:
src/openms/include/OpenMS/ANALYSIS/QUANTITATION/IsobaricChannelExtractor.h
src/openms/include/OpenMS/**/*.h
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Add Doxygen comments for new public methods and classes
Files:
src/openms/include/OpenMS/ANALYSIS/QUANTITATION/IsobaricChannelExtractor.h
🧬 Code graph analysis (1)
src/openms/include/OpenMS/ANALYSIS/QUANTITATION/IsobaricChannelExtractor.h (1)
src/openms/source/ANALYSIS/QUANTITATION/IsobaricChannelExtractor.cpp (17)
extractSingleSpec(687-765)extractSingleSpec(687-687)registerChannelsInOutputMap(652-685)registerChannelsInOutputMap(652-652)printStats(767-770)printStats(767-767)printStats(772-812)printStats(772-772)printStatsWithMissing(814-863)printStatsWithMissing(814-814)clearStats(868-871)clearStats(868-868)getStats(876-879)getStats(876-876)PurityState_(32-48)computePrecursorPurity_(370-403)computePrecursorPurity_(370-370)
🪛 GitHub Check: CodeFactor
src/openms/include/OpenMS/ANALYSIS/QUANTITATION/IsobaricChannelExtractor.h
[notice] 25-25: src/openms/include/OpenMS/ANALYSIS/QUANTITATION/IsobaricChannelExtractor.h#L25
Redundant blank line at the start of a code block should be deleted. (whitespace/blank_line)
🔇 Additional comments (3)
src/openms/include/OpenMS/ANALYSIS/QUANTITATION/IsobaricChannelExtractor.h (3)
78-88: LGTM!The
extractSingleSpecmethod is well-documented with clear parameter descriptions and return value semantics. The signature correctly separates extraction results from QC metrics collection.
90-125: LGTM!All new public methods (
registerChannelsInOutputMap,printStats,printStatsWithMissing,clearStats,getStats) have complete and accurate Doxygen documentation. The distinction between const and non-const variants is properly documented (e.g.,printStatsWithMissingexplains why it requires non-const reference for sorting).
135-135: LGTM!The typo fix (
PuritySate_→PurityState_) is correct, and the new private members are appropriately documented. Theqc_dist_mzconstant includes a helpful comment indicating it's a fixed value.Also applies to: 199-203, 228-228
…o feature/isobaricWorkflow
|
@jpfeuffer see "second fix" commit. like this? |
|
Perfect , thanks |
|
@MaLLLiYA If you want you can try the newest version and see if the bug is fixed. |
|
@MaLLLiYA do you already have some results (don't want to put pressure, ;) just interested) |
|
@timosachsenberg I have recently been creating a Nextflow module for IsobaricWorkflow. But I cannot sync the latest commits that fix the bug to my branch ;( |
|
@MaLLLiYA can you use this branch? It is synced with current develop. Or does your branch have additional changes? |
you mean jpfeuffer:feature/isobaricWorkflow ? I can see the new commits there.
I think there are no changes on my branch, it is up to date with OpenMS/OpenMS:feature/isobaricWorkflow. |
|
You need the version from jpfeuffer/OpenMS:feature/isobaricWorkflow or (better) use gh cli. |
|
I think I merged your changes in at some point to get it to compile. I might have fixed a few things in the process. I think using it should work for you. |

Description
Bottleneck on normal data now: XML Parsing
Big data might be different. Probably inference and protein quantification.
TODO:
For the future, if memory for quants/IDs becomes an issue during merging:
Write output parts as soon as they arrive. E.g. PSM section of a format could be written right away and only the best PSM kept in memory for further processing. After extraction, peptide section could written with quants.
After inference and protein quantification, the protein section. You might need a filter pass in the end if you filter on protein(group) level and want it to propagate down.
Checklist
How can I get additional information on failed tests during CI
Click to expand
If your PR is failing you can check outIf you click in the column that lists the failed tests you will get detailed error messages.
Advanced commands (admins / reviewer only)
Click to expand
/reformat(experimental) applies the clang-format style changes as additional commit. Note: your branch must have a different name (e.g., yourrepo:feature/XYZ) than the receiving branch (e.g., OpenMS:develop). Otherwise, reformat fails to push.rebuild jenkinswill retrigger Jenkins-based CI buildsSummary by CodeRabbit
New Features
Improvements
Tests