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

Method main_

src/topp/PeakPickerHiRes.cpp:186–258  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

184 }
185
186 ExitCodes main_(int, const char **) override
187 {
188 //-------------------------------------------------------------
189 // parameter handling
190 //-------------------------------------------------------------
191
192 in = getStringOption_("in");
193 out = getStringOption_("out");
194 String process_option = getStringOption_("processOption");
195
196 Param pepi_param = getParam_().copy("algorithm:", true);
197 writeDebug_("Parameters passed to PeakPickerHiRes", pepi_param, 3);
198
199 PeakPickerHiRes pp;
200 pp.setLogType(log_type_);
201 pp.setParameters(pepi_param);
202
203 if (process_option == "lowmemory")
204 {
205 return doLowMemAlgorithm(pp);
206 }
207
208 //-------------------------------------------------------------
209 // loading input
210 //-------------------------------------------------------------
211 MzMLFile mz_data_file;
212 mz_data_file.setLogType(log_type_);
213 PeakMap ms_exp_raw;
214 mz_data_file.load(in, ms_exp_raw);
215
216 if (ms_exp_raw.empty() && ms_exp_raw.getChromatograms().empty())
217 {
218 OPENMS_LOG_WARN << "The given file does not contain any conventional peak data, but might"
219 " contain chromatograms. This tool currently cannot handle them, sorry.";
220 return INCOMPATIBLE_INPUT_DATA;
221 }
222
223 //check if spectra are sorted
224 for (Size i = 0; i < ms_exp_raw.size(); ++i)
225 {
226 if (!ms_exp_raw[i].isSorted())
227 {
228 writeLogError_("Error: Not all spectra are sorted according to peak m/z positions. Use FileFilter to sort the input!");
229 return INCOMPATIBLE_INPUT_DATA;
230 }
231 }
232
233 //check if chromatograms are sorted
234 for (Size i = 0; i < ms_exp_raw.getChromatograms().size(); ++i)
235 {
236 if (!ms_exp_raw.getChromatogram(i).isSorted())
237 {
238 writeLogError_("Error: Not all chromatograms are sorted according to peak m/z positions. Use FileFilter to sort the input!");
239 return INCOMPATIBLE_INPUT_DATA;
240 }
241 }
242
243 //-------------------------------------------------------------

Callers

nothing calls this directly

Calls 12

addDataProcessing_Function · 0.85
setLogTypeMethod · 0.80
setParametersMethod · 0.80
getChromatogramsMethod · 0.80
getChromatogramMethod · 0.80
copyMethod · 0.45
loadMethod · 0.45
emptyMethod · 0.45
sizeMethod · 0.45
isSortedMethod · 0.45
pickExperimentMethod · 0.45
storeMethod · 0.45

Tested by

no test coverage detected