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

Filipe Garrett fgarret at ub.edu
Fri Sep 15 14:40:21 UTC 2006


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



More information about the Bioperl-l mailing list