[Bioperl-l] SeqFeature::Generic 'frame' method

Jason Stajich jason@chg.mc.duke.edu
Tue, 27 Feb 2001 11:55:35 -0500 (EST)


Ah, hah.  I added the warnings and was getting messages because I was
checking that query strandness matched frame direction, but I should have
been checking subject.  This is fixed and checked in.

About handling frames in SeqFeature::Generic:
I have extended it to allow 4 possible values there:
'.', 0,1,2

So if frame is not set (undef) it defaults to '.'.  Are there major
problems with that.  The code looks like this (not checked in)

[Bio::SeqFeature::Generic]

sub frame {
  my ($self,$value) = @_;

  if ( defined $value || !defined $self->{'_gsf_frame'} ) {
       $value = '.' unless defined($value);
       if ( $value !~ /^[0-2\.]$/ ) {
           $self->throw("'$value' is not a valid frame");
       }
       $self->{'_gsf_frame'} = $value;
  }

  return $self->{'_gsf_frame'};
}


This is different from the original code by
<        $value = 0 unless defined($value);
<        if ( $value != 0 && $value != 1 && $value != 2 ) {
---
>        $value = '.' unless defined($value);
>        if ( $value !~ /^[0-2\.]$/ ) {



On Mon, 26 Feb 2001, Hilmar Lapp wrote:

> Jason Stajich wrote:
> > 
> > Technically if the frame 'strand' always matches the query strand
> > (currently comes from checking order of the query match -- reverse order
> > means strand = -1) then discarding the sign of the frame won't cause an
> > error since strand is already set.  Just to be correct I can add code that
> > will extract and set strand information expicitly when 'frame' is called.
> >
> 
> I see. What if we ->warn() when they disagree?
> 
> 	Hilmar
> -- 
> -------------------------------------------------------------
> Hilmar Lapp                            email: lapp@gnf.org
> GNF, San Diego, Ca. 92121              phone: +1-858-812-1757
> -------------------------------------------------------------
> 

Jason Stajich
jason@chg.mc.duke.edu
Center for Human Genetics
Duke University Medical Center 
http://www.chg.duke.edu/