[Bioperl-l] Tag handling on SeqFeature::Generic

Jason Stajich jason@cgt.mc.duke.edu
Tue, 27 Aug 2002 15:05:39 -0400 (EDT)


It is a little more flexible to do:

use Bio::Tools::GFF;
my $io = new Bio::Tools::GFF(-file => '>filename');
      # defaults to STDOUT if no -file or -fh is provided
$io->write_feature($feat);


No way to change a tag though without violating the API (going under
the hood -- which you CAN do, we just don't recommend it) - are you sure
that is what you want to do?  Seems strange to be updating a tag's value
constantly but you must have a specific reason?

-jason

On Tue, 27 Aug 2002, Marco Aurelio Valtas Cunha wrote:

> Hi Bioperl,
>
> I don't think this is the better way to do it, but...
> I'm using SeqFeature::Generic to create a GFF2 output, some like this:
>
> #!/usr/bin/perl
>
> my $gff_io = new Bio::SeqFeature::Generic();
>
> --cut--
>
> # Some loop ...
>
> $gff_io->add_tag_value("Target","Sequence:$query");
>
>         print $gff_io->gff_string();
>
> $gff_io->remove_tag("Target");
>
> #end of the loop;
>
>
> The issue is that I always have to add_tag_value() and then
> remove_tag(), cause AFAIK there's no way to change the tag value once is
> created, am I right? or there's a better way to do this?
>
> Thank you,
> Marco Valtas.
>
>
>

-- 
Jason Stajich
Duke University
jason at cgt.mc.duke.edu