You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ConsenusID does not pass spectrum_reference meta value along #4081
The ConsensusID algorithm does not pass the spectrum_reference meta value along. Consequently, the information from which file peptide identifications originating from is lost and not exported to mzTab.
Seems an old problem re-appeared #1914, #1932, #1934. Did spectra_data change to spectrum_reference?
Guess I need to extend (charge, scores) to (charge, scores, spectrum_reference)here. @hendrikweisser@timosachsenberg Can you commend if this is the correct fix.
Spectra_data is a list of mzML files from which the IDs originate.
Spectrum_reference is a value at each PeptideID, usually the scan number.
I think it is no regression but tests would indeed be helpful.
Actually I am not sure if ConsensusID requires to have the same spectrum reference to aggregate the scores. So I am not sure if a single spectrum ref can be passed on.
ConsensusID predates the tracking of spectrum references of search results in OpenMS, as far as I know. In addition, spectrum references have been (still are?) not handled consistently by all search engines (or their OpenMS adapters). ConsensusID thus ignores spectrum references and merges search hits based on RT and m/z values (with rounding).
Ideally, the hits that are merged should all come from the same spectrum and thus have a common spectrum reference. Ideally, we could use this reference to do the merging instead of using RT and m/z. In practice, this wasn't the case in the past, but that may have changed now that we're more conscientious about tracking the references (and ensuring a common format for different search engines!).
One solution for now would be to add a flag "use_spectrum_ref" to ConsensusID, in which case the merging would be done by spectrum reference (instead of RT and m/z, although those could be used as a sanity check), and the common reference could be carried through to the results. This would only work for cases where all inputs have spectrum references in the same format.
@hendrikweisser I like your solution, i.e. merging IDs using spectrum_reference as key if present in all inputs. In case the meta value spectrum_reference is missing in any of the inputs, it won't appear in the output.
But IMO no new parameter is necessary. The fewer parameters the better. If you insist, the use_spectrum_reference parameter should be advanced and by default on.
The problem is that it's not easy to tell whether all inputs use the same format for the spectrum references. (For the worst case, think of one that uses numbers counting from 0 and another using numbers counting from 1.) You could of course use heuristics, but a parameter would be easier and clearer (if somwhat less user-friendly).
My reason for suggesting to add a flag was to preserve the default behaviour (using RT, m/z for merging) for backwards compatibility. However, maybe a string parameter ("merge_by"?) with two choices ("spectrum_ref", "rt_and_mz") would be better and make it easier to change the default.
Whether merging by spectrum reference should become the default should depend on how well a common format for spectrum references is currently supported in OpenMS' search engine adapters. (There's no point in making it the default if it won't work in most cases.)
Yep. The spectrum_reference formats might differ in the same dataset, and a merge_by parameter will be necessary. I think we now agree how a fix should look like. Thanks for the feedback.
I also would assume that the Spectra ref is always the same native id and fix it in the adapters (possibly in another PR) if you really encounter problems.
Activity
hroest commentedon Apr 30, 2019
looks like we need regression tests for this ...
lars20070 commentedon Apr 30, 2019
Guess I need to extend
(charge, scores)to(charge, scores, spectrum_reference)here. @hendrikweisser @timosachsenberg Can you commend if this is the correct fix.jpfeuffer commentedon Apr 30, 2019
Spectra_data is a list of mzML files from which the IDs originate.
Spectrum_reference is a value at each PeptideID, usually the scan number.
I think it is no regression but tests would indeed be helpful.
lars20070 commentedon Apr 30, 2019
apply_()returnsSequenceGroups. Can I putspectrum_referencein there?jpfeuffer commentedon Apr 30, 2019
Actually I am not sure if ConsensusID requires to have the same spectrum reference to aggregate the scores. So I am not sure if a single spectrum ref can be passed on.
jpfeuffer commentedon Apr 30, 2019
Maybe you could collect all spectra_ref that are going into the apply_ method of ConsensusID beforehand.
Then you create not only one ConsensusID
https://github.com/OpenMS/OpenMS/blob/develop/src/openms/source/ANALYSIS/ID/ConsensusIDAlgorithm.cpp#L107
but as many IDs as there were spectra contributing (which should usually be only one anyway).
lars20070 commentedon Apr 30, 2019
Hmm. Identical IDs, each with a different
spectrum_reference.@hendrikweisser Can you please comment, before I start implementing.
hendrikweisser commentedon May 1, 2019
ConsensusID predates the tracking of spectrum references of search results in OpenMS, as far as I know. In addition, spectrum references have been (still are?) not handled consistently by all search engines (or their OpenMS adapters). ConsensusID thus ignores spectrum references and merges search hits based on RT and m/z values (with rounding).
Ideally, the hits that are merged should all come from the same spectrum and thus have a common spectrum reference. Ideally, we could use this reference to do the merging instead of using RT and m/z. In practice, this wasn't the case in the past, but that may have changed now that we're more conscientious about tracking the references (and ensuring a common format for different search engines!).
One solution for now would be to add a flag "use_spectrum_ref" to ConsensusID, in which case the merging would be done by spectrum reference (instead of RT and m/z, although those could be used as a sanity check), and the common reference could be carried through to the results. This would only work for cases where all inputs have spectrum references in the same format.
lars20070 commentedon May 2, 2019
@hendrikweisser I like your solution, i.e. merging IDs using
spectrum_referenceas key if present in all inputs. In case the meta valuespectrum_referenceis missing in any of the inputs, it won't appear in the output.But IMO no new parameter is necessary. The fewer parameters the better. If you insist, the
use_spectrum_referenceparameter should be advanced and by default on.hendrikweisser commentedon May 2, 2019
The problem is that it's not easy to tell whether all inputs use the same format for the spectrum references. (For the worst case, think of one that uses numbers counting from 0 and another using numbers counting from 1.) You could of course use heuristics, but a parameter would be easier and clearer (if somwhat less user-friendly).
My reason for suggesting to add a flag was to preserve the default behaviour (using RT, m/z for merging) for backwards compatibility. However, maybe a string parameter ("merge_by"?) with two choices ("spectrum_ref", "rt_and_mz") would be better and make it easier to change the default.
Whether merging by spectrum reference should become the default should depend on how well a common format for spectrum references is currently supported in OpenMS' search engine adapters. (There's no point in making it the default if it won't work in most cases.)
lars20070 commentedon May 3, 2019
Yep. The
spectrum_referenceformats might differ in the same dataset, and amerge_byparameter will be necessary. I think we now agree how a fix should look like. Thanks for the feedback.timosachsenberg commentedon May 3, 2019
The spectrum reference should always be the native id. If we missed some places we should fix them.
jpfeuffer commentedon May 6, 2019
I also would assume that the Spectra ref is always the same native id and fix it in the adapters (possibly in another PR) if you really encounter problems.