You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.rst
+25-30Lines changed: 25 additions & 30 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -88,7 +88,7 @@ For more extensive documentation `see our readthedocs <https://spec2vec.readthed
88
88
89
89
Versions
90
90
========
91
-
Since version `0.5.0` Spec2Vec uses `gensim >= 4.0.0` which should make it faster and more future proof. Model trained with older versions should still be importable without any issues. If you had scripts that used additional gensim code, however, those might occationally need some adaptation, see also the `gensim documentation on how to migrate your code <https://github.com/RaRe-Technologies/gensim/wiki/Migrating-from-Gensim-3.x-to-4>`_.
91
+
Since version `0.9.0` Spec2Vec uses `gensim >= 4.4.0` which should make it faster and more future proof. Model trained with older versions should still be importable without any issues. If you had scripts that used additional gensim code, however, those might occationally need some adaptation, see also the `gensim documentation on how to migrate your code <https://github.com/RaRe-Technologies/gensim/wiki/Migrating-from-Gensim-3.x-to-4>`_.
92
92
93
93
94
94
Installation
@@ -97,14 +97,14 @@ Installation
97
97
98
98
Prerequisites:
99
99
100
-
- Python 3.7, 3.8, or 3.9
100
+
- Python 3.10, 3.11, 3.12 or 3.13
101
101
- Recommended: Anaconda
102
102
103
103
We recommend installing spec2vec from Anaconda Cloud with
spectra_cleaned = [s for s in spectra_cleaned if s isnotNone]
149
142
150
143
# Create spectrum documents
151
-
reference_documents = [SpectrumDocument(s, n_decimals=2, loss_mz_from=10.0, loss_mz_to=200.0) for s inspectrums]
144
+
reference_documents = [SpectrumDocument(s, n_decimals=2) for s inspectra_cleaned]
152
145
146
+
# Train your reference model
153
147
model_file ="references.model"
154
148
model = train_new_word2vec_model(reference_documents, iterations=[10, 20, 30], filename=model_file,
155
149
workers=2, progress_logger=True)
156
150
157
151
Once a word2vec model has been trained, spec2vec allows to calculate the similarities
158
-
between mass spectrums based on this model. In cases where the word2vec model was
152
+
between mass spectra based on this model. In cases where the word2vec model was
159
153
trained on data different than the data it is applied for, a number of peaks ("words")
160
154
might be unknown to the model (if they weren't part of the training dataset). To
161
155
account for those cases it is important to specify the ``allowed_missing_percentage``,
@@ -167,11 +161,12 @@ as in the example below.
167
161
from matchms import calculate_scores
168
162
from spec2vec import Spec2Vec
169
163
170
-
# query_spectrums loaded from files using https://matchms.readthedocs.io/en/latest/api/matchms.importing.load_from_mgf.html
171
-
query_spectrums = [spectrum_processing(s) for s in load_from_mgf("query_spectrums.mgf")]
164
+
# query_spectra loaded from files using https://matchms.readthedocs.io/en/latest/api/matchms.importing.load_from_mgf.html
0 commit comments