[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.325, Sun Jul 31 01:09:59 2005 UTC revision 1.326, Sun Jul 31 17:08:02 2005 UTC
# Line 2374  Line 2374 
2374    
2375      shift if UNIVERSAL::isa($_[0],__PACKAGE__);      shift if UNIVERSAL::isa($_[0],__PACKAGE__);
2376    
2377      my( $id, $seq, $fh ) = @_;      my( $id, $seqP, $fh ) = @_;
2378    
2379      if (! defined($fh) )  { $fh = \*STDOUT; }      if (! defined($fh) )  { $fh = \*STDOUT; }
2380    
2381      print $fh ">$id\n";      print $fh ">$id\n";
2382      &display_seq($seq, $fh);      &display_seq($seqP, $fh);
2383  }  }
2384    
2385  =head3 display_id_and_seq  =head3 display_id_and_seq
# Line 2417  Line 2417 
2417    
2418      shift if UNIVERSAL::isa($_[0],__PACKAGE__);      shift if UNIVERSAL::isa($_[0],__PACKAGE__);
2419    
2420      my ( $seq, $fh ) = @_;      my ( $seqP, $fh ) = @_;
2421      my ( $i, $n, $ln );      my ( $i, $n, $ln );
2422    
2423      if (! defined($fh) )  { $fh = \*STDOUT; }      if (! defined($fh) )  { $fh = \*STDOUT; }
2424    
2425      $n = length($$seq);      $n = length($$seqP);
2426  #   confess "zero-length sequence ???" if ( (! defined($n)) || ($n == 0) );  #   confess "zero-length sequence ???" if ( (! defined($n)) || ($n == 0) );
2427      for ($i=0; ($i < $n); $i += 60) {      for ($i=0; ($i < $n); $i += 60) {
2428          if (($i + 60) <= $n) {          if (($i + 60) <= $n) {
2429              $ln = substr($$seq,$i,60);              $ln = substr($$seqP,$i,60);
2430          } else {          } else {
2431              $ln = substr($$seq,$i,($n-$i));              $ln = substr($$seqP,$i,($n-$i));
2432          }          }
2433          print $fh "$ln\n";          print $fh "$ln\n";
2434      }      }
# Line 11427  Line 11427 
11427      my $full_loc = new FullLocation($self,$genome,$loc,$tran);      my $full_loc = new FullLocation($self,$genome,$loc,$tran);
11428      $leftStop = $full_loc->Search("taa|tga|tag",$full_loc->PrevPoint,"-",9000); # attempt to get a stop to the left      $leftStop = $full_loc->Search("taa|tga|tag",$full_loc->PrevPoint,"-",9000); # attempt to get a stop to the left
11429    
11430      if (! $leftStop)      if ($leftStop)
11431      {      {
         $leftStop = $full_loc->ExtremeCodon('first');         # If no stop was found, we start with the first codon  
     }  
11432      if ($firstStart = $full_loc->Search("atg|gtg|ttg", $leftStop,"+",9000)) # if you succeed, attempt to get the first      if ($firstStart = $full_loc->Search("atg|gtg|ttg", $leftStop,"+",9000)) # if you succeed, attempt to get the first
11433                                                                               # start to the right of it                                                                               # start to the right of it
11434      {      {
# Line 11440  Line 11438 
11438      {      {
11439          return undef; # else this cannot be a gene          return undef; # else this cannot be a gene
11440      }      }
11441        }
11442        else
11443        {
11444            $start = $full_loc->ExtremeCodon('first');         # If no stop was found, we start with the first codon
11445        }
11446    
11447      $rightStop  = $full_loc->Search("taa|tga|tag",$full_loc->NextPoint,"+",9000);  # loc for the first stop to the right      $rightStop  = $full_loc->Search("taa|tga|tag",$full_loc->NextPoint,"+",9000);  # loc for the first stop to the right
11448      if ($rightStop) # if you get it, adjust the position to the third base of the stop codon      if ($rightStop) # if you get it, adjust the position to the third base of the stop codon
11449      {      {
# Line 11447  Line 11451 
11451      }      }
11452      else      else
11453      {      {
11454          $end  = $full_loc->Adjusted($full_loc->ExtremeCodon('last')); # else, adjust to the last base of the last codon to the right          $end  = $full_loc->ExtremeCodon('last'); # else, adjust to the last base of the last codon to the right
11455      }      }
11456      $full_loc->Extend($start,$end);  
11457        $full_loc->Extend($start,$end,"trim");
11458      my $tran = $full_loc->Translation;      my $tran = $full_loc->Translation;
11459      $tran =~ s/\*$//; # The location should contain the stop, but the translation should not      $tran =~ s/\*$//; # The location should contain the stop, but the translation should not
11460      return ($full_loc->SeedString,$tran);      return ($full_loc->SeedString,$tran);

Legend:
Removed from v.1.325  
changed lines
  Added in v.1.326

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3