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

Diff of /FigKernelPackages/SeedUtils.pm

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

revision 1.54, Sat Sep 18 00:00:08 2010 UTC revision 1.55, Wed Oct 6 17:11:47 2010 UTC
# Line 2  Line 2 
2    
3  # This is a SAS component.  # This is a SAS component.
4    
5  #  ########################################################################
6  # Copyright (c) 2003-2006 University of Chicago and Fellowship  # Copyright (c) 2003-2006 University of Chicago and Fellowship
7  # for Interpretations of Genomes. All Rights Reserved.  # for Interpretations of Genomes. All Rights Reserved.
8  #  #
# Line 17  Line 17 
17  # at info@ci.uchicago.edu or the Fellowship for Interpretation of  # at info@ci.uchicago.edu or the Fellowship for Interpretation of
18  # Genomes at veronika@thefig.info or download a copy from  # Genomes at veronika@thefig.info or download a copy from
19  # http://www.theseed.org/LICENSE.TXT.  # http://www.theseed.org/LICENSE.TXT.
20  #  ########################################################################
21    
22  package SeedUtils;  package SeedUtils;
23  use BerkTable;  use BerkTable;
# Line 1548  Line 1548 
1548      return @retVal;      return @retVal;
1549  }  }
1550    
1551    
1552    =head3 genetic_code
1553    
1554        my $code = genetic_code();
1555    
1556    Return a hash containing the translation of nucleotide triples to proteins.
1557    Methods such as L</translate> can take a translation scheme as a parameter.
1558    This method returns the translation scheme for genetic code 11 or 4,
1559    and an error for all other cocdes. The scheme is implemented as a reference to a
1560    hash that contains nucleotide triplets as keys and has protein letters as values.
1561    
1562    =cut
1563    
1564    sub genetic_code {
1565        my ($ncbi_genetic_code_num) = @_;
1566        my $code = &standard_genetic_code();
1567    
1568        if    ($ncbi_genetic_code_num == 11) {
1569            #...Do nothing
1570        }
1571        elsif ($ncbi_genetic_code_num ==  4) {
1572            $code->{TGA} = 'W';
1573        }
1574        else {
1575            die "Sorry, only genetic codes 11 and 4 are currently supported";
1576        }
1577    
1578        return $code;
1579    }
1580    
1581    
1582  =head3 standard_genetic_code  =head3 standard_genetic_code
1583    
1584      my $code = standard_genetic_code();      my $code = standard_genetic_code();

Legend:
Removed from v.1.54  
changed lines
  Added in v.1.55

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3