diff --git a/biokit/services/coding_sequences/base.py b/biokit/services/coding_sequences/base.py index 0675955..5d5f011 100644 --- a/biokit/services/coding_sequences/base.py +++ b/biokit/services/coding_sequences/base.py @@ -57,7 +57,7 @@ def calculate_rscu(self, translation_table) -> dict: try: observed_sum += codon_counts[codon] except KeyError: - observed_sum = 0 + pass for codon in codons: try: rscu[codon] = round( diff --git a/biokit/version.py b/biokit/version.py index 72f26f5..0b2f79d 100644 --- a/biokit/version.py +++ b/biokit/version.py @@ -1 +1 @@ -__version__ = "1.1.2" +__version__ = "1.1.3" diff --git a/change_log.txt b/change_log.txt index 7a6819e..072f9e3 100644 --- a/change_log.txt +++ b/change_log.txt @@ -21,3 +21,6 @@ Added "X" as a gap character during alignment recoding 1.1.0 Added Dayhoff-9, -12, -15, and -18 recoding schemes + +1.1.3 +Fixed bug in RSCU calculations diff --git a/docs/change_log/index.rst b/docs/change_log/index.rst index 26584d2..d1480f7 100644 --- a/docs/change_log/index.rst +++ b/docs/change_log/index.rst @@ -25,3 +25,5 @@ are skipped during analysis of RSCU and gw-RSCU. *1.0.1*: Added "X" as a gap character during alignment recoding *1.1.0*: Added Dayhoff-9, -12, -15, and -18 recoding schemes + +*1.1.3*: Fixed bug in RSCU calculations diff --git a/tests/integration/coding_sequences/test_relative_synonymous_codon_usage.py b/tests/integration/coding_sequences/test_relative_synonymous_codon_usage.py index ff82b68..638d68d 100644 --- a/tests/integration/coding_sequences/test_relative_synonymous_codon_usage.py +++ b/tests/integration/coding_sequences/test_relative_synonymous_codon_usage.py @@ -35,7 +35,7 @@ def test_relative_synonymous_codon_usage(self, mocked_print): @patch("builtins.print") def test_relative_synonymous_codon_usage_tt1(self, mocked_print): - expected_result = "GGU\t2.6316\nCCA\t2.4286\nAGA\t2.2941\nUUA\t2.1892\nGCU\t2.0\nUCU\t1.9355\nAUU\t1.9\nGAA\t1.7714\nACU\t1.7391\nUGU\t1.6667\nUUG\t1.5405\nAAA\t1.5\nAGG\t1.4118\nCAA\t1.3636\nGUU\t1.2881\nAGU\t1.2581\nUUU\t1.2558\nGAU\t1.2432\nCAU\t1.1667\nAAU\t1.0769\nCGU\t1.0588\nACC\t1.0435\nGUG\t1.0169\nAUG\t1.0\nUAU\t1.0\nUAC\t1.0\nUGG\t1.0\nUCC\t0.9677\nUCA\t0.9677\nGCC\t0.963\nACA\t0.9565\nGUC\t0.9492\nAAC\t0.9231\nCCU\t0.8571\nCAC\t0.8333\nGCA\t0.8148\nGAC\t0.7568\nAUC\t0.75\nGUA\t0.7458\nUUC\t0.7442\nCGG\t0.7059\nCUA\t0.6486\nCAG\t0.6364\nCUU\t0.5676\nCUG\t0.5676\nGGA\t0.5263\nGGG\t0.5263\nAAG\t0.5\nCUC\t0.4865\nUCG\t0.4839\nCCG\t0.4286\nAGC\t0.3871\nCGA\t0.3529\nAUA\t0.35\nUGC\t0.3333\nGGC\t0.3158\nCCC\t0.2857\nACG\t0.2609\nGAG\t0.2286\nGCG\t0.2222\nCGC\t0.1765\nUAA\t0\nUAG\t0\nUGA\t0" + expected_result = "GGU\t2.6316\nCCA\t2.4286\nAGA\t2.2941\nUUA\t2.1892\nGCU\t2.0\nUAG\t2.0\nUCU\t1.9355\nAUU\t1.9\nGAA\t1.7714\nACU\t1.7391\nUGU\t1.6667\nUUG\t1.5405\nAAA\t1.5\nAGG\t1.4118\nCAA\t1.3636\nGUU\t1.2881\nAGU\t1.2581\nUUU\t1.2558\nGAU\t1.2432\nCAU\t1.1667\nAAU\t1.0769\nCGU\t1.0588\nACC\t1.0435\nGUG\t1.0169\nAUG\t1.0\nUAU\t1.0\nUAC\t1.0\nUAA\t1.0\nUGG\t1.0\nUCC\t0.9677\nUCA\t0.9677\nGCC\t0.963\nACA\t0.9565\nGUC\t0.9492\nAAC\t0.9231\nCCU\t0.8571\nCAC\t0.8333\nGCA\t0.8148\nGAC\t0.7568\nAUC\t0.75\nGUA\t0.7458\nUUC\t0.7442\nCGG\t0.7059\nCUA\t0.6486\nCAG\t0.6364\nCUU\t0.5676\nCUG\t0.5676\nGGA\t0.5263\nGGG\t0.5263\nAAG\t0.5\nCUC\t0.4865\nUCG\t0.4839\nCCG\t0.4286\nAGC\t0.3871\nCGA\t0.3529\nAUA\t0.35\nUGC\t0.3333\nGGC\t0.3158\nCCC\t0.2857\nACG\t0.2609\nGAG\t0.2286\nGCG\t0.2222\nCGC\t0.1765\nUGA\t0" testargs = [ "biokit", @@ -140,7 +140,7 @@ def test_relative_synonymous_codon_usage_tt9(self, mocked_print): @patch("builtins.print") def test_relative_synonymous_codon_usage_tt10(self, mocked_print): - expected_result = "GGU\t2.6316\nCCA\t2.4286\nAGA\t2.2941\nUUA\t2.1892\nGCU\t2.0\nUCU\t1.9355\nAUU\t1.9\nGAA\t1.7714\nACU\t1.7391\nUUG\t1.5405\nAAA\t1.5\nAGG\t1.4118\nCAA\t1.3636\nUAG\t1.3333\nGUU\t1.2881\nAGU\t1.2581\nUUU\t1.2558\nGAU\t1.2432\nCAU\t1.1667\nAAU\t1.0769\nCGU\t1.0588\nACC\t1.0435\nGUG\t1.0169\nAUG\t1.0\nUAU\t1.0\nUAC\t1.0\nUGG\t1.0\nUCC\t0.9677\nUCA\t0.9677\nGCC\t0.963\nACA\t0.9565\nGUC\t0.9492\nAAC\t0.9231\nCCU\t0.8571\nCAC\t0.8333\nGCA\t0.8148\nGAC\t0.7568\nAUC\t0.75\nGUA\t0.7458\nUUC\t0.7442\nCGG\t0.7059\nUAA\t0.6667\nCUA\t0.6486\nCAG\t0.6364\nCUU\t0.5676\nCUG\t0.5676\nGGA\t0.5263\nGGG\t0.5263\nAAG\t0.5\nCUC\t0.4865\nUCG\t0.4839\nCCG\t0.4286\nAGC\t0.3871\nCGA\t0.3529\nAUA\t0.35\nGGC\t0.3158\nCCC\t0.2857\nACG\t0.2609\nGAG\t0.2286\nGCG\t0.2222\nCGC\t0.1765\nUGU\t0\nUGC\t0\nUGA\t0" + expected_result = "GGU\t2.6316\nUGU\t2.5\nCCA\t2.4286\nAGA\t2.2941\nUUA\t2.1892\nGCU\t2.0\nUCU\t1.9355\nAUU\t1.9\nGAA\t1.7714\nACU\t1.7391\nUUG\t1.5405\nAAA\t1.5\nAGG\t1.4118\nCAA\t1.3636\nUAG\t1.3333\nGUU\t1.2881\nAGU\t1.2581\nUUU\t1.2558\nGAU\t1.2432\nCAU\t1.1667\nAAU\t1.0769\nCGU\t1.0588\nACC\t1.0435\nGUG\t1.0169\nAUG\t1.0\nUAU\t1.0\nUAC\t1.0\nUGG\t1.0\nUCC\t0.9677\nUCA\t0.9677\nGCC\t0.963\nACA\t0.9565\nGUC\t0.9492\nAAC\t0.9231\nCCU\t0.8571\nCAC\t0.8333\nGCA\t0.8148\nGAC\t0.7568\nAUC\t0.75\nGUA\t0.7458\nUUC\t0.7442\nCGG\t0.7059\nUAA\t0.6667\nCUA\t0.6486\nCAG\t0.6364\nCUU\t0.5676\nCUG\t0.5676\nGGA\t0.5263\nGGG\t0.5263\nAAG\t0.5\nUGC\t0.5\nCUC\t0.4865\nUCG\t0.4839\nCCG\t0.4286\nAGC\t0.3871\nCGA\t0.3529\nAUA\t0.35\nGGC\t0.3158\nCCC\t0.2857\nACG\t0.2609\nGAG\t0.2286\nGCG\t0.2222\nCGC\t0.1765\nUGA\t0" testargs = [ "biokit", @@ -155,7 +155,7 @@ def test_relative_synonymous_codon_usage_tt10(self, mocked_print): @patch("builtins.print") def test_relative_synonymous_codon_usage_tt11(self, mocked_print): - expected_result = "GGU\t2.6316\nCCA\t2.4286\nAGA\t2.2941\nUUA\t2.1892\nGCU\t2.0\nUCU\t1.9355\nAUU\t1.9\nGAA\t1.7714\nACU\t1.7391\nUGU\t1.6667\nUUG\t1.5405\nAAA\t1.5\nAGG\t1.4118\nCAA\t1.3636\nGUU\t1.2881\nAGU\t1.2581\nUUU\t1.2558\nGAU\t1.2432\nCAU\t1.1667\nAAU\t1.0769\nCGU\t1.0588\nACC\t1.0435\nGUG\t1.0169\nAUG\t1.0\nUAU\t1.0\nUAC\t1.0\nUGG\t1.0\nUCC\t0.9677\nUCA\t0.9677\nGCC\t0.963\nACA\t0.9565\nGUC\t0.9492\nAAC\t0.9231\nCCU\t0.8571\nCAC\t0.8333\nGCA\t0.8148\nGAC\t0.7568\nAUC\t0.75\nGUA\t0.7458\nUUC\t0.7442\nCGG\t0.7059\nCUA\t0.6486\nCAG\t0.6364\nCUU\t0.5676\nCUG\t0.5676\nGGA\t0.5263\nGGG\t0.5263\nAAG\t0.5\nCUC\t0.4865\nUCG\t0.4839\nCCG\t0.4286\nAGC\t0.3871\nCGA\t0.3529\nAUA\t0.35\nUGC\t0.3333\nGGC\t0.3158\nCCC\t0.2857\nACG\t0.2609\nGAG\t0.2286\nGCG\t0.2222\nCGC\t0.1765\nUAA\t0\nUAG\t0\nUGA\t0" + expected_result = "GGU\t2.6316\nCCA\t2.4286\nAGA\t2.2941\nUUA\t2.1892\nGCU\t2.0\nUAG\t2.0\nUCU\t1.9355\nAUU\t1.9\nGAA\t1.7714\nACU\t1.7391\nUGU\t1.6667\nUUG\t1.5405\nAAA\t1.5\nAGG\t1.4118\nCAA\t1.3636\nGUU\t1.2881\nAGU\t1.2581\nUUU\t1.2558\nGAU\t1.2432\nCAU\t1.1667\nAAU\t1.0769\nCGU\t1.0588\nACC\t1.0435\nGUG\t1.0169\nAUG\t1.0\nUAU\t1.0\nUAC\t1.0\nUAA\t1.0\nUGG\t1.0\nUCC\t0.9677\nUCA\t0.9677\nGCC\t0.963\nACA\t0.9565\nGUC\t0.9492\nAAC\t0.9231\nCCU\t0.8571\nCAC\t0.8333\nGCA\t0.8148\nGAC\t0.7568\nAUC\t0.75\nGUA\t0.7458\nUUC\t0.7442\nCGG\t0.7059\nCUA\t0.6486\nCAG\t0.6364\nCUU\t0.5676\nCUG\t0.5676\nGGA\t0.5263\nGGG\t0.5263\nAAG\t0.5\nCUC\t0.4865\nUCG\t0.4839\nCCG\t0.4286\nAGC\t0.3871\nCGA\t0.3529\nAUA\t0.35\nUGC\t0.3333\nGGC\t0.3158\nCCC\t0.2857\nACG\t0.2609\nGAG\t0.2286\nGCG\t0.2222\nCGC\t0.1765\nUGA\t0" testargs = [ "biokit", @@ -170,7 +170,7 @@ def test_relative_synonymous_codon_usage_tt11(self, mocked_print): @patch("builtins.print") def test_relative_synonymous_codon_usage_tt12(self, mocked_print): - expected_result = "GGU\t2.6316\nCCA\t2.4286\nAGA\t2.2941\nUCU\t2.029\nUUA\t2.0149\nGCU\t2.0\nAUU\t1.9\nGAA\t1.7714\nACU\t1.7391\nUGU\t1.6667\nAAA\t1.5\nUUG\t1.4179\nAGG\t1.4118\nCAA\t1.3636\nAGU\t1.3188\nGUU\t1.2881\nUUU\t1.2558\nGAU\t1.2432\nCAU\t1.1667\nAAU\t1.0769\nCGU\t1.0588\nACC\t1.0435\nGUG\t1.0169\nUCC\t1.0145\nUCA\t1.0145\nAUG\t1.0\nUAU\t1.0\nUAC\t1.0\nUGG\t1.0\nGCC\t0.963\nACA\t0.9565\nGUC\t0.9492\nAAC\t0.9231\nCCU\t0.8571\nCAC\t0.8333\nGCA\t0.8148\nGAC\t0.7568\nAUC\t0.75\nGUA\t0.7458\nUUC\t0.7442\nCUG\t0.7101\nCGG\t0.7059\nCAG\t0.6364\nCUA\t0.597\nGGA\t0.5263\nGGG\t0.5263\nCUU\t0.5224\nUCG\t0.5072\nAAG\t0.5\nCUC\t0.4478\nCCG\t0.4286\nAGC\t0.4058\nCGA\t0.3529\nAUA\t0.35\nUGC\t0.3333\nGGC\t0.3158\nCCC\t0.2857\nACG\t0.2609\nGAG\t0.2286\nGCG\t0.2222\nCGC\t0.1765\nUAA\t0\nUAG\t0\nUGA\t0" + expected_result = "GGU\t2.6316\nCCA\t2.4286\nAGA\t2.2941\nUCU\t2.029\nUUA\t2.0149\nGCU\t2.0\nUAG\t2.0\nAUU\t1.9\nGAA\t1.7714\nACU\t1.7391\nUGU\t1.6667\nAAA\t1.5\nUUG\t1.4179\nAGG\t1.4118\nCAA\t1.3636\nAGU\t1.3188\nGUU\t1.2881\nUUU\t1.2558\nGAU\t1.2432\nCAU\t1.1667\nAAU\t1.0769\nCGU\t1.0588\nACC\t1.0435\nGUG\t1.0169\nUCC\t1.0145\nUCA\t1.0145\nAUG\t1.0\nUAU\t1.0\nUAC\t1.0\nUAA\t1.0\nUGG\t1.0\nGCC\t0.963\nACA\t0.9565\nGUC\t0.9492\nAAC\t0.9231\nCCU\t0.8571\nCAC\t0.8333\nGCA\t0.8148\nGAC\t0.7568\nAUC\t0.75\nGUA\t0.7458\nUUC\t0.7442\nCUG\t0.7101\nCGG\t0.7059\nCAG\t0.6364\nCUA\t0.597\nGGA\t0.5263\nGGG\t0.5263\nCUU\t0.5224\nUCG\t0.5072\nAAG\t0.5\nCUC\t0.4478\nCCG\t0.4286\nAGC\t0.4058\nCGA\t0.3529\nAUA\t0.35\nUGC\t0.3333\nGGC\t0.3158\nCCC\t0.2857\nACG\t0.2609\nGAG\t0.2286\nGCG\t0.2222\nCGC\t0.1765\nUGA\t0" testargs = [ "biokit", @@ -215,7 +215,7 @@ def test_relative_synonymous_codon_usage_tt14(self, mocked_print): @patch("builtins.print") def test_relative_synonymous_codon_usage_tt16(self, mocked_print): - expected_result = "GGU\t2.6316\nUUA\t2.4868\nCCA\t2.4286\nAGA\t2.2941\nGCU\t2.0\nUCU\t1.9355\nAUU\t1.9\nGAA\t1.7714\nUUG\t1.75\nACU\t1.7391\nUGU\t1.6667\nAAA\t1.5\nAGG\t1.4118\nCAA\t1.3636\nGUU\t1.2881\nAGU\t1.2581\nUUU\t1.2558\nGAU\t1.2432\nCAU\t1.1667\nAAU\t1.0769\nCGU\t1.0588\nACC\t1.0435\nGUG\t1.0169\nAUG\t1.0\nUAU\t1.0\nUAC\t1.0\nUGG\t1.0\nUCC\t0.9677\nUCA\t0.9677\nGCC\t0.963\nACA\t0.9565\nGUC\t0.9492\nAAC\t0.9231\nCCU\t0.8571\nCAC\t0.8333\nGCA\t0.8148\nGAC\t0.7568\nAUC\t0.75\nGUA\t0.7458\nUUC\t0.7442\nCUA\t0.7368\nCGG\t0.7059\nCUU\t0.6447\nCUG\t0.6447\nCAG\t0.6364\nCUC\t0.5526\nGGA\t0.5263\nGGG\t0.5263\nAAG\t0.5\nUCG\t0.4839\nCCG\t0.4286\nAGC\t0.3871\nCGA\t0.3529\nAUA\t0.35\nUGC\t0.3333\nGGC\t0.3158\nCCC\t0.2857\nACG\t0.2609\nGAG\t0.2286\nGCG\t0.2222\nUAG\t0.1842\nCGC\t0.1765\nUAA\t0\nUGA\t0" + expected_result = "GGU\t2.6316\nUUA\t2.4868\nCCA\t2.4286\nAGA\t2.2941\nGCU\t2.0\nUAA\t2.0\nUCU\t1.9355\nAUU\t1.9\nGAA\t1.7714\nUUG\t1.75\nACU\t1.7391\nUGU\t1.6667\nAAA\t1.5\nAGG\t1.4118\nCAA\t1.3636\nGUU\t1.2881\nAGU\t1.2581\nUUU\t1.2558\nGAU\t1.2432\nCAU\t1.1667\nAAU\t1.0769\nCGU\t1.0588\nACC\t1.0435\nGUG\t1.0169\nAUG\t1.0\nUAU\t1.0\nUAC\t1.0\nUGG\t1.0\nUCC\t0.9677\nUCA\t0.9677\nGCC\t0.963\nACA\t0.9565\nGUC\t0.9492\nAAC\t0.9231\nCCU\t0.8571\nCAC\t0.8333\nGCA\t0.8148\nGAC\t0.7568\nAUC\t0.75\nGUA\t0.7458\nUUC\t0.7442\nCUA\t0.7368\nCGG\t0.7059\nCUU\t0.6447\nCUG\t0.6447\nCAG\t0.6364\nCUC\t0.5526\nGGA\t0.5263\nGGG\t0.5263\nAAG\t0.5\nUCG\t0.4839\nCCG\t0.4286\nAGC\t0.3871\nCGA\t0.3529\nAUA\t0.35\nUGC\t0.3333\nGGC\t0.3158\nCCC\t0.2857\nACG\t0.2609\nGAG\t0.2286\nGCG\t0.2222\nUAG\t0.1842\nCGC\t0.1765\nUGA\t0" testargs = [ "biokit", @@ -245,7 +245,7 @@ def test_relative_synonymous_codon_usage_tt21(self, mocked_print): @patch("builtins.print") def test_relative_synonymous_codon_usage_tt22(self, mocked_print): - expected_result = "GGU\t2.6316\nUUA\t2.4868\nCCA\t2.4286\nAGA\t2.2941\nGCU\t2.0\nUCU\t1.9231\nAUU\t1.9\nGAA\t1.7714\nUUG\t1.75\nACU\t1.7391\nUGU\t1.6667\nAAA\t1.5\nAGG\t1.4118\nCAA\t1.3636\nGUU\t1.2881\nUUU\t1.2558\nAGU\t1.25\nGAU\t1.2432\nCAU\t1.1667\nAAU\t1.0769\nCGU\t1.0588\nACC\t1.0435\nGUG\t1.0169\nAUG\t1.0\nUAU\t1.0\nUAC\t1.0\nUGG\t1.0\nGCC\t0.963\nUCC\t0.9615\nACA\t0.9565\nGUC\t0.9492\nAAC\t0.9231\nCCU\t0.8571\nCAC\t0.8333\nGCA\t0.8148\nGAC\t0.7568\nAUC\t0.75\nGUA\t0.7458\nUUC\t0.7442\nCUA\t0.7368\nCGG\t0.7059\nCUU\t0.6447\nCUG\t0.6447\nCAG\t0.6364\nCUC\t0.5526\nGGA\t0.5263\nGGG\t0.5263\nAAG\t0.5\nUCG\t0.4808\nCCG\t0.4286\nAGC\t0.3846\nCGA\t0.3529\nAUA\t0.35\nUGC\t0.3333\nGGC\t0.3158\nCCC\t0.2857\nACG\t0.2609\nGAG\t0.2286\nGCG\t0.2222\nUAG\t0.1842\nCGC\t0.1765\nUCA\t0\nUAA\t0\nUGA\t0" + expected_result = "UCA\t2.7273\nGGU\t2.6316\nUUA\t2.4868\nCCA\t2.4286\nAGA\t2.2941\nGCU\t2.0\nUCU\t1.9231\nAUU\t1.9\nGAA\t1.7714\nUUG\t1.75\nACU\t1.7391\nUGU\t1.6667\nAAA\t1.5\nAGG\t1.4118\nCAA\t1.3636\nGUU\t1.2881\nUUU\t1.2558\nAGU\t1.25\nGAU\t1.2432\nCAU\t1.1667\nAAU\t1.0769\nCGU\t1.0588\nACC\t1.0435\nGUG\t1.0169\nAUG\t1.0\nUAU\t1.0\nUAC\t1.0\nUGG\t1.0\nGCC\t0.963\nUCC\t0.9615\nACA\t0.9565\nGUC\t0.9492\nAAC\t0.9231\nCCU\t0.8571\nCAC\t0.8333\nGCA\t0.8148\nGAC\t0.7568\nAUC\t0.75\nGUA\t0.7458\nUUC\t0.7442\nCUA\t0.7368\nCGG\t0.7059\nCUU\t0.6447\nCUG\t0.6447\nCAG\t0.6364\nCUC\t0.5526\nGGA\t0.5263\nGGG\t0.5263\nAAG\t0.5\nUCG\t0.4808\nCCG\t0.4286\nAGC\t0.3846\nCGA\t0.3529\nAUA\t0.35\nUGC\t0.3333\nGGC\t0.3158\nCCC\t0.2857\nUAA\t0.2727\nACG\t0.2609\nGAG\t0.2286\nGCG\t0.2222\nUAG\t0.1842\nCGC\t0.1765\nUGA\t0" testargs = [ "biokit", @@ -260,7 +260,7 @@ def test_relative_synonymous_codon_usage_tt22(self, mocked_print): @patch("builtins.print") def test_relative_synonymous_codon_usage_tt23(self, mocked_print): - expected_result = "GGU\t2.6316\nCCA\t2.4286\nAGA\t2.2941\nUUG\t2.0213\nGCU\t2.0\nUCU\t1.9355\nAUU\t1.9\nGAA\t1.7714\nACU\t1.7391\nUGU\t1.6667\nAAA\t1.5\nAGG\t1.4118\nCAA\t1.3636\nGUU\t1.2881\nAGU\t1.2581\nUUU\t1.2558\nGAU\t1.2432\nCAU\t1.1667\nAAU\t1.0769\nCGU\t1.0588\nACC\t1.0435\nGUG\t1.0169\nAUG\t1.0\nUAU\t1.0\nUAC\t1.0\nUGG\t1.0\nUCC\t0.9677\nUCA\t0.9677\nGCC\t0.963\nACA\t0.9565\nGUC\t0.9492\nAAC\t0.9231\nCCU\t0.8571\nCUA\t0.8511\nCAC\t0.8333\nGCA\t0.8148\nGAC\t0.7568\nAUC\t0.75\nGUA\t0.7458\nCUU\t0.7447\nCUG\t0.7447\nUUC\t0.7442\nCGG\t0.7059\nCUC\t0.6383\nCAG\t0.6364\nGGA\t0.5263\nGGG\t0.5263\nAAG\t0.5\nUCG\t0.4839\nCCG\t0.4286\nAGC\t0.3871\nCGA\t0.3529\nAUA\t0.35\nUGC\t0.3333\nGGC\t0.3158\nCCC\t0.2857\nACG\t0.2609\nGAG\t0.2286\nGCG\t0.2222\nCGC\t0.1765\nUUA\t0\nUAA\t0\nUAG\t0\nUGA\t0" + expected_result = "UUA\t3.6\nGGU\t2.6316\nCCA\t2.4286\nAGA\t2.2941\nUUG\t2.0213\nGCU\t2.0\nUCU\t1.9355\nAUU\t1.9\nGAA\t1.7714\nACU\t1.7391\nUGU\t1.6667\nAAA\t1.5\nAGG\t1.4118\nCAA\t1.3636\nGUU\t1.2881\nAGU\t1.2581\nUUU\t1.2558\nGAU\t1.2432\nCAU\t1.1667\nAAU\t1.0769\nCGU\t1.0588\nACC\t1.0435\nGUG\t1.0169\nAUG\t1.0\nUAU\t1.0\nUAC\t1.0\nUGG\t1.0\nUCC\t0.9677\nUCA\t0.9677\nGCC\t0.963\nACA\t0.9565\nGUC\t0.9492\nAAC\t0.9231\nCCU\t0.8571\nCUA\t0.8511\nCAC\t0.8333\nGCA\t0.8148\nGAC\t0.7568\nAUC\t0.75\nGUA\t0.7458\nCUU\t0.7447\nCUG\t0.7447\nUUC\t0.7442\nCGG\t0.7059\nCUC\t0.6383\nCAG\t0.6364\nGGA\t0.5263\nGGG\t0.5263\nAAG\t0.5\nUCG\t0.4839\nCCG\t0.4286\nAGC\t0.3871\nCGA\t0.3529\nAUA\t0.35\nUGC\t0.3333\nGGC\t0.3158\nCCC\t0.2857\nUAG\t0.2667\nACG\t0.2609\nGAG\t0.2286\nGCG\t0.2222\nCGC\t0.1765\nUAA\t0.1333\nUGA\t0" testargs = [ "biokit", @@ -305,7 +305,7 @@ def test_relative_synonymous_codon_usage_tt25(self, mocked_print): @patch("builtins.print") def test_relative_synonymous_codon_usage_tt26(self, mocked_print): - expected_result = "GGU\t2.6316\nCCA\t2.4286\nAGA\t2.2941\nGCU\t2.2131\nUUA\t2.0149\nUCU\t1.9355\nAUU\t1.9\nGAA\t1.7714\nACU\t1.7391\nUGU\t1.6667\nAAA\t1.5\nUUG\t1.4179\nAGG\t1.4118\nCAA\t1.3636\nGUU\t1.2881\nAGU\t1.2581\nUUU\t1.2558\nGAU\t1.2432\nCAU\t1.1667\nAAU\t1.0769\nGCC\t1.0656\nCGU\t1.0588\nACC\t1.0435\nGUG\t1.0169\nAUG\t1.0\nUAU\t1.0\nUAC\t1.0\nUGG\t1.0\nUCC\t0.9677\nUCA\t0.9677\nACA\t0.9565\nGUC\t0.9492\nAAC\t0.9231\nGCA\t0.9016\nCCU\t0.8571\nCAC\t0.8333\nGAC\t0.7568\nAUC\t0.75\nGUA\t0.7458\nUUC\t0.7442\nCGG\t0.7059\nCAG\t0.6364\nCUA\t0.597\nCUG\t0.5738\nGGA\t0.5263\nGGG\t0.5263\nCUU\t0.5224\nAAG\t0.5\nUCG\t0.4839\nCUC\t0.4478\nCCG\t0.4286\nAGC\t0.3871\nCGA\t0.3529\nAUA\t0.35\nUGC\t0.3333\nGGC\t0.3158\nCCC\t0.2857\nACG\t0.2609\nGCG\t0.2459\nGAG\t0.2286\nCGC\t0.1765\nUAA\t0\nUAG\t0\nUGA\t0" + expected_result = "GGU\t2.6316\nCCA\t2.4286\nAGA\t2.2941\nGCU\t2.2131\nUUA\t2.0149\nUAG\t2.0\nUCU\t1.9355\nAUU\t1.9\nGAA\t1.7714\nACU\t1.7391\nUGU\t1.6667\nAAA\t1.5\nUUG\t1.4179\nAGG\t1.4118\nCAA\t1.3636\nGUU\t1.2881\nAGU\t1.2581\nUUU\t1.2558\nGAU\t1.2432\nCAU\t1.1667\nAAU\t1.0769\nGCC\t1.0656\nCGU\t1.0588\nACC\t1.0435\nGUG\t1.0169\nAUG\t1.0\nUAU\t1.0\nUAC\t1.0\nUAA\t1.0\nUGG\t1.0\nUCC\t0.9677\nUCA\t0.9677\nACA\t0.9565\nGUC\t0.9492\nAAC\t0.9231\nGCA\t0.9016\nCCU\t0.8571\nCAC\t0.8333\nGAC\t0.7568\nAUC\t0.75\nGUA\t0.7458\nUUC\t0.7442\nCGG\t0.7059\nCAG\t0.6364\nCUA\t0.597\nCUG\t0.5738\nGGA\t0.5263\nGGG\t0.5263\nCUU\t0.5224\nAAG\t0.5\nUCG\t0.4839\nCUC\t0.4478\nCCG\t0.4286\nAGC\t0.3871\nCGA\t0.3529\nAUA\t0.35\nUGC\t0.3333\nGGC\t0.3158\nCCC\t0.2857\nACG\t0.2609\nGCG\t0.2459\nGAG\t0.2286\nCGC\t0.1765\nUGA\t0" testargs = [ "biokit", @@ -335,7 +335,7 @@ def test_relative_synonymous_codon_usage_tt27(self, mocked_print): @patch("builtins.print") def test_relative_synonymous_codon_usage_tt28(self, mocked_print): - expected_result = "GGU\t2.6316\nCCA\t2.4286\nAGA\t2.2941\nUUA\t2.1892\nGCU\t2.0\nUCU\t1.9355\nAUU\t1.9\nGAA\t1.7714\nACU\t1.7391\nUGU\t1.6667\nUUG\t1.5405\nAAA\t1.5\nAGG\t1.4118\nCAA\t1.3636\nGUU\t1.2881\nAGU\t1.2581\nUUU\t1.2558\nGAU\t1.2432\nCAU\t1.1667\nAAU\t1.0769\nCGU\t1.0588\nACC\t1.0435\nGUG\t1.0169\nAUG\t1.0\nUAU\t1.0\nUAC\t1.0\nUGG\t1.0\nUCC\t0.9677\nUCA\t0.9677\nGCC\t0.963\nACA\t0.9565\nGUC\t0.9492\nAAC\t0.9231\nCCU\t0.8571\nCAC\t0.8333\nGCA\t0.8148\nGAC\t0.7568\nAUC\t0.75\nGUA\t0.7458\nUUC\t0.7442\nCGG\t0.7059\nCUA\t0.6486\nCAG\t0.6364\nCUU\t0.5676\nCUG\t0.5676\nGGA\t0.5263\nGGG\t0.5263\nAAG\t0.5\nCUC\t0.4865\nUCG\t0.4839\nCCG\t0.4286\nAGC\t0.3871\nCGA\t0.3529\nAUA\t0.35\nUGC\t0.3333\nGGC\t0.3158\nCCC\t0.2857\nACG\t0.2609\nGAG\t0.2286\nGCG\t0.2222\nCGC\t0.1765\nUAA\t0\nUAG\t0\nUGA\t0" + expected_result = "GGU\t2.6316\nCCA\t2.4286\nAGA\t2.2941\nUUA\t2.1892\nGCU\t2.0\nUAG\t2.0\nUCU\t1.9355\nAUU\t1.9\nGAA\t1.7714\nACU\t1.7391\nUGU\t1.6667\nUUG\t1.5405\nAAA\t1.5\nAGG\t1.4118\nCAA\t1.3636\nGUU\t1.2881\nAGU\t1.2581\nUUU\t1.2558\nGAU\t1.2432\nCAU\t1.1667\nAAU\t1.0769\nCGU\t1.0588\nACC\t1.0435\nGUG\t1.0169\nAUG\t1.0\nUAU\t1.0\nUAC\t1.0\nUAA\t1.0\nUGG\t1.0\nUCC\t0.9677\nUCA\t0.9677\nGCC\t0.963\nACA\t0.9565\nGUC\t0.9492\nAAC\t0.9231\nCCU\t0.8571\nCAC\t0.8333\nGCA\t0.8148\nGAC\t0.7568\nAUC\t0.75\nGUA\t0.7458\nUUC\t0.7442\nCGG\t0.7059\nCUA\t0.6486\nCAG\t0.6364\nCUU\t0.5676\nCUG\t0.5676\nGGA\t0.5263\nGGG\t0.5263\nAAG\t0.5\nCUC\t0.4865\nUCG\t0.4839\nCCG\t0.4286\nAGC\t0.3871\nCGA\t0.3529\nAUA\t0.35\nUGC\t0.3333\nGGC\t0.3158\nCCC\t0.2857\nACG\t0.2609\nGAG\t0.2286\nGCG\t0.2222\nCGC\t0.1765\nUGA\t0" testargs = [ "biokit", @@ -410,7 +410,7 @@ def test_relative_synonymous_codon_usage_tt33(self, mocked_print): @patch("builtins.print") def test_relative_synonymous_codon_usage_tt50(self, mocked_print): - expected_result = "GGU\t2.6316\nCCA\t2.4286\nAGA\t2.2941\nGCU\t2.2131\nUUA\t2.0149\nUCU\t1.9355\nAUU\t1.9\nGAA\t1.7714\nACU\t1.7391\nUGU\t1.6667\nAAA\t1.5\nUUG\t1.4179\nAGG\t1.4118\nCAA\t1.3636\nGUU\t1.2881\nAGU\t1.2581\nUUU\t1.2558\nGAU\t1.2432\nCAU\t1.1667\nAAU\t1.0769\nGCC\t1.0656\nCGU\t1.0588\nACC\t1.0435\nGUG\t1.0169\nAUG\t1.0\nUAU\t1.0\nUAC\t1.0\nUGG\t1.0\nUCC\t0.9677\nUCA\t0.9677\nACA\t0.9565\nGUC\t0.9492\nAAC\t0.9231\nGCA\t0.9016\nCCU\t0.8571\nCAC\t0.8333\nGAC\t0.7568\nAUC\t0.75\nGUA\t0.7458\nUUC\t0.7442\nCGG\t0.7059\nCAG\t0.6364\nCUA\t0.597\nCUG\t0.5738\nGGA\t0.5263\nGGG\t0.5263\nCUU\t0.5224\nAAG\t0.5\nUCG\t0.4839\nCUC\t0.4478\nCCG\t0.4286\nAGC\t0.3871\nCGA\t0.3529\nAUA\t0.35\nUGC\t0.3333\nGGC\t0.3158\nCCC\t0.2857\nACG\t0.2609\nGCG\t0.2459\nGAG\t0.2286\nCGC\t0.1765\nUAA\t0\nUAG\t0\nUGA\t0" + expected_result = "GGU\t2.6316\nCCA\t2.4286\nAGA\t2.2941\nGCU\t2.2131\nUUA\t2.0149\nUAG\t2.0\nUCU\t1.9355\nAUU\t1.9\nGAA\t1.7714\nACU\t1.7391\nUGU\t1.6667\nAAA\t1.5\nUUG\t1.4179\nAGG\t1.4118\nCAA\t1.3636\nGUU\t1.2881\nAGU\t1.2581\nUUU\t1.2558\nGAU\t1.2432\nCAU\t1.1667\nAAU\t1.0769\nGCC\t1.0656\nCGU\t1.0588\nACC\t1.0435\nGUG\t1.0169\nAUG\t1.0\nUAU\t1.0\nUAC\t1.0\nUAA\t1.0\nUGG\t1.0\nUCC\t0.9677\nUCA\t0.9677\nACA\t0.9565\nGUC\t0.9492\nAAC\t0.9231\nGCA\t0.9016\nCCU\t0.8571\nCAC\t0.8333\nGAC\t0.7568\nAUC\t0.75\nGUA\t0.7458\nUUC\t0.7442\nCGG\t0.7059\nCAG\t0.6364\nCUA\t0.597\nCUG\t0.5738\nGGA\t0.5263\nGGG\t0.5263\nCUU\t0.5224\nAAG\t0.5\nUCG\t0.4839\nCUC\t0.4478\nCCG\t0.4286\nAGC\t0.3871\nCGA\t0.3529\nAUA\t0.35\nUGC\t0.3333\nGGC\t0.3158\nCCC\t0.2857\nACG\t0.2609\nGCG\t0.2459\nGAG\t0.2286\nCGC\t0.1765\nUGA\t0" testargs = [ "biokit", @@ -425,7 +425,7 @@ def test_relative_synonymous_codon_usage_tt50(self, mocked_print): @patch("builtins.print") def test_relative_synonymous_codon_usage_tt_custom(self, mocked_print): - expected_result = "GGU\t2.6316\nCCA\t2.4286\nAGA\t2.2941\nGCU\t2.2131\nUUA\t2.0149\nUCU\t1.9355\nAUU\t1.9\nGAA\t1.7714\nACU\t1.7391\nUGU\t1.6667\nAAA\t1.5\nUUG\t1.4179\nAGG\t1.4118\nCAA\t1.3636\nGUU\t1.2881\nAGU\t1.2581\nUUU\t1.2558\nGAU\t1.2432\nCAU\t1.1667\nAAU\t1.0769\nGCC\t1.0656\nCGU\t1.0588\nACC\t1.0435\nGUG\t1.0169\nAUG\t1.0\nUAU\t1.0\nUAC\t1.0\nUGG\t1.0\nUCC\t0.9677\nUCA\t0.9677\nACA\t0.9565\nGUC\t0.9492\nAAC\t0.9231\nGCA\t0.9016\nCCU\t0.8571\nCAC\t0.8333\nGAC\t0.7568\nAUC\t0.75\nGUA\t0.7458\nUUC\t0.7442\nCGG\t0.7059\nCAG\t0.6364\nCUA\t0.597\nCUG\t0.5738\nGGA\t0.5263\nGGG\t0.5263\nCUU\t0.5224\nAAG\t0.5\nUCG\t0.4839\nCUC\t0.4478\nCCG\t0.4286\nAGC\t0.3871\nCGA\t0.3529\nAUA\t0.35\nUGC\t0.3333\nGGC\t0.3158\nCCC\t0.2857\nACG\t0.2609\nGCG\t0.2459\nGAG\t0.2286\nCGC\t0.1765\nUAA\t0\nUAG\t0\nUGA\t0" + expected_result = "GGU\t2.6316\nCCA\t2.4286\nAGA\t2.2941\nGCU\t2.2131\nUUA\t2.0149\nUAG\t2.0\nUCU\t1.9355\nAUU\t1.9\nGAA\t1.7714\nACU\t1.7391\nUGU\t1.6667\nAAA\t1.5\nUUG\t1.4179\nAGG\t1.4118\nCAA\t1.3636\nGUU\t1.2881\nAGU\t1.2581\nUUU\t1.2558\nGAU\t1.2432\nCAU\t1.1667\nAAU\t1.0769\nGCC\t1.0656\nCGU\t1.0588\nACC\t1.0435\nGUG\t1.0169\nAUG\t1.0\nUAU\t1.0\nUAC\t1.0\nUAA\t1.0\nUGG\t1.0\nUCC\t0.9677\nUCA\t0.9677\nACA\t0.9565\nGUC\t0.9492\nAAC\t0.9231\nGCA\t0.9016\nCCU\t0.8571\nCAC\t0.8333\nGAC\t0.7568\nAUC\t0.75\nGUA\t0.7458\nUUC\t0.7442\nCGG\t0.7059\nCAG\t0.6364\nCUA\t0.597\nCUG\t0.5738\nGGA\t0.5263\nGGG\t0.5263\nCUU\t0.5224\nAAG\t0.5\nUCG\t0.4839\nCUC\t0.4478\nCCG\t0.4286\nAGC\t0.3871\nCGA\t0.3529\nAUA\t0.35\nUGC\t0.3333\nGGC\t0.3158\nCCC\t0.2857\nACG\t0.2609\nGCG\t0.2459\nGAG\t0.2286\nCGC\t0.1765\nUGA\t0" testargs = [ "biokit", @@ -440,7 +440,7 @@ def test_relative_synonymous_codon_usage_tt_custom(self, mocked_print): @patch("builtins.print") def test_relative_synonymous_codon_usage_tt_custom_alias(self, mocked_print): - expected_result = "GGU\t2.6316\nCCA\t2.4286\nAGA\t2.2941\nGCU\t2.2131\nUUA\t2.0149\nUCU\t1.9355\nAUU\t1.9\nGAA\t1.7714\nACU\t1.7391\nUGU\t1.6667\nAAA\t1.5\nUUG\t1.4179\nAGG\t1.4118\nCAA\t1.3636\nGUU\t1.2881\nAGU\t1.2581\nUUU\t1.2558\nGAU\t1.2432\nCAU\t1.1667\nAAU\t1.0769\nGCC\t1.0656\nCGU\t1.0588\nACC\t1.0435\nGUG\t1.0169\nAUG\t1.0\nUAU\t1.0\nUAC\t1.0\nUGG\t1.0\nUCC\t0.9677\nUCA\t0.9677\nACA\t0.9565\nGUC\t0.9492\nAAC\t0.9231\nGCA\t0.9016\nCCU\t0.8571\nCAC\t0.8333\nGAC\t0.7568\nAUC\t0.75\nGUA\t0.7458\nUUC\t0.7442\nCGG\t0.7059\nCAG\t0.6364\nCUA\t0.597\nCUG\t0.5738\nGGA\t0.5263\nGGG\t0.5263\nCUU\t0.5224\nAAG\t0.5\nUCG\t0.4839\nCUC\t0.4478\nCCG\t0.4286\nAGC\t0.3871\nCGA\t0.3529\nAUA\t0.35\nUGC\t0.3333\nGGC\t0.3158\nCCC\t0.2857\nACG\t0.2609\nGCG\t0.2459\nGAG\t0.2286\nCGC\t0.1765\nUAA\t0\nUAG\t0\nUGA\t0" + expected_result = "GGU\t2.6316\nCCA\t2.4286\nAGA\t2.2941\nGCU\t2.2131\nUUA\t2.0149\nUAG\t2.0\nUCU\t1.9355\nAUU\t1.9\nGAA\t1.7714\nACU\t1.7391\nUGU\t1.6667\nAAA\t1.5\nUUG\t1.4179\nAGG\t1.4118\nCAA\t1.3636\nGUU\t1.2881\nAGU\t1.2581\nUUU\t1.2558\nGAU\t1.2432\nCAU\t1.1667\nAAU\t1.0769\nGCC\t1.0656\nCGU\t1.0588\nACC\t1.0435\nGUG\t1.0169\nAUG\t1.0\nUAU\t1.0\nUAC\t1.0\nUAA\t1.0\nUGG\t1.0\nUCC\t0.9677\nUCA\t0.9677\nACA\t0.9565\nGUC\t0.9492\nAAC\t0.9231\nGCA\t0.9016\nCCU\t0.8571\nCAC\t0.8333\nGAC\t0.7568\nAUC\t0.75\nGUA\t0.7458\nUUC\t0.7442\nCGG\t0.7059\nCAG\t0.6364\nCUA\t0.597\nCUG\t0.5738\nGGA\t0.5263\nGGG\t0.5263\nCUU\t0.5224\nAAG\t0.5\nUCG\t0.4839\nCUC\t0.4478\nCCG\t0.4286\nAGC\t0.3871\nCGA\t0.3529\nAUA\t0.35\nUGC\t0.3333\nGGC\t0.3158\nCCC\t0.2857\nACG\t0.2609\nGCG\t0.2459\nGAG\t0.2286\nCGC\t0.1765\nUGA\t0" testargs = [ "biokit",