我正在尝试使用 perl 从基因库数据库下载序列文件,但它显示错误。我没有任何指南来纠正我的程序。
谁能帮我这个?错误在第 6 行 ( use Bio::DB::GenBank;
)
文件 accnumber.txt 在我的桌面上,我正在从桌面本身运行程序。我正在使用 CentOS。
#!usr/bin/perl -w
use strict;
use warnings;
use Bio::DB::GenBank;
open (INPUT_FILE, 'accnumber.txt');
open (OUTPUT_FILE, 'sequence_dwnl.fa');
while()
{
chomp;
my $line = $_;
my @acc_no = split(",", $line);
my $counter = 0;
while ($acc_no[$counter])
{
$acc_no[$counter] =~ s/\s//g;
if ($acc_no[$counter] =~ /^$/)
{
exit;
}
my $db_obj = Bio::DB::GenBank->new;
my $seq_obj = $db_obj->get_Seq_by_acc($acc_no[$counter]);
my $sequence1 = $seq_obj->seq;
print OUTPUT_FILE ">"."$acc_no[$counter]","\n";
print OUTPUT_FILE $sequence1,"\n";
print "Sequence Downloaded:", "\t", $acc_no[$counter], "\n";
$counter++;
}
}
close OUTPUT_FILE;
close INPUT_FILE;
这些是我得到的错误:
Bareword "Bio::DB::GenBank" not allowed while "strict subs" in use at db.pl line 6.
Bareword "new" not allowed while "strict subs" in use at db.pl line 27.
Bareword "seq" not allowed while "strict subs" in use at db.pl line 29.
Execution of db.pl aborted due to compilation errors.