-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Annotated sequence peptide string #24
Comments
I've thought previously about trying to add such a peptide string with the fragments indicated, but it's not trivial with matplotlib. I'll have to see how hard it would be to actually implement it. I'm currently working on some extra peak annotations (neutral losses, modifications via ProForma). Highlighting the precursor peak should definitely be possible, I'll try to add that functionality relatively shortly. |
To be honest, I don't really have a good idea how to highlight the fragments in the peptide sequence using matplotlib. Suggestions on how to properly combine text with graphical elements are welcome. |
I don’t know if this might have some useful information:
http://www.aosabook.org/en/matplotlib.html <http://www.aosabook.org/en/matplotlib.html>
Happy Holidays!
-Phil
… On Dec 21, 2021, at 3:44 PM, Wout Bittremieux ***@***.***> wrote:
To be honest, I don't really have a good idea how to highlight the fragments in the peptide sequence using matplotlib. Suggestions on how to properly combine text with graphical elements are welcome.
—
Reply to this email directly, view it on GitHub <#24 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AFZNQSUTQ7B5JEUGHWQZKNLUSEGOTANCNFSM5CNBUIZQ>.
Triage notifications on the go with GitHub Mobile for iOS <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android <https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you are subscribed to this thread.
|
I have implemented something like this by generating an svg with drawSvg and sticking it on to the plot. Its not always the most elegant, but it works.. |
Thanks for the tip. A matplotlib option would be preferable, but I don't know how to properly do it that way. If drawSvg works it could be worth looking into. |
In https://github.com/Rappsilber-Laboratory/xiSPEC_spectrumViewer/ project, there is a way to draw fragments. It requires XiAnnotator(https://github.com/Rappsilber-Laboratory/pyXiAnnotator) for drawing it additionally. This is based on d3.js in javascript. e.g. https://github.com/Rappsilber-Laboratory/xiSPEC_spectrumViewer/blob/master/example_linear.html It might be useful how to draw peptide letters: |
Thanks Joshua! This is a great start to the discussion. I'll be out of town until the end of the month, but if you're up for it, we should discuss this in more detail in November. |
Sure. I may have refined this a bit by then for figure making. |
I'm trying to come up with something and would like to get your opinions. I think this is more or less what was requested. (As a next step we can try to add the ladder as well, but first I want to get this functionality figured out.) A few questions:
|
This looks great!
|
I agree that explicit mods might not be a first priority and I would agree with Ralf's suggestion of color-coding modified AAs would be a good way to convey mod information without changing the 'monospaced' nature of the annotation.
I would argue that it should annotate higher charge states but I don't feel like there is the need to have them show separately. (It could use whatever the fragment charge state is set by
I think this would fit 95+% use cases, so I do not feel like it would be totally required in a first implementation. But just as a reference and inspiration but I have seen in the past offsetting the annotation in the 'y' axis and color coding it as a way to annotate multiple fragment series. (fig 8 https://pubs.acs.org/doi/pdf/10.1021/jasms.2c00214) I think as it is right now looks great! good job! |
It's very easy to make these graphics too noisy trying to include all that information, and choosing what to draw and when to draw it is going to be application specific.
I agree, coloring the modified amino acid is the usual thing done. Sometimes it's also written lowercase, but color-coding is usually more useful, especially if you keep it uniform across multiple plots.
This gets into interfaces. If you provide sane defaults for your high level interface (e.g. all charge states, no neutral losses), that's reasonable, and if you want to expose a lower level interface, that's where you might either add a bunch of flag combinators or flat out just accept a predicate function for
That's reasonable. Again, agreeing with Ralf that what we care about is "this bond was observed to break". If you're doing fancy modification localization, then you might want to draw all the ion ladders separately. For my implementation, I stack labile modified and unmodified annotations using different color slash marks over the same bond, but it only goes two deep because more is not helpful and may get too messy unless scale is carefully controlled. Some implementation questions are:
|
Very relevant questions, and I haven't settled on an optimal implementation yet. Currently I provide additional parameters to the Then we get into specific implementation details. I think it will be pretty cumbersome or even impossible to find a "perfect" solution that works in all situations. It's probably much easier to have a good-enough implementation that works most of the time. And then try to provide relevant parameters to customize aspects of the plot so that advanced users can try to fix those edge cases themselves. |
I guess the current method also allows it to be used in a |
[feature request]
I was wondering if there is any desire to implement "adding the annotated ions on the peptide sequence string". "P]E]P]TIDEP[I[N[K" kind of deal ...
like it is show in the following image
(in addition it would be great to have precursor ion annotations, let me know if you would like to make a new issue for it/try to implement it)
Thanks for the great package!
Sebastian
EDIT: Adding precursor ions to annotation is already supported!
The text was updated successfully, but these errors were encountered: