Skip to content

ConsenusID does not pass spectrum_reference meta value along #4081

Closed

Description

@lars20070

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?

Activity

  1. hroest commented on Apr 30, 2019

    @hroest
    Contributor

    looks like we need regression tests for this ...

  2. lars20070 commented on Apr 30, 2019

    @lars20070
    ContributorAuthor

    Guess I need to extend (charge, scores) to (charge, scores, spectrum_reference) here. @hendrikweisser @timosachsenberg Can you commend if this is the correct fix.

  3. jpfeuffer commented on Apr 30, 2019

    @jpfeuffer
    Contributor

    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.

  4. lars20070 commented on Apr 30, 2019

    @lars20070
    ContributorAuthor

    apply_() returns SequenceGroups. Can I put spectrum_referencein there?

  5. jpfeuffer commented on Apr 30, 2019

    @jpfeuffer
    Contributor

    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.

  6. jpfeuffer commented on Apr 30, 2019

    @jpfeuffer
    Contributor

    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).

  7. lars20070 commented on Apr 30, 2019

    @lars20070
    ContributorAuthor

    Hmm. Identical IDs, each with a different spectrum_reference.
    @hendrikweisser Can you please comment, before I start implementing.

  8. hendrikweisser commented on May 1, 2019

    @hendrikweisser
    Contributor

    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.

  9. lars20070 commented on May 2, 2019

    @lars20070
    ContributorAuthor

    @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.

  10. hendrikweisser commented on May 2, 2019

    @hendrikweisser
    Contributor

    But IMO no new parameter is necessary.

    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.)

  11. lars20070 commented on May 3, 2019

    @lars20070
    ContributorAuthor

    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.

  12. timosachsenberg commented on May 3, 2019

    @timosachsenberg
    Contributor

    The spectrum reference should always be the native id. If we missed some places we should fix them.

  13. jpfeuffer commented on May 6, 2019

    @jpfeuffer
    Contributor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions