[Bioperl-l] Question about accessing tags inBio::SeqFeature::Generic

Marc Logghe Marc.Logghe at devgen.com
Fri Mar 25 03:04:25 EST 2005


> 
> *Always* provide the error message. Nobody of us has a crystal ball. 
> 'isn't working for me' why? because of error or because you 
> need something that it isn't designed to return?

No crystall ball indeed. Intestines of toads might do well also. There
are a lots of toads currently migrating and (unfortunately) lots of them
are flattenend by cars.
Anyhow, what I could see in there is that you probably call
get_tag_values (watch out here, it is 'get_tag_values', plural, not
'get_tag_value', because you might have multiple values for a certain
tag) in scalar context and not in list context. So, you should be doing
something like:
my ($repclass) = $seq->get_tag_values('repClass'); # or
$seq->get_tag_values('-repClass') when you want to keep the hyphens in
your keys
Also the -tag option takes a hash ref, so I think it is better not to
use hyphens in there for the keys.

HTH and the toad intestines have not let me down ;-)
Marc


> 
> On Thursday, March 24, 2005, at 06:10  PM, iluminati at earthlink.net
> wrote:
> 
> > I have a question about a the Bio::SeqFeature::Generic that doesn't 
> > seem clear to me from the docs.  Here's an example of the 
> seq feature 
> > I'm creating...
> >
> > my $RepeatElement = new Bio::SeqFeature::Generic(     -start => 
> > $L1HERVLine[6],
> >                                            -end => $L1HERVLine[7],
> >                                            -strand => 
> $L1HERVLine[9],
> >                                            -source => 'Repeat',
> >                                            -tag =>{
> >                                            -repName => 
> $L1HERVLine[10],
> >                                            -repClass => 
> > $L1HERVLine[11],
> >                                            -repFamily => 
> > $L1HERVLine[12]}
> >                                            );
> >
> > Now, the feature itself creates fine.  However, it isn't 
> clear how I 
> > would retrieve information from the tag has.  The get_tag_value() 
> > function isn't working for me, and I can't access the hash directly.
> > What should I do to be able to access the data?  Let me know, and 
> > thanks in advance.
> >
> > _______________________________________________
> > Bioperl-l mailing list
> > Bioperl-l at portal.open-bio.org
> > http://portal.open-bio.org/mailman/listinfo/bioperl-l
> >
> >
> --
> -------------------------------------------------------------
> Hilmar Lapp                            email: lapp at gnf.org
> GNF, San Diego, Ca. 92121              phone: +1-858-812-1757
> -------------------------------------------------------------
> 
> 
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at portal.open-bio.org
> http://portal.open-bio.org/mailman/listinfo/bioperl-l
> 
> 



More information about the Bioperl-l mailing list