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

Method main_

src/topp/MapAlignerSpectrum.cpp:100–172  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

98 }
99
100 ExitCodes main_(int, const char**) override
101 {
102 ExitCodes ret = checkParameters_();
103 if (ret != EXECUTION_OK) return ret;
104
105 MapAlignmentAlgorithmSpectrumAlignment algorithm;
106 Param algo_params = getParam_().copy("algorithm:", true);
107 algorithm.setParameters(algo_params);
108 algorithm.setLogType(log_type_);
109
110 StringList ins = getStringList_("in");
111 StringList outs = getStringList_("out");
112 StringList trafos = getStringList_("trafo_out");
113 Param model_params = getParam_().copy("model:", true);
114 String model_type = model_params.getValue("type").toString();
115 model_params = model_params.copy(model_type + ":", true);
116 std::vector<TransformationDescription> transformations;
117
118 //-------------------------------------------------------------
119 // perform peak alignment
120 //-------------------------------------------------------------
121 ProgressLogger progresslogger;
122 progresslogger.setLogType(log_type_);
123
124 // load input
125 std::vector<PeakMap > peak_maps(ins.size());
126 MzMLFile f;
127 f.setLogType(log_type_);
128 progresslogger.startProgress(0, ins.size(), "loading input files");
129 for (Size i = 0; i < ins.size(); ++i)
130 {
131 progresslogger.setProgress(i);
132 f.load(ins[i], peak_maps[i]);
133 }
134 progresslogger.endProgress();
135
136 // try to align
137 algorithm.align(peak_maps, transformations);
138 if (model_type != "none")
139 {
140 for (TransformationDescription& tra : transformations)
141 {
142 tra.fitModel(model_type, model_params);
143 }
144 }
145
146 // write output
147 progresslogger.startProgress(0, outs.size(), "applying RT transformations and writing output files");
148 for (Size i = 0; i < outs.size(); ++i)
149 {
150 progresslogger.setProgress(i);
151
152 MapAlignmentTransformer::transformRetentionTimes(peak_maps[i],
153 transformations[i]);
154 // annotate output with data processing info
155 addDataProcessing_(peak_maps[i],
156 getProcessingInfo_(DataProcessing::ALIGNMENT));
157

Callers

nothing calls this directly

Calls 15

addDataProcessing_Function · 0.85
setParametersMethod · 0.80
setLogTypeMethod · 0.80
fitModelMethod · 0.80
copyMethod · 0.45
toStringMethod · 0.45
getValueMethod · 0.45
sizeMethod · 0.45
startProgressMethod · 0.45
setProgressMethod · 0.45
loadMethod · 0.45
endProgressMethod · 0.45

Tested by

no test coverage detected