From e5c848e715c4b26320f8ccab166b206cc1053d47 Mon Sep 17 00:00:00 2001 From: ArthurDeclercq Date: Fri, 8 Sep 2023 13:29:06 +0200 Subject: [PATCH 1/4] timstof_models --- ms2pip/constants.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/ms2pip/constants.py b/ms2pip/constants.py index 12e222f3..13440c96 100644 --- a/ms2pip/constants.py +++ b/ms2pip/constants.py @@ -143,5 +143,20 @@ "model_20220104_CID_TMT_Y.xgboost": "299539179ca55d4ac82e9aed6a4e0bd134a9a41e", }, }, + "timsTOF": { + "id": 12, + "ion_types": ["B", "Y"], + "peaks_version": "general", + "features_version": "normal", + "xgboost_model_files": { + "b": "phospho_timsTOF_b_maxdepth.xgboost", + "y": "phospho_timsTOF_y_maxdepth.xgboost", + }, + "model_hash": { + "phospho_timsTOF_b_maxdepth.xgboost": "87ee90fbdb2033380fc6f2b543173016404b782b", + "phospho_timsTOF_y_maxdepth.xgboost": "8c1d062ba86415e5cf5bf16a0cc161f11da2d87e", + }, + }, } + MODELS["HCD"] = MODELS["HCD2021"] From 70a3f6d245f954f8eb4d5636b28b0c2567f8fe70 Mon Sep 17 00:00:00 2001 From: ArthurDeclercq Date: Tue, 12 Sep 2023 13:48:39 +0200 Subject: [PATCH 2/4] add ms2pip timsTOF models --- ms2pip/constants.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ms2pip/constants.py b/ms2pip/constants.py index 13440c96..d895f107 100644 --- a/ms2pip/constants.py +++ b/ms2pip/constants.py @@ -149,12 +149,12 @@ "peaks_version": "general", "features_version": "normal", "xgboost_model_files": { - "b": "phospho_timsTOF_b_maxdepth.xgboost", - "y": "phospho_timsTOF_y_maxdepth.xgboost", + "b": "11092023_172748_training_datafeature_vector_b.xgboost", + "y": "12092023_103353_training_datafeature_vector_inverse_y.xgboost", }, "model_hash": { - "phospho_timsTOF_b_maxdepth.xgboost": "87ee90fbdb2033380fc6f2b543173016404b782b", - "phospho_timsTOF_y_maxdepth.xgboost": "8c1d062ba86415e5cf5bf16a0cc161f11da2d87e", + "11092023_172748_training_datafeature_vector_b.xgboost": "6beb557052455310d8c66311c86866dda8291f4b", + "12092023_103353_training_datafeature_vector_inverse_y.xgboost": "8edd87e0fba5f338d0a0881b5afbcf2f48ec5268", }, }, } From 2b4d66a673c3c83a75bf68d4114463afb27763ac Mon Sep 17 00:00:00 2001 From: ArthurDeclercq Date: Tue, 12 Sep 2023 13:48:51 +0200 Subject: [PATCH 3/4] fix training data function --- ms2pip/core.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/ms2pip/core.py b/ms2pip/core.py index e40448fd..32ccab5d 100644 --- a/ms2pip/core.py +++ b/ms2pip/core.py @@ -769,9 +769,18 @@ def _assemble_training_data(results: List[ProcessingResult], model: str) -> pd.D ] ) for ion_type in ion_types: - training_data[f"target_{ion_type}"] = np.concatenate( - [r.observed_intensity[ion_type] for r in results if r.feature_vectors is not None] - ) + if ion_type in ["a", "b", "b2", "c"]: + training_data[f"target_{ion_type}"] = np.concatenate( + [r.observed_intensity[ion_type] for r in results if r.feature_vectors is not None] + ) + elif ion_type in ["x", "y", "y2", "z"]: + training_data[f"target_{ion_type}"] = np.concatenate( + [ + r.observed_intensity[ion_type][::-1] + for r in results + if r.feature_vectors is not None + ] + ) # Reorder columns training_data = training_data[ From 4d48c1c3ec13ec8fe1fd90217a2ead07e3937199 Mon Sep 17 00:00:00 2001 From: ArthurDeclercq Date: Tue, 12 Sep 2023 15:54:07 +0200 Subject: [PATCH 4/4] changed model filenames --- ms2pip/constants.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ms2pip/constants.py b/ms2pip/constants.py index d895f107..2838bc79 100644 --- a/ms2pip/constants.py +++ b/ms2pip/constants.py @@ -149,12 +149,12 @@ "peaks_version": "general", "features_version": "normal", "xgboost_model_files": { - "b": "11092023_172748_training_datafeature_vector_b.xgboost", - "y": "12092023_103353_training_datafeature_vector_inverse_y.xgboost", + "b": "model_20230912_timsTOF_B.xgboost", + "y": "model_20230912_timsTOF_Y.xgboost", }, "model_hash": { - "11092023_172748_training_datafeature_vector_b.xgboost": "6beb557052455310d8c66311c86866dda8291f4b", - "12092023_103353_training_datafeature_vector_inverse_y.xgboost": "8edd87e0fba5f338d0a0881b5afbcf2f48ec5268", + "model_20230912_timsTOF_B.xgboost": "6beb557052455310d8c66311c86866dda8291f4b", + "model_20230912_timsTOF_Y.xgboost": "8edd87e0fba5f338d0a0881b5afbcf2f48ec5268", }, }, }