[Bio] / RegSubMa / check_ncbi.cgi Repository:
ViewVC logotype

View of /RegSubMa/check_ncbi.cgi

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1.1.1 - (download) (annotate) (vendor branch)
Wed Apr 4 17:08:51 2007 UTC (13 years, 2 months ago) by mkubal
Branch: MAIN, fig
CVS Tags: v_1_0_0, HEAD
Changes since 1.1: +0 -0 lines
initial checkin

use strict;
use warnings;
use LWP::Simple;
use CGI;

my $cgi = new CGI;
my $success = 0;

my $url="http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=taxonomy&report=sgml&id=". $cgi->param('id');
my $content = get($url);

my $genetic_code = "11";
if ($content =~ /\&lt\;GCId\&gt\;(.*)\&lt\;\/GCId\&gt\;/) {
    $genetic_code = $1;
}

my $lineage = "";
if ($content =~ /\&lt\;Lineage\&gt\;cellular organisms; (.*)\&lt\;\/Lineage\&gt\;/) {
    $lineage = $1;
    $success = 1;
}

my $genus = "";
if ($content =~ /\&lt\;ScientificName\&gt\;(.*)\&lt\;\/ScientificName\&gt\;(\W*)\&lt\;Rank\&gt\;genus\&lt\;\/Rank\&gt\;/) {
    $genus = $1;
}

my $species = "";
if ($content =~ /\&lt\;ScientificName\&gt\;(.*)\&lt\;\/ScientificName\&gt\;(\W*)\&lt\;Rank\&gt\;species\&lt\;\/Rank\&gt\;/) {
    $species = $1;
    $species =~ s/$genus\s//;
    $species =~ s/ii$/i/;
    $species =~ s/ae$/a/;
}

my $strain = "";
if ($content =~ /\&lt\;ScientificName\&gt\;(.*)\&lt\;\/ScientificName\&gt\;(\W*)\&lt\;OtherNames\&gt\;/) {
    $strain = $1;
    $strain =~ s/$genus\s//;
    $strain =~ s/$species\s//;
}

print $cgi->header();
if ($success) {
    print $lineage . "<br/>" . $genetic_code  . "<br/>" . $genus . "<br/>" . $species . "<br/>" . $strain;
} else {
    print "not found";
}

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3