From 31f94ac2581d1a100cc41fce52ce172b693d5419 Mon Sep 17 00:00:00 2001 From: Unknown Date: Mon, 28 Jun 2021 13:16:00 +0200 Subject: [PATCH 1/2] Fix SiteAlign definitions for THR (set charge 1 to 0) --- kissim/definitions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kissim/definitions.py b/kissim/definitions.py index 4b917682..9c7253b8 100644 --- a/kissim/definitions.py +++ b/kissim/definitions.py @@ -61,7 +61,7 @@ "PHE": [3.0, 0.0, 0.0, 0.0, 1.0, 0.0], "PRO": [1.0, 0.0, 0.0, 0.0, 0.0, 1.0], "SER": [1.0, 1.0, 1.0, 0.0, 0.0, 0.0], - "THR": [1.0, 1.0, 1.0, 1.0, 0.0, 1.0], + "THR": [1.0, 1.0, 1.0, 0.0, 0.0, 1.0], "TRP": [3.0, 1.0, 0.0, 0.0, 1.0, 0.0], "TYR": [3.0, 1.0, 1.0, 0.0, 1.0, 0.0], "VAL": [1.0, 0.0, 0.0, 0.0, 0.0, 1.0], From 53b4a82556af02aaf474f2dac53d5357ea8a69d1 Mon Sep 17 00:00:00 2001 From: Unknown Date: Mon, 28 Jun 2021 14:16:59 +0200 Subject: [PATCH 2/2] Update unit tests affected by THR charge change --- kissim/tests/encoding/test_fingerprint.py | 4 +++- kissim/tests/encoding/test_fingerprint_generator.py | 12 ++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/kissim/tests/encoding/test_fingerprint.py b/kissim/tests/encoding/test_fingerprint.py index 5057dae0..2ce728a3 100644 --- a/kissim/tests/encoding/test_fingerprint.py +++ b/kissim/tests/encoding/test_fingerprint.py @@ -102,7 +102,7 @@ def test_from_structure_klifs_id(self, structure_klifs_id, fingerprint): @pytest.mark.parametrize( "structure_klifs_id, values_array_mean", - [(109, 4.9905), (12347, 5.1622)], + [(109, 4.9885), (12347, 5.1590)], ) def test_values_array(self, structure_klifs_id, values_array_mean): """ @@ -111,6 +111,8 @@ def test_values_array(self, structure_klifs_id, values_array_mean): fingerprint = Fingerprint.from_structure_klifs_id(structure_klifs_id, LOCAL) values_array_mean_calculated = np.nanmean(fingerprint.values_array(True, True, True)) + print(fingerprint.values_array(True, True, True)[:8]) + print(fingerprint.values_array(True, True, True)[17 * 8 : 18 * 8]) assert pytest.approx(values_array_mean_calculated, abs=1e-4) == values_array_mean # Test the different lengths of the final fingerprint based on the selection of diff --git a/kissim/tests/encoding/test_fingerprint_generator.py b/kissim/tests/encoding/test_fingerprint_generator.py index 6317ed34..36c07828 100644 --- a/kissim/tests/encoding/test_fingerprint_generator.py +++ b/kissim/tests/encoding/test_fingerprint_generator.py @@ -30,11 +30,11 @@ class TestFingerprintGenerator: @pytest.mark.parametrize( "structure_klifs_ids, klifs_session, n_cores, fingerprints_values_array_sum", [ - ([110, 118], REMOTE, 1, 10152.4256), - ([110, 118], REMOTE, 2, 10152.4256), - ([110, 118], LOCAL, 1, 10152.4256), - ([110, 118], LOCAL, 2, 10152.4256), - ([110, 118], None, None, 10152.4256), + ([110, 118], REMOTE, 1, 10148.4256), + ([110, 118], REMOTE, 2, 10148.4256), + ([110, 118], LOCAL, 1, 10148.4256), + ([110, 118], LOCAL, 2, 10148.4256), + ([110, 118], None, None, 10148.4256), ], ) def test_from_structure_klifs_id( @@ -96,7 +96,7 @@ def test_from_structure_klifs_id( @pytest.mark.parametrize( "structure_klifs_ids, normalize, values_array_sum", - [([110, 118], False, 10152.4256), ([110, 118], True, 10152.4256)], + [([110, 118], False, 10148.4256), ([110, 118], True, 10148.4256)], ) def test_to_from_json(self, structure_klifs_ids, normalize, values_array_sum): """