Permalink
Browse files

add support for a stricter standard codon table, for the MAKER folks

  • Loading branch information...
1 parent ae4c4e5 commit e49f2947ce867a076f980b15bf3b388f581f4bae Chris Fields committed Oct 14, 2013
Showing with 27 additions and 3 deletions.
  1. +4 −1 Bio/Tools/CodonTable.pm
  2. +23 −2 t/SeqTools/CodonTable.t
View
@@ -220,7 +220,8 @@ BEGIN {
'', '', '', '',
'Trematode Mitochondrial',# 21
'Scenedesmus obliquus Mitochondrial', #22
- 'Thraustochytrium Mitochondrial' #23
+ 'Thraustochytrium Mitochondrial', #23
+ 'Strict', #24, option for only ATG start
);
@TABLES =
@@ -244,6 +245,7 @@ BEGIN {
FFLLSSSSYY**CCWWLLLLPPPPHHQQRRRRIIMMTTTTNNNKSSSSVVVVAAAADDEEGGGG
FFLLSS*SYY*LCC*WLLLLPPPPHHQQRRRRIIIMTTTTNNKKSSRRVVVVAAAADDEEGGGG
FF*LSSSSYY**CC*WLLLLPPPPHHQQRRRRIIIMTTTTNNKKSSRRVVVVAAAADDEEGGGG
+ FFLLSSSSYY**CC*WLLLLPPPPHHQQRRRRIIIMTTTTNNKKSSRRVVVVAAAADDEEGGGG
);
# (bases used for these tables, for reference)
@@ -272,6 +274,7 @@ BEGIN {
-----------------------------------M---------------M------------
-----------------------------------M----------------------------
--------------------------------M--M---------------M------------
+ -----------------------------------M----------------------------
);
my @nucs = qw(t c a g);
View
@@ -7,7 +7,7 @@ BEGIN {
use lib '.';
use Bio::Root::Test;
- test_begin(-tests => 61);
+ test_begin(-tests => 71);
use_ok('Bio::Tools::CodonTable');
use_ok('Bio::CodonUsage::IO');
@@ -177,7 +177,7 @@ my @custom_table =
);
ok my $custct = $myCodonTable->add_table(@custom_table);
-is $custct, 24;
+is $custct, 25;
is $myCodonTable->translate('atgaaraayacmacracwacka'), 'MKNTTTT';
ok $myCodonTable->id($custct);
is $myCodonTable->translate('atgaaraayacmacracwacka'), 'MKXXTTT';
@@ -208,3 +208,24 @@ ok $seq = Bio::PrimarySeq->new(-seq =>'ACDEFGHIKLMNPQRSTVWY');
ok my $io = Bio::CodonUsage::IO->new(-file => test_input_file('MmCT'));
ok my $cut = $io->next_data();
is $myCodonTable->reverse_translate_best($seq,$cut), 'GCCTGCGACGAGTTCGGCCACATCAAGCTGATGAACCCCCAGCGCTCCACCGTGTGGTAC';
+
+#
+# test 'Strict' table, requires a Bio::CodonUsage::Table object
+#
+
+$myCodonTable = Bio::Tools::CodonTable->new();
+
+# boolean tests
+is $myCodonTable->is_start_codon('ATG'), 1;
+is $myCodonTable->is_start_codon('GTG'), 0;
+is $myCodonTable->is_start_codon('TTG'), 1;
+is $myCodonTable->is_start_codon('CTG'), 1;
+is $myCodonTable->is_start_codon('CCC'), 0;
+
+$myCodonTable->id(24);
+
+is $myCodonTable->is_start_codon('ATG'), 1;
+is $myCodonTable->is_start_codon('GTG'), 0;
+is $myCodonTable->is_start_codon('TTG'), 0;
+is $myCodonTable->is_start_codon('CTG'), 0;
+is $myCodonTable->is_start_codon('CCC'), 0;

0 comments on commit e49f294

Please sign in to comment.