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

Method main_

src/topp/MaRaClusterAdapter.cpp:259–480  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

257 }
258
259 ExitCodes main_(int, const char**) override
260 {
261 //-------------------------------------------------------------
262 // parsing parameters
263 //-------------------------------------------------------------
264 const StringList in_list = getStringList_("in");
265
266 const String maracluster_executable(getStringOption_("maracluster_executable"));
267 writeDebug_(String("Path to the maracluster executable: ") + maracluster_executable, 2);
268
269 String maracluster_output_directory = getStringOption_("output_directory");
270 const String consensus_out(getStringOption_("consensus_out"));
271 const String out(getStringOption_("out"));
272
273 if (in_list.empty())
274 {
275 writeLogError_("Error: no input file given (parameter 'in')");
276 printUsage_();
277 return ILLEGAL_PARAMETERS;
278 }
279
280 if (consensus_out.empty() && out.empty())
281 {
282 writeLogError_("Error: no output file given (parameter 'out' or 'consensus_out')");
283 printUsage_();
284 return ILLEGAL_PARAMETERS;
285 }
286
287 //-------------------------------------------------------------
288 // read input
289 //-------------------------------------------------------------
290
291 // create temp directory to store maracluster temporary files
292 File::TempDir tmp_dir(debug_level_ >= 2);
293
294 double pcut = getDoubleOption_("pcut");
295
296 String txt_designator = File::getUniqueName();
297 String input_file_list(tmp_dir.getPath() + txt_designator + ".file_list.txt");
298 String consensus_output_file(tmp_dir.getPath() + txt_designator + ".clusters_p" + String(Int(-1*pcut)) + ".tsv");
299
300 // Create simple text file with one file path per line
301 // TODO make a bit more exception safe
302 ofstream os(input_file_list.c_str());
303 map<String,Int> filename_to_file_idx;
304 Int file_idx = 0;
305 for (StringList::const_iterator fit = in_list.begin(); fit != in_list.end(); ++fit, ++file_idx) {
306 filename_to_file_idx[*fit] = file_idx;
307 os << *fit;
308 if (fit + 1 != in_list.end())
309 {
310 os << endl;
311 }
312 }
313 os.close();
314
315 QStringList arguments;
316 // Check all set parameters and get them into arguments StringList

Callers

nothing calls this directly

Calls 15

setSpectrumReferenceMethod · 0.80
backMethod · 0.80
setSearchParametersMethod · 0.80
loadExperimentMethod · 0.80
sortSpectraMethod · 0.80
storeExperimentMethod · 0.80
StringClass · 0.50
emptyMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
closeMethod · 0.45
toQStringMethod · 0.45

Tested by

no test coverage detected