[Bioperl-l] Sending Accession Numbers to Blast Server
Jason Stajich
jason@cgt.mc.duke.edu
Fri, 13 Dec 2002 11:25:08 -0500 (EST)
On Fri, 13 Dec 2002, Agrin, Nathan wrote:
> I'm trying to get a script running using bioperl such that I can send a
> list of accession numbers to blast servers and retrieve the matches.
> My problem is that anytime I use something like this:
>
Reason: Bio::DB::SwissProt doesn't allow you to retrieve things by
version, only Bio::DB::GenBank and Bio::DB::EMBL I think cause only these
databases provide a web interface for this type of data. What are you
really trying to do?
Ack! Don't do it this way (define the database handle once, things in
single quotes are literally what you typed in, variables are not
derefenced, either you want double quotes or no quotes at all).
Try the code below which is mightly close to the code in the SYNOPSIS
which I also suggest people try using first.
my $db = new Bio::DB::SwissProt;
foreach my $accession ( @anum ) {
# just get things by accession number
my $seq = $db->get_Seq_by_acc($accession);
}
> for ($i=0; $i<$#anum+1; $i++) {
> my $db = new Bio::DB::SwissProt;
> my $seq = $db->get_Seq_by_version('$anum[$i]');
> }
>
> I get an error that says 'Implementing class should define this method'
> and if I just try to bypass defining the accession number and pass the straight accession number to submit_blast('$anum[$i]') I get an error telling me it's not a valid blast input. I'm trying to run a blastx search which seems to work fine over the web when I input the accession numbers.
>
> Any ideas would be appreciated.
>
> nathan.agrin@umassmed.edu
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l@bioperl.org
> http://bioperl.org/mailman/listinfo/bioperl-l
>
--
Jason Stajich
Duke University
jason at cgt.mc.duke.edu