[Bioperl-l] trouble with Boulder::Genbank module

Josiah Altschuler jaltschuler@CGR.Harvard.edu
Sat, 15 Dec 2001 14:42:06 -0500


Hi.  I'm running ActivePerl 5.6 on Windows 2000.  I installed the Boulder
module from CPAN and I'm trying to access Genbank using Boulder::Genbank.
I'm able to retrieve the correct entries by query, but it keeps retrieving
them over and over in an infinite loop.  I figure by showing my code below,
someone can see where I'm making a mistake?
Also, I couldn't find anything in bioperl that would allow me to search
Genbank by query like I'm doing here with Boulder::Genbank.  Is this
correct?
Anyways, thanks for any help you can give me.

Here is the code,
Josiah


use Boulder::Genbank;
  
$a = "courant_nrdb.txt";  #output file for query results
$query = 'Neolamprologus brichardi[Organism]';
$gb = Boulder::Genbank->newFh(-accessor  =>  'Entrez',
			    	      -query  =>  $query,
                            		          -db  =>  'n');

open(OUT, ">$a") || die "cannot create a: $!";

while ($data = <$gb>)
{
	print "entry retrieved\n";  #Telling me it got an entry (It's
repeating infinitely)
	$gi = $data->Nid;
	$gi =~ s/\D//g;	#Get rid of first letter in GI entry

	#Now print the entry in FASTA format
	print OUT ">gi|$gi|gb|";
	print OUT $data->Version;
	print OUT "|";
	print OUT $data->Accession;
	print OUT " ";
	print OUT $data->Definition;
	print OUT "\n";
	print OUT $data->Sequence;
	print OUT "\n";
}
close OUT;