[BiO BB] gene involved in Kegg pathway

ahmed essaghir ahmed.essaghir at gmail.com
Thu Jan 26 04:29:09 EST 2006

this a simple perl script using soap for getting and coloring genes involved
in a kegg path :
you specify the gene you want to see by giving it's geneID (genbank id see
the example "$H" ).
here i give an example for the "cbl" gene for human and there is also a GI
for "jun" gene in mouse if you want to try it.
the kegg identifier for genes is given by the sepcies code (hsa for homo
sapiens) + ":" + GI (867) : e.g "hsa:867" for cbl.
you can use this script in your cgi-bin by passing to it from a form the
needed parameter $H or $M and of course you can modify it in order to be
adapted to the species you want.
as a result you will get links to two kinds of images (clickable and not).
to run this code you should install all needed perl modules (CPAN :
http://www.cpan.org/ ) and of course the SOAP module.

#! /usr/bin/env perl
use SOAP::Lite;
use CGI qw(:standard);
use CGI::Carp qw(warningsToBrowser fatalsToBrowser);
print "Content-type: text/html\r\n\r\n";
print '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">',
print "<html><head><title>Kegg test</title>\n";
print "</head><body>\n";
#GI number H for human and M for mouse
#cbl gene
my $H = 867;
#jun gene (try $M = 16476 and $H = "")
my $M = "";
#print "$H : Human <br>";
$wsdl = 'http://soap.genome.jp/KEGG.wsdl';
#set the soap service
$serv = SOAP::Lite -> service($wsdl);
$wsdl = 'http://soap.genome.jp/KEGG.wsdl';
    #get the definition of the gene from kegg
    if ($H ) {
        print "$H : Human <br>";
        $keggID =  $serv -> btit('"'."hsa:".$H.'"');
        } elsif ($M) {
        print "$M : Mouse <br>";
        $keggID =  $serv -> btit('"'."mmu:".$M.'"');
    @def = split(/ /,$keggID);
    #kegg id is now in $def[0]
    $genes = SOAP::Data->type(array => [$def[0]]);
    #set colors for the kegg graph
    $fg_list = SOAP::Data->type(array => ['gray', '#00ff00', 'blue']);
    $bg_list = SOAP::Data->type(array => ['#ff0000', 'yellow', 'orange']);
    #get pathways by genes
    $result = $serv -> get_pathways_by_genes($genes);

    foreach $hit (@{$result}) {
    print "$hit : <br>";
    #get web link to marked static pathways
    $colored = $serv -> mark_pathway_by_objects($hit, $genes);
    #get web link to clickable kegg pathways
    $link = $serv ->
    #print links
    if ($colored or $link) {
    print "<b><u>"."<a href=".'"'.$colored.'"'.">".$colored."</a></u></b>"
    print "<b><u>"."<a href=".'"'.$link.'"'.">".$link."</a></u></b>"."<br>";
print "Done!  <br>";
print "</body></html>\n";
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.bioinformatics.org/pipermail/bbb/attachments/20060126/651762ce/attachment.html>

More information about the BBB mailing list