[Bioperl-l] Re: inferring exon features in SeqFeature::Tools::Unflattener - an improvement?

Chris Mungall cjm at fruitfly.org
Mon Feb 23 17:38:05 EST 2004


Hi Malcolm

Thanks for the patch! This is indeed in keeping with the spirit of the
module, I have incorporated it with one minor modification

this
             $subsf->seq_id($sf->seq_id);
to
             $subsf->seq_id($sf->seq_id) if $sf->seq_id;

This saves unneccessary null accessors; as far as I can tell, parsing
genbank/embl will populate the seq_id accessor in the underlying location
object, but this is not propagated up to the feature seq_id (either by
explicitly copying the data or by transitivity/delegation). All very
confusing. If you want this field populated in the newly created exon
location objects you may need to add extra code to do this.

Now in cvs

Cheers
Chris

On Mon, 23 Feb 2004, Cook, Malcolm wrote:

> Dear Chris and fellow Bioperlers,
>
> I have made the following patch on my local version of this module in
> order to provide values for the seq_id and the /locus_tag and /gene tags
> of inferred exons.
>
> Please advise if this is in the spirit of the module, and whether this
> patch can be incorporated in the live version.
>
> Thanks!
> Malcolm Cook
> Database Applications Manager, Bioinformatics
> Stowers Institute for Medical Research
> (816) 926-4449
>
>
>
> Index: Unflattener.pm
> ===================================================================
> RCS file:
> /home/repository/bioperl/bioperl-live/Bio/SeqFeature/Tools/Unflattener.p
> m,v
> retrieving revision 1.19
> diff -c -r1.19 Unflattener.pm
> *** Unflattener.pm 2003/12/16 22:31:16 1.19
> --- Unflattener.pm 2004/02/23 19:45:32
> ***************
> *** 2408,2413 ****
> --- 2408,2424 ----
>
> -primary_tag=>'exon');
>         my $locstr = 'exon::'.$self->_locstr($subsf);
>
> +       ## Provide seq_id to new feature:
> +       $subsf->seq_id($sf->seq_id);
> +       ## Transfer /locus_tag and /gene tag values to inferred
> +       ## features.  TODO: Perhaps? this should not be done
> +       ## indiscriminantly but rather by virtue of the setting
> +       ## of group_tag.
> +       foreach my $tag (grep /gene|locus_tag/, $sf->get_all_tags) {
> +         my @vals = $sf->get_tag_values($tag);
> +         $subsf->add_tag_value($tag, @vals);
> +       }
> +
>         # re-use feature if type and location the same
>         if ($loc_h{$locstr}) {
>      $subsf = $loc_h{$locstr};
>
>



More information about the Bioperl-l mailing list