-
Notifications
You must be signed in to change notification settings - Fork 25
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
Missing SpectrumBinner #216
Comments
Hi asmirn1 we updated our code quite a bit recently, but we did not have the time yet to update this. We should remove or update this tutorial. |
I'm trying to convert each MS/MS spectrum into a vector. I only need a vector, without calculating similarity scores. I couldn't find it in the examples on the readme file. The closest thing that I could find is in this tutorial Could you tell me how to convert MS/MS spectra into vectors in the new version of the code? |
Ah yes, you are right, that is missing. Below the code to create embedding/vector representations. model = load_model(model_file_name)
ms2ds_model = MS2DeepScore(model)
ms2ds_embeddings = ms2ds_model.get_embedding_array(spectra_cleaned_for_ms2deepscore) I recently gave a workshop with a tutorial for MS2Deepscore for the current version, I will soon clean it up and upload it as well, but didn't find the time yet. |
@niekdejonge Thank you for the example! I've tried from ms2deepscore import MS2DeepScore
from ms2deepscore.models import load_model
model = load_model("ms2deepscore_model.pt")
ms2ds_model = MS2DeepScore(model)
ms2ds_embeddings = ms2ds_model.get_embedding_array(spectra) But I've got a warning: "The model version (0.5.0) does not match the version of MS2Deepscore (2.0.0), consider downloading a new model or changing the MS2Deepscore version" I downloaded the file ms2deepscore_model.pt from Zenodo, but it seems to be too old. Is there a newer model that I can download, or should I switch to an older version of ms2deepscore? |
Hi, we have recently posted a preprint on MS2DeepScore 2.0, see https://www.biorxiv.org/content/10.1101/2024.03.25.586580v2, and the accompanying model can be found here: https://zenodo.org/records/10814307. Given that it was trained on updated and curated data as compared to earlier versions, I would advise to try this one. |
@asmirn1 The issue you have here is that your spectra don't have the ionmode specified. Since MS2Deepscore 2.0 uses the ionmode to make a prediciton the model will not run. If you know the ionmode you could for instance add the ionmode using matchms (or manually adding it to the file) |
Hi, I want to add that since this issue was opened a couple of months ago the tutorial / procedure to train MS2DeepScore 2.0 doesn't seem to have been updated or replaced by a more current one and in addition there are quite confusing code bits instructing to train the first version model (PI mode only) and some wrapper functions for training and it's all quite confusing. So:
Thanks, Nir. |
Do you per chance have a recording or documentation from that workshop? |
Hi,
I'm trying to follow this notebook to learn more about ms2deepscore. However, I'm getting the error
I looked at the source code and couldn't find
SpectrumBinner
. Does the code below looks right to you:Thank you!
The text was updated successfully, but these errors were encountered: