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

Diff of /FigKernelPackages/gjoseqlib.pm

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

revision 1.23, Fri Sep 17 20:23:35 2010 UTC revision 1.24, Sun Jan 2 18:57:43 2011 UTC
# Line 1968  Line 1968 
1968    
1969      #  Attempt to recover from mixed-case codons:      #  Attempt to recover from mixed-case codons:
1970    
1971        if ( $aa = $gc->{ lc $codon } ) { return( $gc->{ $codon } = $aa ) }
1972        if ( $aa = $gc->{ uc $codon } ) { return( $gc->{ $codon } = $aa ) }
1973    
1974      $codon = ( $codon =~ /[a-z]/ ) ? lc $codon : uc $codon;      $codon = ( $codon =~ /[a-z]/ ) ? lc $codon : uc $codon;
     if ( $aa = $genetic_code{ $codon } ) { return $aa }  
1975    
1976      #  Test that codon is valid for an unambiguous aa:      #  Test that codon is valid for an unambiguous aa:
1977    
# Line 1983  Line 1985 
1985      #  codons is really a bit off the wall to start with:      #  codons is really a bit off the wall to start with:
1986      elsif ( $codon !~ m/^[ACGTUMY][ACGTU][ACGTUKMRSWYBDHVN]$/i ) # Valid?      elsif ( $codon !~ m/^[ACGTUMY][ACGTU][ACGTUKMRSWYBDHVN]$/i ) # Valid?
1987      {      {
1988          return $X;          return( $gc->{ $codon } = $X );
1989      }      }
1990    
1991      #  Expand all ambiguous nucleotides to see if they all yield same aa.      #  Expand all ambiguous nucleotides to see if they all yield same aa.
# Line 1995  Line 1997 
1997    
1998      my $triple = shift @triples;      my $triple = shift @triples;
1999      $aa = $gc->{ $triple } || $gc->{ lc $triple } || $gc->{ uc $triple };      $aa = $gc->{ $triple } || $gc->{ lc $triple } || $gc->{ uc $triple };
2000      $aa or return $X;      $aa or return( $gc->{ $codon } = $X );
2001    
2002      foreach $triple ( @triples )      foreach $triple ( @triples )
2003      {      {
2004          return $X if $aa ne ( $gc->{$triple} || $gc->{lc $triple} || $gc->{uc $triple} );          return( $gc->{ $codon } = $X ) if $aa ne ( $gc->{$triple} || $gc->{lc $triple} || $gc->{uc $triple} );
2005      }      }
2006    
2007      return $aa;      return( $gc->{ $codon } = $aa );
2008  }  }
2009    
2010    

Legend:
Removed from v.1.23  
changed lines
  Added in v.1.24

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3