MCPcopy Create free account
hub / github.com/OpenMS/OpenMS / add_ionmatches_

Method add_ionmatches_

src/topp/IDFileConverter.cpp:138–183  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

136
137private:
138 bool add_ionmatches_(vector<PeptideIdentification>& peptide_identifications, String filename, double tolerance)
139 {
140 TheoreticalSpectrumGenerator tg;
141 Param tgp(tg.getDefaults());
142 tgp.setValue("add_metainfo", "true");
143 tgp.setValue("add_losses", "true");
144 tgp.setValue("add_precursor_peaks", "true");
145 tgp.setValue("add_abundant_immonium_ions", "true");
146 tgp.setValue("add_first_prefix_ion", "true");
147 tgp.setValue("add_y_ions", "true");
148 tgp.setValue("add_b_ions", "true");
149 tgp.setValue("add_a_ions", "true");
150 tgp.setValue("add_x_ions", "true");
151 tg.setParameters(tgp);
152
153 SpectrumAlignment sa;
154 Param sap = sa.getDefaults();
155 sap.setValue("tolerance", tolerance, "...");
156 sa.setParameters(sap);
157 SpectrumAnnotator annot;
158 bool ret = true;
159 PeakMap expmap;
160 SpectrumLookup lookup;
161 FileHandler().loadExperiment(filename, expmap);
162 lookup.readSpectra(expmap.getSpectra());
163
164#pragma omp parallel for
165 for (SignedSize i = 0; i < (SignedSize)peptide_identifications.size(); ++i)
166 {
167 try
168 {
169 String ref = peptide_identifications[i].getSpectrumReference();
170 Size index = lookup.findByNativeID(ref);
171 annot.addIonMatchStatistics(peptide_identifications[i], expmap[index], tg, sa);
172 }
173 catch (Exception::ElementNotFound&)
174 {
175#pragma omp critical (IDFileConverter_ERROR)
176 {
177 OPENMS_LOG_ERROR << "Error: Failed to look up spectrum - none with corresponding native ID found." << endl;
178 ret = false;
179 }
180 }
181 }
182 return ret;
183 }
184
185protected:
186 Param getSubsectionDefaults_(const String& /*section*/) const override

Callers

nothing calls this directly

Calls 9

getDefaultsMethod · 0.80
setParametersMethod · 0.80
loadExperimentMethod · 0.80
readSpectraMethod · 0.80
getSpectrumReferenceMethod · 0.80
findByNativeIDMethod · 0.80
addIonMatchStatisticsMethod · 0.80
setValueMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected