Skip to content

TOPPView: better support for peak annotations in "Identification View" - #3007

Merged
timosachsenberg merged 13 commits into
OpenMS:developfrom
hendrikweisser:toppview-idview-peaks
Nov 28, 2017
Merged

timosachsenberg merged 13 commits into
OpenMS:developfrom
hendrikweisser:toppview-idview-peaks

Conversation

@hendrikweisser

Copy link
Copy Markdown
Contributor

In TOPPView's "Identification View", peak annotations stored for peptide hits can be visualized (as an alternative to generating a theoretical spectrum). Previously only labels with the annotations were added to peaks in the measured spectrum. With this change, a second spectrum containing the peaks from the annotations as well as the labels is generated (analogous to a theoretical spectrum). This highlights the actual peaks that are annotated.

(It would be really nice if different peaks could be shown in different colours, but currently that's only possible for the labels.)

@enetz: Can you please check if this still works for showing the special annotations for cross-linked peptides?

@enetz

enetz commented Nov 13, 2017

Copy link
Copy Markdown
Contributor

@hendrikweisser yes, this works well with my data
although in my opinion the bright green peak colour is too bright on a white background

@hendrikweisser

Copy link
Copy Markdown
Contributor Author

The "cpplint" style test failed with this error:
Storage class (static, extern, typedef, etc) should be first. [build/storage_class] [5]
For this line (https://github.com/OpenMS/OpenMS/pull/3007/files#diff-2004e1cf1a16834bba9edf9018761662R864):
for (const auto& ann : annotations)

I'd say that's a false-positive.

@hendrikweisser

Copy link
Copy Markdown
Contributor Author

@enetz: Thanks for checking.

although in my opinion the bright green peak colour is too bright on a white background

Do you know how to change that colour?

@enetz

enetz commented Nov 13, 2017

Copy link
Copy Markdown
Contributor

No idea, but I think @timosachsenberg showed me how to do it once, so it must be possible.

case 2: label += "++"; break;
case -1: label += "-"; break;
case -2: label += "--"; break;
default: label += ((ann.charge > 0) ? "+" : "") + String(ann.charge);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you change this so that it also works for negative mode spectra?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that should work already. Or have I overlooked something? (In the default case, String(ann.charge) already contains the minus sign.)

@hroest

hroest commented Nov 13, 2017

Copy link
Copy Markdown
Contributor

The "cpplint" style test failed with this error:

I fixed it

@timosachsenberg

Copy link
Copy Markdown
Contributor

can you post a screenshot?

@hendrikweisser

Copy link
Copy Markdown
Contributor Author

Screenshot:
toppview_idview_screenshot

@timosachsenberg

Copy link
Copy Markdown
Contributor

cool looks pretty neat

@timosachsenberg

Copy link
Copy Markdown
Contributor

@hendrikweisser

Copy link
Copy Markdown
Contributor Author

Thanks, Timo. There's already a "Todo" item that shows up in the Spectrum1DCanvas documentation:

Use spectrum StringDataArray with name 'label' for peak annotations (Hiwi, Johannes)

We should do that (once #3002 is resolved) and at the same time add support for a "color" IntegerDataArray that would allow setting different colours for individual peaks.

@hendrikweisser

Copy link
Copy Markdown
Contributor Author

CI test "pyopenms_test_memoryleaktests" failed. Not sure if it's relevant.

@hroest

hroest commented Nov 14, 2017

Copy link
Copy Markdown
Contributor

CI test "pyopenms_test_memoryleaktests" failed. Not sure if it's relevant.

no, generally not

@timosachsenberg

Copy link
Copy Markdown
Contributor

The question is, if and where we generate these color arrays.

  1. I would not generate another vector of colors in the search engine or the external tool as this would mean we need to extend the PeptideHit data structure
  2. we could hardcode the coloring to by matching annotations (e.g. is it annotated as b- or y-ions, etc.?) We should be consistent in the use of these strings anyways so it would not hurt to define them
  3. we could add a (#CD5C5C html) color to the annotation string of every annotation. If it is there, we use it to color the peak or annotate the color to the spectrum in a stringdataarray named "color"

@hendrikweisser

Copy link
Copy Markdown
Contributor Author

@timosachsenberg:

  1. we could hardcode the coloring to by matching annotations (e.g. is it annotated as b- or y-ions, etc.?)

That would have been my approach. We already do this to get different colours for the ion name labels.

I agree with your argument against option 1, and I don't like option 3 because that would mix different information in one string (which you'd then have to parse out again).

By the way, the colors could be stored as ints, because Qt's QRgb (which you can convert to a QColor) is "equivalent to an unsigned int".

@hendrikweisser

hendrikweisser commented Nov 28, 2017 •

Copy link
Copy Markdown
Contributor Author

I think this could be merged already. Getting different colours for individual peaks should be a separate set of changes.
CI and Nightlies failures seem unrelated.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants