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

Osborne, Brian Brian.Osborne@osip.com
Sat, 15 Dec 2001 18:04:13 -0500


Josiah,

There's an alternative method to querying Genbank, it uses the
Bio::DB::GenBank module. From the module's documentation :

$gb = new Bio::DB::GenBank;

$seq = $gb->get_Seq_by_id('MUSIGHBA1'); # Unique ID

    # or ...

$seq = $gb->get_Seq_by_acc('J00522'); # Accession Number

    # or ... best when downloading very large files, prevents
    # keeping all of the file in memory

    # also don't want features, just sequence so let's save bandwith
    # and request Fasta sequence

$gb = new Bio::DB::GenBank(-retrievaltype => 'tempfile' , 
                           -format => 'Fasta');
my $seqio = $gb->get_Stream_by_acc(['AC013798', 'AC021953'] );
while( my $clone =  $seqio->next_seq ) {
      print "cloneid is ", $clone->
    }

See http://www.bioperl.org/Core/POD/Bio/DB/GenBank.html for a more detailed
description. However, I don't see that this module enables a query by
species in a straightforward way, as in your own example. Rather, the module
documentation says :

  Batch Entrez support will likely be supported in a future version of   
  DB::GenBank. 


Brian O.


-----Original Message-----
From: Josiah Altschuler
To: 'bioperl-l@bioperl.org'
Sent: 12/15/01 2:42 PM
Subject: [Bioperl-l] trouble with Boulder::Genbank module

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;
_______________________________________________
Bioperl-l mailing list
Bioperl-l@bioperl.org
http://bioperl.org/mailman/listinfo/bioperl-l