glycoinfo / GlycanBuilder2

7 stars 5 forks source link

Error cannot export to WURCS format "_map" is null #66

Open AgentBread opened 8 months ago

AgentBread commented 8 months ago

Hello, I am trying to draw a complex glycan containing a Fuc with 3 substituents (2x O-Me on positions 2 and 4 and NH2 on pos 3) and export the drawing to WURCS format, but I get an error message:

Error: Cannot invoke "String.startsWith(String)" because "_map" is null.

I believe this error is linked to the heavily modified Fuc, because the export works when I change the substituents to what I think is the wrong annotation: If I untick my tick mark at "second bond" and instead shift-click and selecting both linkage positions, the Me are denoted as "2/4 Me" rather than "2,4 Me" and the WURCS export works (side note: re-importing the exported string into the application still gives an error). I don't think this is the correct annotation for two separate Me substituents, though.

Is it intended to display two substituents of the same type as "x/y" instead of "x,y " ? Or is this a bug? I wouldn't want to upload something wrong into the database.

Many thanks!

Screenshot 2024-01-09 at 16 30 29 Screenshot 2024-01-09 at 16 33 07
yamadaissaku commented 8 months ago

Thank you for your feedback. We have tried to recreate your error in GlycanBuilder4Web at (https://gb.glytoucan.org/). However, we were able to create the structure you described. After selecting the Fucose, go to the Structure -> Add residue -> Substituent -> O-type -> Me to add a Methyl residue. You do this twice, and set the linkage position individually for both of them. For NH2, you can find it under Substituent -> Inorganic -> N. I hope this helps!

AgentBread commented 8 months ago

Thank you very much for your quick response! I tried recreating your steps in GlycanBuilder4Web and it worked as you suggested! However, when I try to do the same in the GlycanBuilder2_for_mac standalone application the application freezes (unresponsive), until I hit Ctrl+Z (undo) to undo my last step and unfreeze it. I tried the same on my Windows machine as well as my MacOS, yielding the same result. Basically, my sequence of steps is:

  1. Start Glycanbuilder2.app by double clicking
  2. Add Structure from string (GWS format), containing the Fuc described above: freeEnd--?a1D-Gal,p(--4a1L-Rha,p@270)--2a1D-GlcA,p(--4b1D-Xyl,p@360--4a1L-Fuc,p@360(--3a1L-Fuc,p@270(--3?1N)--2=1,4?1Me)--4b1D-GlcA,p((--2?1NAc)--4a1L-Fuc,p)--3b1D-Glc,p(--2a1L-Fuc,p@360--2?1Me)--4?1Me)--3a1L-Fuc,p--3?1Me$MONO,perMe,Na,0,freeEnd
  3. Change Me substituent to have only 1 linkage at position 2
  4. Select the Fuc and add another Me substituent by selecting Structure > add residue > substituent > O-type > Me
  5. With the second Me selected, select linkage position 4 from the dropdown.

-- At this point the application freezes and can only be unfrozen by undoing the last step. --

The same issue happens when I select a different third substituent next to the existing Me and N, for example Ac, and try to add any linkage position (4 or 6 in this case). Interestingly, I am able to edit the linkage position freely when I tick "second bond" , but as soon as I remove the tick mark at "second bond" the structure doesn't update and the app freezes again (until the last step is undone).

I would prefer to use the standalone application rather than the web-version because I am unable to export the WURCS sequence format from the web-version or the .svg image format (here I get the error message "Failed to load resource: the server responded with a status of 504 ()").

Many thanks!

yamadaissaku commented 8 months ago

Thank you for using GlycanBuilder series. We do not know what causes the standalone application to freeze, but we will consider this as an issue.

Also, the WURCS sequence and SVG image output can be done with the web version (https://glyconavi.org/GB4W/).

WURCS sequence output

  1. draw the glycan structure.
  2. Press the up-arrow button above the galactose symbol (yellow circle).
  3. In the window that appears, the "GWS" is a pull-down menu, so click on it and select "wurcs2".
  4. Click on the "Encode" button to display the WURCS sequence.

SVG image output

  1. Draw the glycan structure.
  2. Select "Export to SVG" from the File menu.
  3. Click "OK" button in the window that appears.
  4. Save the image to an appropriate location such as the desktop.

We wish you the best of luck in achieving your goal.

AgentBread commented 8 months ago

Thank you very much for all of your input- I didn't notice the export button for the sequence format in the web interface. If there is anything at all I can do to support the process around fixing this issue please let me know. Wishing you all the best as well, Cheers!