Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timstof models #203

Merged
merged 4 commits into from
Sep 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions ms2pip/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
15 changes: 12 additions & 3 deletions ms2pip/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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[
Expand Down
Loading