[Bio] / FigKernelPackages / FIG.pm Repository:
ViewVC logotype

Diff of /FigKernelPackages/FIG.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.719, Wed Sep 10 09:55:54 2008 UTC revision 1.720, Thu Sep 11 14:46:03 2008 UTC
# Line 7900  Line 7900 
7900      my($self, $arg1, $arg2) = @_;      my($self, $arg1, $arg2) = @_;
7901      my($fid,  $loc,  $genome);      my($fid,  $loc,  $genome);
7902    
7903      if (($arg1 =~ m/^fig\|\d+\.\d+\.([^\.]+)\.\d+$/) && (not defined($arg2)))      if (($arg1 =~ m/^fig\|\d+\.\d+\.([^\.]+)\.\d+$/) && (not defined($arg2))) {
     {  
7904          $fid    = $arg1;          $fid    = $arg1;
7905          $loc    = $self->feature_location($fid);          $loc    = $self->feature_location($fid);
7906          $genome = $self->genome_of($fid);          $genome = $self->genome_of($fid);
7907      }      }
7908      elsif (($arg1 =~ m/^\d+\.\d+$/) && ($arg2 =~ m/\S+_\d+_\d+/))      elsif (($arg1 =~ m/^\d+\.\d+$/) && ($arg2 =~ m/\S+_\d+_\d+/)) {
     {  
7909          $genome = $arg1;          $genome = $arg1;
7910          $loc    = $arg2;          $loc    = $arg2;
7911      }      }
7912      else      else {
     {  
7913          confess "Invalid Arguments ", join(", ", @_), " to FIG::possibly_truncated";          confess "Invalid Arguments ", join(", ", @_), " to FIG::possibly_truncated";
7914      }      }
7915    
7916      my ($contig,$beg,$end) = $self->boundaries_of($loc);      my ($contig,$beg,$end) = $self->boundaries_of($loc);
7917      if ((! $self->near_end($genome,$contig,$beg)) && (! $self->near_end($genome,$contig,$end)))  
7918      {      if    ($self->possibly_truncated_stop($genome, $contig, $beg, $end)) {
7919          return 0;          #...Truncated STOP is worse than truncated START...
7920            return qq(stop);
7921        }
7922        elsif ($self->possibly_truncated_start($genome, $contig, $beg, $end)) {
7923            return qq(start);
7924        }
7925        else {
7926            return qq();
7927      }      }
     return 1;  
7928  }  }
7929    
7930    sub possibly_truncated_start {
7931        my ($self, $genome, $contig, $beg, $end) = @_;
7932        my $strand = ($end <=> $beg);
7933    
7934        if (  (($strand > 0) && ($beg < 300))
7935           || (($strand < 0) && ($beg > ($self->contig_ln($genome,$contig) - 300)))
7936           ) {
7937            return qq(start);
7938        }
7939        return qq();
7940    }
7941    
7942    sub possibly_truncated_stop {
7943        my ($self, $genome, $contig, $beg, $end) = @_;
7944        my $strand = ($end <=> $beg);
7945    
7946        if (  (($strand > 0) && ($end > ($self->contig_ln($genome,$contig) - 300)))
7947           || (($strand < 0) && ($end < 300))
7948           ) {
7949            return qq(start);
7950        }
7951        return qq();
7952    }
7953    
7954    
7955    
7956  =head3 possible_frameshift  =head3 possible_frameshift
7957    
7958  =over 4  =over 4

Legend:
Removed from v.1.719  
changed lines
  Added in v.1.720

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3