From e024c598f4b2ce6df6f090d2db2a859e6bbbf34a Mon Sep 17 00:00:00 2001 From: Mario Picciani Date: Thu, 9 Nov 2023 18:14:11 +0100 Subject: [PATCH] addede tests for msfragger modstring --- tests/unit_tests/test_mod_string.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tests/unit_tests/test_mod_string.py b/tests/unit_tests/test_mod_string.py index 0f4e3b8..ed36f35 100644 --- a/tests/unit_tests/test_mod_string.py +++ b/tests/unit_tests/test_mod_string.py @@ -52,6 +52,25 @@ def test_maxquant_to_internal_silac(self): ) +class TestMSFraggerToInternal(unittest.TestCase): + """Class to test MSFragger to internal.""" + + def test_msfragger_to_internal_carbamidomethylation(self): + """Test msfragger_to_internal_carbamidomethylation.""" + self.assertEqual(mod.msfragger_to_internal(["ABCDEFGH"]), ["ABC[UNIMOD:4]DEFGH"]) + + def test_msfragger_to_internal_variable_oxidation(self): + """Test msfragger_to_internal_variable_oxidation.""" + self.assertEqual(mod.msfragger_to_internal(["ABCDM[147]EFGH"]), ["ABC[UNIMOD:4]DM[UNIMOD:35]EFGH"]) + + def test_msfragger_to_internal_tmt(self): + """Test msfragger_to_internal_tmt.""" + fixed_mods = {"C": "C[UNIMOD:4]", r"n[\d+]": "[UNIMOD:737]-", "K": "K[UNIMOD:737]"} + self.assertEqual( + mod.msfragger_to_internal(["n[230]ABCDEFGHK"], fixed_mods), ["[UNIMOD:737]-ABC[UNIMOD:4]DEFGHK[UNIMOD:737]"] + ) + + class TestInternalToSpectronaut(unittest.TestCase): """Class to test Internal to Spectronaut."""