[Bioperl-l] Graphics Panel

Kevin Brown Kevin.M.Brown at asu.edu
Tue Jan 9 15:32:04 UTC 2007


> > matter what I do with the -description option, I can't get 
> > the locus tag
> > of the gene to show up properly.  Instead I always get the 
> > description
> >
> > sub generic_description {
> >   my $feature = shift;
> >   my $description = $feature->get_tag_values("locus_tag");
> >   return "$description";
> > }
> 
> I don't know if this is causing your problem, but be aware that
> get_tag_values() is meant to be used in array context to return all
> the tag values (there could be more than one). Because you are using
> it in a scalar context, it would be returning the array length
> (probably "1"). If you know there is only one locus_tag (most likely),
> then write:
> 
> my ($description) = $feature->get_tag_values("locus_tag");
> $description ||= 'no locus tag';

Hmm, that is odd.  I use that very call in the other script that
retrieves the GenBank files (code not shown) and it returns the value I
was expecting.  It turns out that after the features get dumped into the
graphics panel, they lose a number of tag values.  I'm not sure why that
is happening.  Basically if I do
print $feature->get_tag_values("locus_tag");
before I push it into add_track I do see the string I want returned from
it as expected, but once I send it off to add_track and it launches the
sub to get the tag, it is no longer there.

The other interesting thing is, I run this script with the same input
file each time and randomly I get an error that it can't find the method
get_tag_values in a Bio::Location::Simple object, but I never pass it
Bio::Location::Simple.  The array is full of Bio::SeqFeature::Generic
objects which I have verified by printing out the object reference type
before putting it in the array of items I'm after.




More information about the Bioperl-l mailing list