[Bioperl-l] fixed spliced seq

Jason Stajich jason@cgt.mc.duke.edu
Wed, 2 Oct 2002 08:50:16 -0400 (EDT)


I fixed Bio::SeqFeatureI::spliced_seq so it will properly get a spliced
sequence when it is on the reverse strand by first sorting the segments
5'->3' on the rev strand, this is as simple as

# only do this for reverse strand features

my @locs = map  { $_->[0] }
           sort {  $b->[1] <=> $a->[1] } # want the smallest in terms of
                                         # negative
           map  { [$_, $_->start * ($_->strand || 1)] }
           $feature->location->each_Location;


I noticed this because reverse strand exons weren't splicing into the
correct products according to annotation for the sequence file.
I think mixed strand features are a little more problematic so I choose to
repect the input order that comes from each_Location rather than re-sort
it (and warn that the feature contains mixed strand features which could be a
problem).

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