[Bioperl-l] Graphics Panel

Lincoln Stein lstein at cshl.edu
Tue Jan 9 16:50:26 UTC 2007


I hope this isn't a bug. Could you try the following (using a single feature
to make life easier):

Before you add the feature to the track do:

   warn "BEFORE: feature=$feature,

Then in the callback, do:

  sub {
      my $feature = shift;
      warn "AFTER: feature=$feature,
      return join '; ',$feature->get_tag_values("locus_tag");

Hopefully, the feature will be the SAME one each time and will return the
same list of tag values.


On 1/9/07, Kevin Brown <Kevin.M.Brown at asu.edu> wrote:
> > > 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.
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l

Lincoln D. Stein
Cold Spring Harbor Laboratory
1 Bungtown Road
Cold Spring Harbor, NY 11724
(516) 367-8380 (voice)
(516) 367-8389 (fax)
SANDRA MICHELSEN, AT michelse at cshl.edu

More information about the Bioperl-l mailing list