[Bioperl-l] about error messages!
yaofx
yaofx at xymu.net
Mon Aug 4 09:29:32 EDT 2003
Hello,
The following script is my first code using Bioperl module.
It works well, now I want to add some codes to get error messages and
save as log file, such as :
" Could not connect internet", "ID does not exist", "verbose ID" , and
so on.
But I can not find the information about that, would you all like help me?
Thanks in advance!
Fengxia
#!/usr/bin/perl -w
$idlist = $ARGV[0];
if (@ARGV != 1){
print "USAGE: perl web_id2seq.pl <ID list file>\n";
exit(1);
}
$faoutfile = $idlist."_fa.txt";
(unlink $faoutfile) if (-e $faoutfile);
open (INPUT,$idlist);
while ($line = <INPUT>){
chomp ($line);
$line =~ s/\r//;
push (@querylist,$line);
}
$query = join ",", at querylist;
close INPUT;
use Bio::SeqIO;
use Bio::DB::GenBank;
my $gb = new Bio::DB::GenBank;
my $seqout = new Bio::SeqIO(-file => ">$faoutfile", -format => 'fasta');
my $seqio = $gb->get_Stream_by_id([$query]);
while($seq = $seqio->next_seq ) {
$seqout->write_seq($seq);
}
More information about the Bioperl-l
mailing list