<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<TITLE>Message</TITLE>

<META content="MSHTML 6.00.2800.1528" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=390451318-26022006><FONT face=Arial color=#0000ff size=2>Use 
the NCBI eutils.  Submit the GenBank accession # to get the GenBank record 
in XML.  The XML record will contain an entry for the 
organism.</FONT></SPAN></DIV><SPAN class=390451318-26022006>
<DIV><BR><FONT face=Arial><FONT color=#0000ff><FONT size=2>Here's a script I 
have to do this<SPAN class=390451318-26022006>.  First input is the 
database, nucleotide in your case, search term is the accession #.  No 
options causes the results to be sent back in ASN.1 format.  I forget the 
option to make it xml.  I think its rettype=XML or something like 
that.</SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN 
class=390451318-26022006></SPAN></FONT></FONT></FONT> </DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN 
class=390451318-26022006>You can even put your input in a text file and redirect 
the file as input to the script...</SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN 
class=390451318-26022006></SPAN></FONT></FONT></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><SPAN class=390451318-26022006><FONT face=Arial color=#0000ff 
size=2>---BEGIN: efetch.pl---</FONT></SPAN></DIV>
<DIV><FONT face=Arial color=#0000ff size=2>#!/usr/bin/perl -w</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2>use LWP::Simple;</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2>my $utils = "</FONT><A 
href="http://eutils.ncbi.nlm.nih.gov/entrez/eutils"><FONT face=Arial 
size=2>http://eutils.ncbi.nlm.nih.gov/entrez/eutils</FONT></A><FONT face=Arial 
color=#0000ff size=2>";</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2>print "Database: ";<BR>$db = 
<STDIN>;<BR>chomp $db;</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2>print "Search Term: ";<BR>$term = 
<STDIN>;<BR>chomp $term;</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2>print "Options: ";<BR>$options = 
<STDIN>;<BR>chomp $options;</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2>my $esearch = 
"$utils/esearch.fcgi?db=$db&term=$term&usehistory=y&tool=efetch";<BR>print 
"$esearch\n";<BR>my $esearch_result = get($esearch);</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2>if ($esearch_result =~ 
m/<Id>(\d+)<\/Id>/) {<BR>        
$id = $1;<BR>}<BR>if ($esearch_result =~ 
m/<QueryKey>(\d+)<\/QueryKey>/) 
{<BR>        $key = $1;<BR>}<BR>if 
($esearch_result =~ m/<WebEnv>(.*)<\/WebEnv>/) 
{<BR>        $webenv = $1;<BR>}</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2>if (defined($id)) 
{<BR>        print "ID: $id\nKey: 
$key\nWebEnv: $webenv\n\n";</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><FONT 
size=2>        $esearch = 
"$utils/efetch.fcgi?db=$db&id=$id&tool=efetch";<BR>        
print "$esearch\n";<BR>        my 
$esummary_result = get($esearch);<BR>        
print "$esummary_result\n";<BR>} else 
{<BR>        print 
"$esearch_result\n";<BR>}<BR><SPAN class=390451318-26022006>---END: 
efetch.ph---</SPAN></FONT></FONT></FONT></SPAN></DIV>
<DIV><SPAN class=390451318-26022006><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN> </DIV>
<BLOCKQUOTE style="MARGIN-RIGHT: 0px">
  <DIV></DIV>
  <DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left><FONT 
  face=Tahoma size=2>-----Original Message-----<BR><B>From:</B> 
  bio_bulletin_board-bounces+golharam=umdnj.edu@bioinformatics.org 
  [mailto:bio_bulletin_board-bounces+golharam=umdnj.edu@bioinformatics.org] 
  <B>On Behalf Of </B>Samantha Fox<BR><B>Sent:</B> Sunday, February 26, 2006 
  12:58 PM<BR><B>To:</B> The general forum at 
  Bioinformatics.Org<BR><B>Subject:</B> [BiO BB] mapping genbank accession to 
  Organism name<BR><BR></FONT></DIV>Hi all,<BR>This should be really easy, but 
  somehow I am cannot figure it out. I BLASTed my sequences with the 
  non-redundant nt sequence from NCBI.<BR>The hits are something like 
  gb|AC167666.4, emb|BX640434.1, emb|BX640418.1 ...<BR><BR>Can someone suggest 
  me a way to get the organism name from these genbank accessions ?<BR><BR>hope 
  someone has done this already :) ..<BR>~S<BR></BLOCKQUOTE></BODY></HTML>