diff --git a/ms2pip/constants.py b/ms2pip/constants.py index 12e222f..2838bc7 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": "model_20230912_timsTOF_B.xgboost", + "y": "model_20230912_timsTOF_Y.xgboost", + }, + "model_hash": { + "model_20230912_timsTOF_B.xgboost": "6beb557052455310d8c66311c86866dda8291f4b", + "model_20230912_timsTOF_Y.xgboost": "8edd87e0fba5f338d0a0881b5afbcf2f48ec5268", + }, + }, } + MODELS["HCD"] = MODELS["HCD2021"] diff --git a/ms2pip/core.py b/ms2pip/core.py index e40448f..32ccab5 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[