[Bioperl-l] Problem to extract protein_id and transcript from CDS

Diogo Tschoeke diogoat at gmail.com
Tue Jan 15 08:40:10 EST 2008


Hello,

I want to extract protein_id and transcript from a CDS tag, from genome in
genbak format but i have one problem, when the sequence in the file don't
have the protein_id or the transcript the script gives me this error:

------------- EXCEPTION  -------------
MSG: asking for tag value that does not exist protein_id
STACK Bio::SeqFeature::Generic::get_tag_values
/usr/share/perl5/Bio/SeqFeature/Generic.pm:504
STACK toplevel parser_cds.pl:25
--------------------------------------

Bellow I past the script

##############################################
use Bio::SeqIO;
use warnings;

my $infile = $ARGV[0];
my $outfile = "$infile.out";
open (OUT, ">>$outfile");

          my $seq_in = Bio::SeqIO->new('-file' => "<$infile",
                                      '-format' => 'Genbank');

         while (my $inseq = $seq_in->next_seq) {

        for my $feat_object ($inseq->get_SeqFeatures){
            if ($feat_object->primary_tag eq "CDS"){
                print OUT $feat_object->get_tag_values('protein_id')," ";
            print OUT $feat_object->get_tag_values('translation'),"\n";
        }
    }
}
###############################################

Somebody can helps me?

Thank

Diogo Tschoeke


More information about the Bioperl-l mailing list