Skip to content

Commit

Permalink
Merge pull request #74 from volkamerlab/fix-sitealign-bug
Browse files Browse the repository at this point in the history
Fix SiteAlign definitions for THR (set charge 1 to 0)
  • Loading branch information
dominiquesydow authored Jun 29, 2021
2 parents 73ed8cf + 53b4a82 commit 95f61ae
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion kissim/definitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down
4 changes: 3 additions & 1 deletion kissim/tests/encoding/test_fingerprint.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
"""
Expand All @@ -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
Expand Down
12 changes: 6 additions & 6 deletions kissim/tests/encoding/test_fingerprint_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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):
"""
Expand Down

0 comments on commit 95f61ae

Please sign in to comment.