-
Notifications
You must be signed in to change notification settings - Fork 9
Glycan rendering #67
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
Glycan rendering #67
Conversation
|
Linear glycans are not uncommon. Glycosaminoglycans are almost all linear and are heavily modified. They are found on proteoglycans, proteins that are found on cell surfaces and secreted into extracellular spaces. With SVG generation, a recurring pattern is to compute your geoms on unit scale, and then use group elements with a The layout of substituents is tricky without position or linkage, but what I found useful when I did this in Doing all of this without an explicit coordinate system with bounding boxes is probably going to make your life harder in the long run. |
|
Current state of the render test: |
|
@mobiusklein I for now am mostly interested in using these in the Annotator, so in displaying the glycans on peptides and fragments of glycans in spectra. I assumed I would not need linear glycans for these. Rendering these could still be done, but to be honest my experience with them is even less than peptide attached glycans. The svg |
|
@mobiusklein do you want to review some more or can I just merge? |
… small issues in rendering
…lus allowed easier rendering of diagnostic ions
|
The renderings look good. I haven't had a chance to do a re-read of the code yet as there's a lot of it. From a brief scan, are you attempting to canonicalize glycans to prefer a specific ordering of branches? |
|
The branches are kept in the same order as they appear in the original definition. That way they are rendered in the same order as the images in GlyTouCan/GNOme. For naming the branches I do reorder them though, so alpha/beta/gamma/etc indicates the order when the branches are sorted on mass, as is customary as far as I know. So Y4α is the 4th bond from the end of the heaviest branch. |
|
Thank you. The databases store glycans in their canonicalized ordering, and last I checked (five years ago now), they canonicalize input structures sent to their APIs. Branch labeling isn't controlled by a particular algorithm. Some of implementations order branches based upon their canonical ordering according to GlycoCT's sorting algorithm, others might use something based upon the Domon & Costello notation, which is similar but less intricate. My approach in I'll need to take some time later to read the rest of the changes |
mobiusklein
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't review everything, especially the geometry, without a more lengthy testing period. I had some questions about how the fragment specification data structure works though.
The general ideas seem to work and they render well. I cannot tell how "scaling" will work yet, and whether font size is independent of overall size.
Co-authored-by: Joshua Klein <mobiusklein@gmail.com>
|
Thanks so much for the review, it really helped with getting the nitty gritty details of the structures right. On font size, this is always half the sugar size. |
Signed-off-by: Douwe Schulte <d.schulte@uu.nl>









I have been thinking about rendering glycan structures for a while and my thoughts were recently reinvigorated in a discussion with @mobiusklein. This is how far I have gotten by now. Please let me know if there are any things I am missing.
Here is a preview, on the top with my rendering engine, on the bottom the same glycans by glytoucan

Note the glytoucan rendering of G04421VO differes in the fact that my renderer always renders rooted trees while the glytoucan also allows unrooted trees
Things I want to add:
Things that I do not think I can solve right now:
Ping: @ShelleyJager