<s> '''<STR_LIT>''' <EOL> import unittest <EOL> from Bio import Seq <EOL> from Bio . Alphabet import generic_dna <EOL> from pyvolve import * <EOL> ZERO = <NUM_LIT> <EOL> DECIMAL = <NUM_LIT:8> <EOL> class state_freqs_RandomFrequencies_Tests ( unittest . TestCase ) : <EOL> '''<STR_LIT>''' <EOL> def setUp ( self ) : <EOL> self . dec = <NUM_LIT:8> <EOL> def test_RandomFrequencies_calculate_freqs_bycodon_typecodon_restriction ( self ) : <EOL> correct_len = <NUM_LIT> <EOL> self . rFreqs = RandomFrequencies ( '<STR_LIT>' , restrict = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] ) <EOL> freqs = self . rFreqs . compute_frequencies ( type = '<STR_LIT>' ) <EOL> sum = freqs [ <NUM_LIT:10> ] + freqs [ <NUM_LIT> ] + freqs [ <NUM_LIT> ] + freqs [ <NUM_LIT> ] <EOL> np . testing . assert_almost_equal ( sum , <NUM_LIT:1.> , decimal = self . dec , err_msg = "<STR_LIT>" ) <EOL> self . assertEqual ( len ( freqs ) , correct_len , msg = "<STR_LIT>" ) <EOL> def test_RandomFrequencies_calculate_freqs_bycodon_typecodon ( self ) : <EOL> correct_len = <NUM_LIT> <EOL> self . rFreqs = RandomFrequencies ( '<STR_LIT>' ) <EOL> freqs = self . rFreqs . compute_frequencies ( type = '<STR_LIT>' ) <EOL> np . testing . assert_almost_equal ( np . sum ( freqs ) , <NUM_LIT:1.> , decimal = self . dec , err_msg = "<STR_LIT>" ) <EOL> self . assertEqual ( len ( freqs ) , correct_len , msg = "<STR_LIT>" ) <EOL> def test_RandomFrequencies_calculate_freqs_bycodon_typeamino ( self ) : <EOL> correct_len = <NUM_LIT:20> <EOL> self . rFreqs = RandomFrequencies ( '<STR_LIT>' ) <EOL> freqs = self . rFreqs . compute_frequencies ( type = '<STR_LIT>' ) <EOL> np . testing . assert_almost_equal ( np . sum ( freqs ) , <NUM_LIT:1.> , decimal = self . dec , err_msg = "<STR_LIT>" ) <EOL> self . assertEqual ( len ( freqs ) , correct_len , msg = "<STR_LIT>" ) <EOL> def test_RandomFrequencies_calculate_freqs_bycodon_typenuc ( self ) : <EOL> correct_len = <NUM_LIT:4> <EOL> self . rFreqs = RandomFrequencies ( '<STR_LIT>' ) <EOL> freqs = self . rFreqs . compute_frequencies ( type = '<STR_LIT>' ) <EOL> np . testing . assert_almost_equal ( np . sum ( freqs ) , <NUM_LIT:1.> , decimal = self . dec , err_msg = "<STR_LIT>" ) <EOL> self . assertEqual ( len ( freqs ) , correct_len , msg = "<STR_LIT>" ) <EOL> def test_RandomFrequencies_calculate_freqs_byamino_typecodon ( self ) : <EOL> correct_len = <NUM_LIT> <EOL> self . rFreqs = RandomFrequencies ( '<STR_LIT>' ) <EOL> freqs = self . rFreqs . compute_frequencies ( type = '<STR_LIT>' ) <EOL> np . testing . assert_almost_equal ( np . sum ( freqs ) , <NUM_LIT:1.> , decimal = self . dec , err_msg = "<STR_LIT>" ) <EOL> self . assertEqual ( len ( freqs ) , correct_len , msg = "<STR_LIT>" ) <EOL> def test_RandomFrequencies_calculate_freqs_byamino_typeamino ( self ) : <EOL> correct_len = <NUM_LIT:20> <EOL> self . rFreqs = RandomFrequencies ( '<STR_LIT>' ) <EOL> freqs = self . rFreqs . compute_frequencies ( type = '<STR_LIT>' ) <EOL> np . testing . assert_almost_equal ( np . sum ( freqs ) , <NUM_LIT:1.> , decimal = self . dec , err_msg = "<STR_LIT>" ) <EOL> self . assertEqual ( len ( freqs ) , correct_len , msg = "<STR_LIT>" ) <EOL> def test_RandomFrequencies_calculate_freqs_byamino_typenuc ( self ) : <EOL> correct_len = <NUM_LIT:4> <EOL> self . rFreqs = RandomFrequencies ( '<STR_LIT>' ) <EOL> freqs = self . rFreqs . compute_frequencies ( type = '<STR_LIT>' ) <EOL> np . testing . assert_almost_equal ( np . sum ( freqs ) , <NUM_LIT:1.> , decimal = self . dec , err_msg = "<STR_LIT>" ) <EOL> self . assertEqual ( len ( freqs ) , correct_len , msg = "<STR_LIT>" ) <EOL> def test_RandomFrequencies_calculate_freqs_bynuc_typenuc ( self ) : <EOL> correct_len = <NUM_LIT:4> <EOL> self . rFreqs = RandomFrequencies ( '<STR_LIT>' ) <EOL> freqs = self . rFreqs . compute_frequencies ( type = '<STR_LIT>' ) <EOL> np . testing . assert_almost_equal ( np . sum ( freqs ) , <NUM_LIT:1.> , decimal = self . dec , err_msg = "<STR_LIT>" ) <EOL> self . assertEqual ( len ( freqs ) , correct_len , msg = "<STR_LIT>" ) <EOL> class state_freqs_EqualFrequencies_Tests ( unittest . TestCase ) : <EOL> '''<STR_LIT>''' <EOL> def setUp ( self ) : <EOL> self . dec = <NUM_LIT:8> <EOL> def test_EqualFrequencies_calculate_freqs_bycodon_typecodon_restrict ( self ) : <EOL> correct = np . zeros ( <NUM_LIT> ) <EOL> correct [ <NUM_LIT:10> ] = <NUM_LIT> <EOL> correct [ <NUM_LIT> ] = <NUM_LIT> <EOL> correct [ <NUM_LIT> ] = <NUM_LIT> <EOL> correct [ <NUM_LIT> ] = <NUM_LIT> <EOL> self . eqFreqs = EqualFrequencies ( '<STR_LIT>' , restrict = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] ) <EOL> freqs = self . eqFreqs . compute_frequencies ( type = '<STR_LIT>' ) <EOL> np . testing . assert_array_almost_equal ( correct , freqs , decimal = self . dec , err_msg = "<STR_LIT>" ) <EOL> def test_EqualFrequencies_calculate_freqs_bycodon_typecodon ( self ) : <EOL> correct = np . array ( np . repeat ( <NUM_LIT:1.> / <NUM_LIT> , <NUM_LIT> ) ) <EOL> self . eqFreqs = EqualFrequencies ( '<STR_LIT>' ) <EOL> freqs = self . eqFreqs . compute_frequencies ( type = '<STR_LIT>' ) <EOL> np . testing . assert_array_almost_equal ( correct , freqs , decimal = self . dec , err_msg = "<STR_LIT>" ) <EOL> def test_EqualFrequencies_calculate_freqs_bycodon_typeamino ( self ) : <EOL> correct = np . array ( [ <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ] ) <EOL> self . eqFreqs = EqualFrequencies ( '<STR_LIT>' ) <EOL> freqs = self . eqFreqs . compute_frequencies ( type = '<STR_LIT>' ) <EOL> np . testing . assert_array_almost_equal ( correct , freqs , decimal = self . dec , err_msg = "<STR_LIT>" ) <EOL> def test_EqualFrequencies_calculate_freqs_bycodon_typenuc ( self ) : <EOL> correct = np . array ( [ <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ] ) <EOL> self . eqFreqs = EqualFrequencies ( '<STR_LIT>' ) <EOL> freqs = self . eqFreqs . compute_frequencies ( type = '<STR_LIT>' ) <EOL> np . testing . assert_array_almost_equal ( correct , freqs , decimal = self . dec , err_msg = "<STR_LIT>" ) <EOL> def test_EqualFrequencies_calculate_freqs_byamino_typeamino_restrict ( self ) : <EOL> correct = [ <NUM_LIT:1.> / <NUM_LIT> , <NUM_LIT:0.> , <NUM_LIT:0.> , <NUM_LIT:0.> , <NUM_LIT:0.> , <NUM_LIT:0.> , <NUM_LIT:0.> , <NUM_LIT:0.> , <NUM_LIT:0.> , <NUM_LIT:0.> , <NUM_LIT:1.> / <NUM_LIT> , <NUM_LIT:0.> , <NUM_LIT:1.> / <NUM_LIT> , <NUM_LIT:0.> , <NUM_LIT:0.> , <NUM_LIT:0.> , <NUM_LIT:0.> , <NUM_LIT:0.> , <NUM_LIT:0.> , <NUM_LIT:0.> ] <EOL> self . eqFreqs = EqualFrequencies ( '<STR_LIT>' , restrict = [ '<STR_LIT:A>' , '<STR_LIT:M>' , '<STR_LIT:P>' ] ) <EOL> freqs = self . eqFreqs . compute_frequencies ( type = '<STR_LIT>' ) <EOL> np . testing . assert_array_almost_equal ( correct , freqs , decimal = self . dec , err_msg = "<STR_LIT>" ) <EOL> def test_EqualFrequencies_calculate_freqs_byamino_typecodon ( self ) : <EOL> correct = np . array ( [ <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ] ) <EOL> self . eqFreqs = EqualFrequencies ( '<STR_LIT>' ) <EOL> freqs = self . eqFreqs . compute_frequencies ( type = '<STR_LIT>' ) <EOL> np . testing . assert_array_almost_equal ( correct , freqs , decimal = self . dec , err_msg = "<STR_LIT>" ) <EOL> def test_EqualFrequencies_calculate_freqs_byamino_typeamino ( self ) : <EOL> correct = np . array ( np . repeat ( <NUM_LIT:1.> / <NUM_LIT> , <NUM_LIT:20> ) ) <EOL> self . eqFreqs = EqualFrequencies ( '<STR_LIT>' ) <EOL> freqs = self . eqFreqs . compute_frequencies ( type = '<STR_LIT>' ) <EOL> np . testing . assert_array_almost_equal ( correct , freqs , decimal = self . dec , err_msg = "<STR_LIT>" ) <EOL> def test_EqualFrequencies_calculate_freqs_byamino_typenuc ( self ) : <EOL> correct = [ <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ] <EOL> self . eqFreqs = EqualFrequencies ( '<STR_LIT>' ) <EOL> freqs = self . eqFreqs . compute_frequencies ( type = '<STR_LIT>' ) <EOL> np . testing . assert_array_almost_equal ( correct , freqs , decimal = self . dec , err_msg = "<STR_LIT>" ) <EOL> def test_EqualFrequencies_calculate_freqs_bynuc_typenuc ( self ) : <EOL> correct = np . array ( np . repeat ( <NUM_LIT> , <NUM_LIT:4> ) ) <EOL> self . eqFreqs = EqualFrequencies ( '<STR_LIT>' ) <EOL> freqs = self . eqFreqs . compute_frequencies ( type = '<STR_LIT>' ) <EOL> np . testing . assert_array_almost_equal ( correct , freqs , decimal = self . dec , err_msg = "<STR_LIT>" ) <EOL> class state_freqs_CustomFrequencies_Tests ( unittest . TestCase ) : <EOL> '''<STR_LIT>''' <EOL> def setUp ( self ) : <EOL> self . dec = <NUM_LIT:8> <EOL> def test_CustomFrequencies_calculate_freqs_bynuc_typenuc_singlenuc ( self ) : <EOL> correct = np . zeros ( <NUM_LIT:4> ) <EOL> correct [ <NUM_LIT:1> ] = <NUM_LIT:1.0> <EOL> self . uFreqs = CustomFrequencies ( '<STR_LIT>' , freq_dict = { '<STR_LIT:C>' : <NUM_LIT:1.0> } ) <EOL> freqs = self . uFreqs . compute_frequencies ( type = '<STR_LIT>' ) <EOL> np . testing . assert_array_almost_equal ( correct , freqs , decimal = self . dec , err_msg = "<STR_LIT>" ) <EOL> def test_CustomFrequencies_calculate_freqs_bynuc_typenuc_multiplenuc ( self ) : <EOL> correct = np . zeros ( <NUM_LIT:4> ) <EOL> correct [ <NUM_LIT:0> ] = <NUM_LIT> <EOL> correct [ <NUM_LIT:1> ] = <NUM_LIT> <EOL> correct [ <NUM_LIT:2> ] = <NUM_LIT> <EOL> correct [ <NUM_LIT:3> ] = <NUM_LIT> <EOL> self . uFreqs = CustomFrequencies ( '<STR_LIT>' , freq_dict = { '<STR_LIT:A>' : <NUM_LIT> , '<STR_LIT:C>' : <NUM_LIT> , '<STR_LIT>' : <NUM_LIT> , '<STR_LIT:T>' : <NUM_LIT> } ) <EOL> freqs = self . uFreqs . compute_frequencies ( type = '<STR_LIT>' ) <EOL> np . testing . assert_array_almost_equal ( correct , freqs , decimal = self . dec , err_msg = "<STR_LIT>" ) <EOL> def test_CustomFrequencies_calculate_freqs_bycodon_typecodon_singlecodon ( self ) : <EOL> correct = np . zeros ( <NUM_LIT> ) <EOL> correct [ <NUM_LIT:1> ] = <NUM_LIT:1.0> <EOL> self . uFreqs = CustomFrequencies ( '<STR_LIT>' , freq_dict = { '<STR_LIT>' : <NUM_LIT:1.0> } ) <EOL> freqs = self . uFreqs . compute_frequencies ( type = '<STR_LIT>' ) <EOL> np . testing . assert_array_almost_equal ( correct , freqs , decimal = self . dec , err_msg = "<STR_LIT>" ) <EOL> def test_CustomFrequencies_calculate_freqs_bycodon_typecodon_multiplecodons ( self ) : <EOL> correct = np . zeros ( <NUM_LIT> ) <EOL> correct [ <NUM_LIT:1> ] = <NUM_LIT:0.5> <EOL> correct [ <NUM_LIT:2> ] = <NUM_LIT:0.5> <EOL> self . uFreqs = CustomFrequencies ( '<STR_LIT>' , freq_dict = { '<STR_LIT>' : <NUM_LIT:0.5> , '<STR_LIT>' : <NUM_LIT:0.5> } ) <EOL> freqs = self . uFreqs . compute_frequencies ( type = '<STR_LIT>' ) <EOL> np . testing . assert_array_almost_equal ( correct , freqs , decimal = self . dec , err_msg = "<STR_LIT>" ) <EOL> def test_CustomFrequencies_calculate_freqs_bycodon_typeamino ( self ) : <EOL> correct = np . zeros ( <NUM_LIT:20> ) <EOL> correct [ <NUM_LIT:8> ] = <NUM_LIT:0.5> <EOL> correct [ <NUM_LIT:9> ] = <NUM_LIT> <EOL> correct [ <NUM_LIT:10> ] = <NUM_LIT> <EOL> self . uFreqs = CustomFrequencies ( '<STR_LIT>' , freq_dict = { '<STR_LIT>' : <NUM_LIT:0.5> , '<STR_LIT>' : <NUM_LIT> , '<STR_LIT>' : <NUM_LIT> } ) <EOL> freqs = self . uFreqs . compute_frequencies ( type = '<STR_LIT>' ) <EOL> np . testing . assert_array_almost_equal ( correct , freqs , decimal = self . dec , err_msg = "<STR_LIT>" ) <EOL> def test_CustomFrequencies_calculate_freqs_byamino_typeamino_singleaa ( self ) : <EOL> correct = np . zeros ( <NUM_LIT:20> ) <EOL> correct [ <NUM_LIT:1> ] = <NUM_LIT:1.0> <EOL> self . uFreqs = CustomFrequencies ( '<STR_LIT>' , freq_dict = { '<STR_LIT:C>' : <NUM_LIT:1.0> } ) <EOL> freqs = self . uFreqs . compute_frequencies ( type = '<STR_LIT>' ) <EOL> np . testing . assert_array_almost_equal ( correct , freqs , decimal = self . dec , err_msg = "<STR_LIT>" ) <EOL> def test_CustomFrequencies_calculate_freqs_byamino_typeamino_multipleaa ( self ) : <EOL> correct = np . zeros ( <NUM_LIT:20> ) <EOL> correct [ <NUM_LIT:1> ] = <NUM_LIT> <EOL> correct [ <NUM_LIT:2> ] = <NUM_LIT> <EOL> correct [ <NUM_LIT:3> ] = <NUM_LIT> <EOL> correct [ <NUM_LIT:4> ] = <NUM_LIT> <EOL> self . uFreqs = CustomFrequencies ( '<STR_LIT>' , freq_dict = { '<STR_LIT:C>' : <NUM_LIT> , '<STR_LIT:D>' : <NUM_LIT> , '<STR_LIT:E>' : <NUM_LIT> , '<STR_LIT:F>' : <NUM_LIT> } ) <EOL> freqs = self . uFreqs . compute_frequencies ( type = '<STR_LIT>' ) <EOL> np . testing . assert_array_almost_equal ( correct , freqs , decimal = self . dec , err_msg = "<STR_LIT>" ) <EOL> def test_CustomFrequencies_calculate_freqs_byamino_typecodon_multipleaa ( self ) : <EOL> correct = [ <NUM_LIT:0.> , <NUM_LIT:0.> , <NUM_LIT:0.> , <NUM_LIT:0.> , <NUM_LIT:0.> , <NUM_LIT:0.> , <NUM_LIT:0.> , <NUM_LIT:0.> , <NUM_LIT:0.> , <NUM_LIT:0.> , <NUM_LIT:0.> , <NUM_LIT:0.> , <NUM_LIT:0.> , <NUM_LIT:0.> , <NUM_LIT:0.> , <NUM_LIT:0.> , <NUM_LIT:0.> , <NUM_LIT:0.> , <NUM_LIT:0.> , <NUM_LIT:0.> , <NUM_LIT:0.> , <NUM_LIT:0.> , <NUM_LIT:0.> , <NUM_LIT:0.> , <NUM_LIT:0.> , <NUM_LIT:0.> , <NUM_LIT:0.> , <NUM_LIT:0.> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT:0.> , <NUM_LIT:0.> , <NUM_LIT:0.> , <NUM_LIT:0.> , <NUM_LIT:0.> , <NUM_LIT:0.> , <NUM_LIT:0.> , <NUM_LIT:0.> , <NUM_LIT:0.> , <NUM_LIT:0.> , <NUM_LIT:0.> , <NUM_LIT:0.> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT:0.> , <NUM_LIT:0.> , <NUM_LIT:0.> , <NUM_LIT:0.> , <NUM_LIT:0.> , <NUM_LIT:0.> , <NUM_LIT:0.> , <NUM_LIT:0.> , <NUM_LIT:0.> , <NUM_LIT> , <NUM_LIT:0.> , <NUM_LIT> , <NUM_LIT:0.> ] <EOL> self . uFreqs = CustomFrequencies ( '<STR_LIT>' , freq_dict = { '<STR_LIT:L>' : <NUM_LIT:0.5> , '<STR_LIT>' : <NUM_LIT:0.5> } ) <EOL> freqs = self . uFreqs . compute_frequencies ( type = '<STR_LIT>' ) <EOL> np . testing . assert_array_almost_equal ( correct , freqs , decimal = self . dec , err_msg = "<STR_LIT>" ) <EOL> class state_freqs_ReadFrequencies_Tests ( unittest . TestCase ) : <EOL> '''<STR_LIT>''' <EOL> def setUp ( self ) : <EOL> self . dec = <NUM_LIT:8> <EOL> def test_ReadFrequencies_calculate_freqs_bynuc_typenuc_nocol ( self ) : <EOL> correct = np . array ( [ <NUM_LIT> / <NUM_LIT> , <NUM_LIT> / <NUM_LIT> , <NUM_LIT> / <NUM_LIT> , <NUM_LIT> / <NUM_LIT> ] ) <EOL> self . rFreqs = ReadFrequencies ( '<STR_LIT>' , file = '<STR_LIT>' ) <EOL> freqs = self . rFreqs . compute_frequencies ( type = '<STR_LIT>' ) <EOL> np . testing . assert_array_almost_equal ( correct , freqs , decimal = self . dec , err_msg = "<STR_LIT>" ) <EOL> def test_ReadFrequencies_calculate_freqs_bynuc_typenuc_col ( self ) : <EOL> correct = np . array ( [ <NUM_LIT> / <NUM_LIT> , <NUM_LIT> / <NUM_LIT> , <NUM_LIT:0> , <NUM_LIT:0> ] ) <EOL> self . rFreqs = ReadFrequencies ( '<STR_LIT>' , columns = [ <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:3> ] , file = '<STR_LIT>' ) <EOL> freqs = self . rFreqs . compute_frequencies ( type = '<STR_LIT>' ) <EOL> np . testing . assert_array_almost_equal ( correct , freqs , decimal = self . dec , err_msg = "<STR_LIT>" ) <EOL> def test_ReadFrequencies_calculate_freqs_bycodon_typecodon_nocol ( self ) : <EOL> correct = np . array ( [ <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:1.> / <NUM_LIT> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:1.> / <NUM_LIT> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:1.> / <NUM_LIT> , <NUM_LIT:1.> / <NUM_LIT> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:1.> / <NUM_LIT> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:1.> / <NUM_LIT> , <NUM_LIT> / <NUM_LIT> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:1.> / <NUM_LIT> ] ) <EOL> self . rFreqs = ReadFrequencies ( '<STR_LIT>' , file = '<STR_LIT>' ) <EOL> freqs = self . rFreqs . compute_frequencies ( type = '<STR_LIT>' ) <EOL> np . testing . assert_array_almost_equal ( correct , freqs , decimal = self . dec , err_msg = "<STR_LIT>" ) <EOL> def test_ReadFrequencies_calculate_freqs_bycodon_typecodon_col ( self ) : <EOL> correct = np . array ( [ <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:1.> / <NUM_LIT> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:1.> / <NUM_LIT> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:1.> / <NUM_LIT> , <NUM_LIT:1.> / <NUM_LIT> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:1.> / <NUM_LIT> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT> / <NUM_LIT> ] ) <EOL> self . rFreqs = ReadFrequencies ( '<STR_LIT>' , columns = [ <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:3> ] , file = '<STR_LIT>' ) <EOL> freqs = self . rFreqs . compute_frequencies ( type = '<STR_LIT>' ) <EOL> np . testing . assert_array_almost_equal ( correct , freqs , decimal = self . dec , err_msg = "<STR_LIT>" ) <EOL> def test_ReadFrequencies_calculate_freqs_bycodon_typeamino_nocol ( self ) : <EOL> correct = np . array ( [ <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:1.> / <NUM_LIT> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:1.> / <NUM_LIT> , <NUM_LIT:0> , <NUM_LIT:1.> / <NUM_LIT> , <NUM_LIT:0> , <NUM_LIT:1.> / <NUM_LIT> , <NUM_LIT:0> , <NUM_LIT:1.> / <NUM_LIT> , <NUM_LIT> / <NUM_LIT> , <NUM_LIT:0> , <NUM_LIT:0> ] ) <EOL> self . rFreqs = ReadFrequencies ( '<STR_LIT>' , file = '<STR_LIT>' ) <EOL> freqs = self . rFreqs . compute_frequencies ( type = '<STR_LIT>' ) <EOL> np . testing . assert_array_almost_equal ( correct , freqs , decimal = self . dec , err_msg = "<STR_LIT>" ) <EOL> def test_ReadFrequencies_calculate_freqs_bycodon_typeamino_col ( self ) : <EOL> correct = np . array ( [ <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT> / <NUM_LIT> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:1.> / <NUM_LIT> , <NUM_LIT:0> , <NUM_LIT> / <NUM_LIT> , <NUM_LIT:0> , <NUM_LIT:1.> / <NUM_LIT> , <NUM_LIT:0> , <NUM_LIT:1.> / <NUM_LIT> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> ] ) <EOL> self . rFreqs = ReadFrequencies ( '<STR_LIT>' , columns = [ <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:3> ] , file = '<STR_LIT>' ) <EOL> freqs = self . rFreqs . compute_frequencies ( type = '<STR_LIT>' ) <EOL> np . testing . assert_array_almost_equal ( correct , freqs , decimal = self . dec , err_msg = "<STR_LIT>" ) <EOL> def test_ReadFrequencies_calculate_freqs_bycodon_typenuc_nocol ( self ) : <EOL> correct = np . array ( [ <NUM_LIT> / <NUM_LIT> , <NUM_LIT> / <NUM_LIT> , <NUM_LIT> / <NUM_LIT> , <NUM_LIT> / <NUM_LIT> ] ) <EOL> self . rFreqs = ReadFrequencies ( '<STR_LIT>' , file = '<STR_LIT>' ) <EOL> freqs = self . rFreqs . compute_frequencies ( type = '<STR_LIT>' ) <EOL> np . testing . assert_array_almost_equal ( correct , freqs , decimal = self . dec , err_msg = "<STR_LIT>" ) <EOL> def test_ReadFrequencies_calculate_freqs_bycodon_typenuc_col ( self ) : <EOL> correct = np . array ( [ <NUM_LIT> / <NUM_LIT> , <NUM_LIT> / <NUM_LIT> , <NUM_LIT> / <NUM_LIT> , <NUM_LIT> / <NUM_LIT> ] ) <EOL> self . rFreqs = ReadFrequencies ( '<STR_LIT>' , columns = [ <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:3> ] , file = '<STR_LIT>' ) <EOL> freqs = self . rFreqs . compute_frequencies ( type = '<STR_LIT>' ) <EOL> np . testing . assert_array_almost_equal ( correct , freqs , decimal = self . dec , err_msg = "<STR_LIT>" ) <EOL> def test_ReadFrequencies_calculate_freqs_byamino_typeamino_nocol ( self ) : <EOL> correct = np . array ( [ <NUM_LIT:1.> / <NUM_LIT> , <NUM_LIT:1.> / <NUM_LIT> , <NUM_LIT:1.> / <NUM_LIT> , <NUM_LIT:1.> / <NUM_LIT> , <NUM_LIT:1.> / <NUM_LIT> , <NUM_LIT:1.> / <NUM_LIT> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> ] ) <EOL> self . rFreqs = ReadFrequencies ( '<STR_LIT>' , file = '<STR_LIT>' ) <EOL> freqs = self . rFreqs . compute_frequencies ( type = '<STR_LIT>' ) <EOL> np . testing . assert_array_almost_equal ( correct , freqs , decimal = self . dec , err_msg = "<STR_LIT>" ) <EOL> def test_ReadFrequencies_calculate_freqs_byamino_typeamino_col ( self ) : <EOL> correct = np . array ( [ <NUM_LIT> / <NUM_LIT> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:1.> / <NUM_LIT> , <NUM_LIT:0.> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> ] ) <EOL> self . rFreqs = ReadFrequencies ( '<STR_LIT>' , columns = [ <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:3> ] , file = '<STR_LIT>' ) <EOL> freqs = self . rFreqs . compute_frequencies ( type = '<STR_LIT>' ) <EOL> np . testing . assert_array_almost_equal ( correct , freqs , decimal = self . dec , err_msg = "<STR_LIT>" ) <EOL> def test_ReadFrequencies_calculate_freqs_byamino_typecodon_nocol ( self ) : <EOL> correct = np . array ( [ <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT> , <NUM_LIT:0> , <NUM_LIT> , <NUM_LIT:0> , <NUM_LIT> , <NUM_LIT:0> , <NUM_LIT> ] ) <EOL> self . rFreqs = ReadFrequencies ( '<STR_LIT>' , file = '<STR_LIT>' ) <EOL> freqs = self . rFreqs . compute_frequencies ( type = '<STR_LIT>' ) <EOL> np . testing . assert_array_almost_equal ( correct , freqs , decimal = self . dec , err_msg = "<STR_LIT>" ) <EOL> def test_ReadFrequencies_calculate_freqs_byamino_typecodon_col ( self ) : <EOL> correct = np . array ( [ <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:1.> / <NUM_LIT> , <NUM_LIT:0> , <NUM_LIT:1.> / <NUM_LIT> , <NUM_LIT:0> , <NUM_LIT:1.> / <NUM_LIT> , <NUM_LIT:1.> / <NUM_LIT> , <NUM_LIT:1.> / <NUM_LIT> , <NUM_LIT:1.> / <NUM_LIT> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> ] ) <EOL> self . rFreqs = ReadFrequencies ( '<STR_LIT>' , columns = [ <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:3> ] , file = '<STR_LIT>' ) <EOL> freqs = self . rFreqs . compute_frequencies ( type = '<STR_LIT>' ) <EOL> np . testing . assert_array_almost_equal ( correct , freqs , decimal = self . dec , err_msg = "<STR_LIT>" ) </s>
