[Bioperl-l] Bio::Annotations::Collection confusion
Kevin Brown
Kevin.M.Brown at asu.edu
Thu Apr 30 20:45:29 UTC 2009
OK. Can't see that method in the Deobfuscator which might explain why I
didn't know about it.
http://bioperl.org/cgi-bin/deob_interface.cgi?Search=Search&module=Bio%3
A%3AAnnotation%3A%3ACollection&sort_order=by+method&search_string=Bio%3A
%3AAnnotation%3A%3ACollection
> -----Original Message-----
> From: Jason Stajich [mailto:jason.stajich at gmail.com] On
> Behalf Of Jason Stajich
> Sent: Thursday, April 30, 2009 1:24 PM
> To: Kevin Brown
> Cc: BioPerl List
> Subject: Re: [Bioperl-l] Bio::Annotations::Collection confusion
>
> Seems like you just want $annotation->value ?
>
>
> =head2 as_text
>
> Title : as_text
> Usage : my $text = $obj->as_text
> Function: return the string "Value: $v" where $v is the value
> Returns : string
> Args : none
>
>
> =cut
>
> =head2 display_text
>
> Title : display_text
> Usage : my $str = $ann->display_text();
> Function: returns a string. Unlike as_text(), this method
> returns a
> string
> formatted as would be expected for te specific
> implementation.
>
> One can pass a callback as an argument which
> allows custom
> text
> generation; the callback is passed the current instance
> and any text
> returned
> Example :
> Returns : a string
> Args : [optional] callback
>
> =cut
>
> =head2 value
>
> Title : value
> Usage : $obj->value($newval)
> Function: Get/Set the value for simplevalue
> Returns : value of value
> Args : newvalue (optional)
>
>
> =cut
>
> On Apr 30, 2009, at 1:01 PM, Kevin Brown wrote:
>
> > That's nice in some regards, but makes it hard to use the
> function in
> > code without having to always process the result, which seems to be
> > counter to what one would expect.
> >
> > E.g. Bio::Seq->seq returns the sequence, not "Seq: sequence".
> >
> > Is there a better way to get the number directly without having to
> > strip
> > off the text that never existed in the first place?
> >
> >> -----Original Message-----
> >> From: Scott Markel [mailto:SMarkel at accelrys.com]
> >> Sent: Thursday, April 30, 2009 12:57 PM
> >> To: Kevin Brown; BioPerl List
> >> Subject: RE: Bio::Annotations::Collection confusion
> >>
> >> Kevin,
> >>
> >> I believe the extra text was added for readability when printing
> >> to the console. In our code we just add the following post-
> >> processing step.
> >>
> >> (my $text = $annotation->as_text()) =~
> s/(Comment|Value): //;
> >>
> >> Scott
> >>
> >> Scott Markel, Ph.D.
> >> Principal Bioinformatics Architect email: smarkel at accelrys.com
> >> Accelrys (SciTegic R&D) mobile: +1 858 205 3653
> >> 10188 Telesis Court, Suite 100 voice: +1 858 799 5603
> >> San Diego, CA 92121 fax: +1 858 799 5222
> >> USA web: http://www.accelrys.com
> >>
> >> http://www.linkedin.com/in/smarkel
> >> Vice President, Board of Directors:
> >> International Society for Computational Biology
> >> Co-chair: ISCB Publications Committee
> >> Associate Editor: PLoS Computational Biology
> >> Editorial Board: Briefings in Bioinformatics
> >>
> >>
> >>> -----Original Message-----
> >>> From: bioperl-l-bounces at lists.open-bio.org [mailto:bioperl-l-
> >>> bounces at lists.open-bio.org] On Behalf Of Kevin Brown
> >>> Sent: Thursday, 30 April 2009 12:27 PM
> >>> To: BioPerl List
> >>> Subject: [Bioperl-l] Bio::Annotations::Collection confusion
> >>>
> >>> So, I'm parsing Genbank sequences to pull out the various
> >> exons. I found
> >>> the way to get the NCBI Exon number from each feature, but
> >> am confused
> >>> about one of the methods. When I do annotation->as_text I'm
> >> expecting to
> >>> get back 1 from the feature, but instead get back Value: 1
> >> ??!? Why is
> >>> the value from the NCBI file getting that text tagged onto it?
> >>>
> >>> http://www.ncbi.nlm.nih.gov/nuccore/73622129
> >>> exon 1..774
> >>> /gene="BOLA2"
> >>> /gene_synonym="BOLA2A; My016"
> >>> /inference="alignment:Splign"
> >>> /number=1
> >>>
> >>> print ($f->annotation->get_Annotations('number'))[0]->as_text;
> >>> Value: 1
> >>>
> >>> _______________________________________________
> >>> Bioperl-l mailing list
> >>> Bioperl-l at lists.open-bio.org
> >>> http://lists.open-bio.org/mailman/listinfo/bioperl-l
> >>
> >
> > _______________________________________________
> > Bioperl-l mailing list
> > Bioperl-l at lists.open-bio.org
> > http://lists.open-bio.org/mailman/listinfo/bioperl-l
>
> Jason Stajich
> jason at bioperl.org
>
>
>
>
More information about the Bioperl-l
mailing list