[Bioperl-l] Bio::DB::GFF

Lincoln Stein lincoln.stein at gmail.com
Fri Sep 15 14:53:05 UTC 2006


Hi,

This is quite easy. After you fetch the segment, tell it to use itself as
the reference system with the refseq() method:

   my $s = $db->segment('Chr1',100000 => 200000);
   $s->refseq($s);

>From now on, all coordinates will be relative to the start of s, so the
range will go from 1 to 10000. This will also apply to all features you
fetch from the segment.

Lincoln

On 9/15/06, Filipe Garrett <fgarret at ub.edu> wrote:
>
> Hi all,
>
> I'm using Bio::DB::GFF and I need to get a all the GFF features in a
> particular region (eg. 100000 to 200000). However I need the positions
> to be 'reset' in order to start from 1 (and not 100000).
>
> I've looking in BioPerl but it looks like there's no method for it. So I
> changed the 'Bio::DB:GFF' Module on the 'start' and 'end' methods. The
> objective is to make them as get/set in order to change the start and
> stop positions of the GFF features.
>
> "...
> # overridden methods
> # start, stop, length
> sub start {
>    my $self = shift;
>    my $pos = shift;
>
>    $self->strand < 0 ? $self->{stop} = $pos : $self->{start} = $pos if
> $self->absolute && $pos ne undef;
>    return $self->strand < 0 ? $self->{stop} : $self->{start} if
> $self->absolute;
>    $self->_abs2rel($self->{start});
> }
> sub end {
>    my $self = shift;
>    my $pos = shift;
>
>    $self->strand < 0 ? $self->{start} = $pos : $self->{stop} = $pos if
> $self->absolute && $pos ne undef;
>    return $self->strand < 0 ? $self->{start} : $self->{stop} if
> $self->absolute;
>    $self->_abs2rel($self->{stop});
> }
> .."
>
> Probably this changes are not totally general so any adjustment is welcome
>
> thanks in adv,
>
> FG
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l
>



-- 
Lincoln D. Stein
Cold Spring Harbor Laboratory
1 Bungtown Road
Cold Spring Harbor, NY 11724
(516) 367-8380 (voice)
(516) 367-8389 (fax)
FOR URGENT MESSAGES & SCHEDULING,
PLEASE CONTACT MY ASSISTANT,
SANDRA MICHELSEN, AT michelse at cshl.edu



More information about the Bioperl-l mailing list