Trouble parsing text with bioperl



Hi, just having some problems running the following bioperl script.
It's supposed to download all the sequences in a file using the gi
numbers. But when I run it it only downloads one sequence of the five
in each line of the file, and that's it. When I uncomment the commented
line, the five sequences are downloaded no problem! I've even printed
out each element of @gi_nums and they correspond to the correct numbers
so I have no idea why they aren't all being downloaded. Any help on
this would be great.

#!/usr/bin/perl -w
use Bio::DB::GenPept;
open GIS, "<gis_5" or die "Can't open gi file";
my $gb = new Bio::DB::GenPept();

while($line = <GIS>) {
@gi_nums = split(' ', $line);
#@gi_nums = ["78096912", "78096910", "78096909", "78096907",
"78096905"];

my $seqio = $gb->get_Stream_by_id(@gi_nums);
while( my $seq = $seqio->next_seq ) {
print "seq id is ", $seq->display_id, "\n";
}
}

The file "gis_5" has the following contents:
78096912 78096910 78096909 78096907 78096905
82653972 82653970 82653968 82653967 82653965

.



Relevant Pages

  • Re: Advice Please As I Am Thinking Of Buying
    ... > Work on a grant application and a couple of papers in Word (with help ... > Use MacVector and Safari to download sequences from GenBank ...
    (comp.sys.mac.advocacy)
  • Re: Trouble parsing text with bioperl
    ... Paul Lalli wrote: ... It's supposed to download all the sequences in a file using the gi ... This would make @gi_nums be one array containing one element. ...
    (perl.beginners)
  • Re: Trouble parsing text with bioperl
    ... It's supposed to download all the sequences in a file using the gi ... This would make @gi_nums be one array containing one element. ... element would be a reference to an array that contains five elements. ...
    (perl.beginners)