我正在尝试使用 BioPerl 从 GenBank 文件中提取 CDS 和相应的氨基酸序列。脚本如下所示:
while (my $seq_object = $in->next_seq){
for my $feat_object ($seq_object->get_SeqFeatures) {
if ($feat_object ->primary_tag eq "CDS") {
# warn("all tags are ", join ("," , $feat_object->get_all_tags),"\n");
if ($feat_object->has_tag ("protein_id")){
my ($protein_id) = $feat_object->get_tag_values('protein_id');
my ($pseq) = $feat_object->get_tag_values('translation') ;
my ($pepseq) = Bio::Seq->new(-id => $protein_id , -description => $seq_object -> accession_number,
-seq => $pseq);
$out->write_seq($pepseq);
}
}
}
}
我收到错误消息:Filehandle GEN1 opens only for input at /Library/Perl/5.12/Bio/Root/IO.pm line 533, line 148。
请帮我解决这个问题。
提前致谢