1
$\begingroup$

My colleague and I are working on a project involving data produced at a glycan microarray facility. The array data that came back to us were a list of glycan names (in IUPAC condensed format). We would like to parse the list of 610 names into the graphical representation of the glycan.

To clarify, I wanted to take a list of glycans, written in the IUPAC condensed nomenclature, and return an image for each glycan. Here, each image would be the "graph" representation (nodes + edges). Ideally, I would like to be able to write a Python script to get this done, so we wouldn't have to do this by hand.

Is this possible? If so, what tools are available to get this done?

Thank you!

$\endgroup$
2
  • 1
    $\begingroup$ I don't know if that answers your question or not. I think code samples on text parsing would probably be off topic here, but I could refer you to some examples. The key would be the second KEGG table. $\endgroup$
    – Atl LED
    Commented Mar 20, 2014 at 19:24
  • $\begingroup$ @AtlLED, thank you for your effort in answering. Though your response didn't give me a direct solution to what I was looking for, it was helpful nonetheless, and I up voted it. Please see my clarification in the comment there. Thanks again! $\endgroup$
    – ericmjl
    Commented Mar 21, 2014 at 4:53

3 Answers 3

2
$\begingroup$

Edit: C# Functions used in our system, slightly paired down for to simplfy

using Microsoft.VisualBasic;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Diagnostics;
using System.Web;
using System.Net;
using System.IO;
using System.Text.RegularExpressions;

public class KEGGCaller
{
    public object ReturnKEGGgif(string GlycanMonoCode, System.Web.HttpServerUtility HTTPUtilityHolder)
    {

        string CallURL = "http://www.genome.jp/dbget-bin/www_bfind_sub?dbkey=glycan&keywords=";
        string GlycanURL = HTTPUtilityHolder.HtmlEncode(GlycanMonoCode);
        WebClient wc = new WebClient();
        System.Drawing.Image GlycanGif = default(System.Drawing.Image);
        CallURL += GlycanURL + "&mode=bfind&max_hit=1";
        StreamReader reader = new StreamReader(wc.OpenRead(CallURL));
        string Gcode = FetchGcode(reader.ReadToEnd());
        if (Gcode == "Failed") {
            return 0;
        } else {
            System.Net.HttpWebRequest Request = default(System.Net.HttpWebRequest);
            System.Net.HttpWebResponse Response = default(System.Net.HttpWebResponse);
            Request = System.Net.WebRequest.Create("http://www.genome.jp/dbget-bin/www_bget?gl:" + Gcode + ".gif");
            Response = (System.Net.WebResponse)Request.GetResponse;
            if (Request.HaveResponse) {
                if (Response.StatusCode == HttpStatusCode.OK) {
                    GlycanGif = System.Drawing.Image.FromStream(Response.GetResponseStream);
                    return GlycanGif;
                } else {
                    return 2;
                }
            } else {
                return 1;
            }

        }

    }
    public object FetchGcode(string PageBlock)
    {
        string MatchURLString = "?gl:G\d\d\d\d\d";
        Match URLMatch = Regex.Match(PageBlock, MatchURLString);
        if (URLMatch.Success) {
            return Strings.Right(URLMatch.Value, 6);
        } else {
            return "Failed";
        }
    }

}

Remainder of the Answer

Biomodels.Net is a great resource to begin with and familiarize yourself with the field and get ideas of how to tackle your qualification needs. We used it when we were doing drug screens.

More specifically for glycans, you're going to be looking at KEGG. Then use KEGG draw for your visual application. If you actually just want to parse them, here is the table on the monosaccharides used (most places).

Here's a better link right to the download in case you didn't find it. The script we wrote was pretty simple, here is the basic logic.

Start with the monosaccharide code.

Call a single return of DBGET to GenomeNet pulling from KEGG Glycan. For example: (GlcNAc)6 (Man)3 (Asn)1 would be called:

 http://www.genome.jp/dbget-bin/www_bfind_sub?dbkey=glycan&keywords=%28GlcNAc%296+%28Man%293+%28Asn%291&mode=bfind&max_hit=1

Where http://www.genome.jp/dbget-bin/www_bfind_sub?dbkey=glycan&keywords= and &mode=bfind&max_hit=1 are going to be constant and the middle part is going to be your search.

You need to change your monosaccharide to standard URL ASCII Reference, concatenating each monosaccharide with a "+". Thus (GlcNAc)6 (Man)3 (Asn)1 becomes %28GlcNAc%296+%28Man%293+%28Asn%291.

That will give you one hit with the link to your exact match if there is one. There will be one link on the returned page in the format of http://www.genome.jp/dbget-bin/www_bget?gl:G#####, where G##### is your glycan number (in our example G00021).

Once you have the glycan number you're good to go. All of the structure images can be found at: http://www.genome.jp/Fig/glycan/G#####.gif

And then you just download your GIF. The way we did our batches was to do each step for all the hits then move to the next step.

Hope that helps more.

$\endgroup$
8
  • $\begingroup$ Upvote because your answer was helpful, though I still couldn't figure out an answer to my problem. To clarify, I wanted to take a list of glycans, written in the IUPAC condensed nomenclature, and return an image for each glycan. Here, each image would be the "graph" representation (nodes + edges). I will update my original question to clarify that; in the meantime, do you know of any tool to do this? Thanks in advance! $\endgroup$
    – ericmjl
    Commented Mar 21, 2014 at 4:48
  • $\begingroup$ Update: I tried KEGG Draw, but it doesn't accept glycan IUPAC names. $\endgroup$
    – ericmjl
    Commented Mar 21, 2014 at 14:35
  • $\begingroup$ @ericmjl I was going to show some examples of short scripts used to call KEGG Draw, which is what I thought you would want. If they're in IUPAC, I don't know a good way to get it graphics. Have you asked them if they will give it to you in KEGG? Might be easy on the source side, or parsing then converting might be your only option. $\endgroup$
    – Atl LED
    Commented Mar 21, 2014 at 17:03
  • $\begingroup$ Ah! I misunderstood, my apologies. Would you be kind enough to share that code? $\endgroup$
    – ericmjl
    Commented Mar 21, 2014 at 17:04
  • 1
    $\begingroup$ @ericmjl I hope that points you in the right direction, maybe someone else will have a Python solution. And there might be a way to go directly from IUPAC, I just don't know it. $\endgroup$
    – Atl LED
    Commented Mar 21, 2014 at 19:56
1
$\begingroup$

I don't know if this works out for glycans but this tool converts IUPAC name to SMILES format. SMILES is a text based structure notation which can be converted to graphical structure.

You can also check these out:

http://www.openmolecules.org/name2structure

http://www.iupac.org/home/publications/e-resources/inchi.html

I am still not sure what you are really asking. It would be easy if you give a dummy example.

$\endgroup$
1
  • $\begingroup$ I tried it, but unfortunately, the tools do not work with the glycan IUPAC names that we have on hand. :-( $\endgroup$
    – ericmjl
    Commented Mar 21, 2014 at 14:34
0
$\begingroup$

The CFG do not use consistent nomenclature for their glycan structures in the excel files they provide. It is human readable but not machine readable. So you'll have to curate their list first. I have bash scripts that do this.

We convert glycan array structures into CFG symbols http://glycam.org/Pre-builtLibraries.jsp You want to click on the cfglibs and maybe give it a few secs to load.

If you are still interested in doing this send in an email to [email protected] explaining what you would like and include my name "Oliver".

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .