mobiusklein / glypy

Glycan Analysis and Glycoinformatics Library for Python
Apache License 2.0
27 stars 14 forks source link

Mass calculation of ketohexoses #18

Closed tiskapot closed 4 years ago

tiskapot commented 4 years ago

Hi

Is there a reason why the mass of the ketohexoses (fructose, psicose, sorbose, tagatose) is different from the mass of hexoses (like glucose, galactose)? To the best of my knowledge, the masses should be the same (180.156 g/mol) ...

from glypy import monosaccharides
sugars = ['Glc', 'Gal', 'Fru', 'Psi', 'Sor', 'Tag']

for sugar in sugars:
    mono = monosaccharides[sugar]
    print(sugar)
    print('> m_mono: %f' % mono.mass(average=True))
    print('> m_avg:  %f' % mono.mass(average=False))
    print('')
Glc
> m_mono: 180.156134
> m_avg:  180.063388

Gal
> m_mono: 180.156134
> m_avg:  180.063388

Fru
> m_mono: 178.140252
> m_avg:  178.047738

Psi
> m_mono: 178.140252
> m_avg:  178.047738

Sor
> m_mono: 178.140252
> m_avg:  178.047738

Tag
> m_mono: 178.140252
> m_avg:  178.047738

Thanks in advance for the reply!

mobiusklein commented 4 years ago

Thank you for reporting this.

I hadn't encountered any structures with these before. You're right that they shouldn't be different. If I had to guess, its because I didn't have a reference for the influence of the keto modification.

I'll look into fixing it within the next 24 hours.

mobiusklein commented 4 years ago

After reading a bit, it looks like ketoses like Fructose simply move the ketone group from C1 to another carbon on the backbone, and the carbonyl that normally appears at C1 is replaced implicitly with a -OH.

I was treateing the keto modification as if it meant the formation of any ketone, and not replacing the carbonyl.

mobiusklein commented 4 years ago

I've fixed support for ketoses, and made sure they work as expected with iupac and wurcs modules too. Changes should be in commit d6a46eb518d8fe82b3194059f058df8f98af1893. Please let me know if something still doesn't look right.

I haven't gotten around to adding updating the SNFG rendering for these yet. Is that something you think you'll need soon?

tiskapot commented 4 years ago

Looks good to me. Thanks a lot for the quick fix!

Updating the SNFG rendering would be nice, but for the moment I can do without.

Regarding the SNFG, I personally like the Oxford notation where the angle between monosaccharides designates the linkage.

image

So far the only tool I came across that implements it, is SugarSketcher, but input is only through the GUI and it doesn't allow a free end. So, integrating the Oxford notation in glypy would be a nice enhancement :)

mobiusklein commented 4 years ago

I have implemented a crude version of Oxford notation's layout algorithm, but not the symbol nomenclature itself, already. Just pass layout='topological' to plot. It's not always perfect about arranging distant branches so they do not overlap, but for small to medium N-glycans at least I know it works well enough.

tiskapot commented 4 years ago

Thanks! I'm just starting to use the glypy package and I hadn't figured out the arguments of the plot function yet. I ran a quick test for the (Sialyl-)Lewis X and A antigens, but the the 2 and 4 linkages don't seem to have the right angle.

Oxford layout

oxford_layout

glypy output

glypy

mobiusklein commented 4 years ago

Looks like the special case logic that controls how Fucose is laid out under CFG/SNFG might still be influencing the topological layout.

I'll create a new issue to cover the layout problem. Is it okay to close this issue on the ketose mass calculation?

tiskapot commented 4 years ago

yep and thanks again