[Bioperl-l] Odd problem with get_tag_values

Adlai Burman adlai at refenestration.com
Fri Feb 24 20:43:40 UTC 2012


I have come across a perplexing problem with trying to parse sequence features into hashes from gb records. This is the minimal code which shows my problem:

#!/usr/bin/perl                                                                                                     
use strict;
use warnings;
use IO::String;
use Bio::Perl;
use Bio::SeqIO;
use IO::String;

my @files = </Users/adlai/Dropbox/atrsh/*>;
foreach my $file(@files){


my @cds_features = grep {$_->primary_tag eq 'CDS' } Bio::SeqIO->new(-file => $file)->next_seq->get_SeqFeatures;
my %strands = map {$_->get_tag_values('gene'), $_->strand} @cds_features; ##This Is The Culprit. 
.
.
.
#do nifty stuff
}

For some files this approach works just fine.
For others the script dies immediately with the error message:

------------- EXCEPTION -------------
MSG: asking for tag value that does not exist gene
STACK Bio::SeqFeature::Generic::get_tag_values /Users/adlai/Downloads/BioPerl-1.6.1/Bio/SeqFeature/Generic.pm:517
STACK toplevel tosend.pl:16
-------------------------------------

The difference in the files that parse and those that don't seems to be that the files that crash have "intron" and "exon" tags. They ALL have "gene" tags.
Does anyone know why this is a problem and what can be done to circumvent it?

Thanks,
Adlai





More information about the Bioperl-l mailing list