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

Method main_

src/topp/OpenSwathRTNormalizer.cpp:140–298  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

138 }
139
140 ExitCodes main_(int, const char **) override
141 {
142
143 ///////////////////////////////////
144 // Read input files and parameters
145 ///////////////////////////////////
146 StringList file_list = getStringList_("in");
147 String tr_file_str = getStringOption_("tr");
148 String out = getStringOption_("out");
149 double min_rsq = getDoubleOption_("min_rsq");
150 double min_coverage = getDoubleOption_("min_coverage");
151 bool estimateBestPeptides = getFlag_("estimateBestPeptides");
152 const char * tr_file = tr_file_str.c_str();
153
154 MapType all_xic_maps; // all XICs from all files
155 OpenSwath::LightTargetedExperiment targeted_exp;
156
157 std::cout << "Loading TraML file" << std::endl;
158 {
159 TargetedExperiment transition_exp_;
160 TraMLFile().load(tr_file, transition_exp_);
161 OpenSwathDataAccessHelper::convertTargetedExp(transition_exp_, targeted_exp);
162 }
163
164 Param pepEstimationParams = getParam_().copy("peptideEstimation:", true);
165 Param RTNormParams = getParam_().copy("RTNormalization:", true);
166 String outlier_method = RTNormParams.getValue("outlierMethod").toString();
167
168 // 1. Estimate the retention time range of the whole experiment
169 std::pair<double,double> RTRange = OpenSwathHelper::estimateRTRange(targeted_exp);
170 std::cout << "Detected retention time range from " << RTRange.first << " to " << RTRange.second << std::endl;
171
172 // 2. Store the peptide retention times in an intermediate map
173 std::map<std::string, double> PeptideRTMap;
174 for (Size i = 0; i < targeted_exp.getCompounds().size(); i++)
175 {
176 PeptideRTMap[targeted_exp.getCompounds()[i].id] = targeted_exp.getCompounds()[i].rt;
177 }
178
179 MzMLFile f;
180 f.setLogType(log_type_);
181 TransformationXMLFile trafoxml;
182 TransformationDescription trafo;
183
184 // If we have a transformation file, trafo will transform the RT in the
185 // scoring according to the model. If we don't have one, it will apply the
186 // null transformation.
187 if (!getStringOption_("rt_norm").empty())
188 {
189 String trafo_in = getStringOption_("rt_norm");
190 String model_type = "linear"; //getStringOption_("model:type");
191 trafoxml.load(trafo_in, trafo);
192 }
193
194 ///////////////////////////////////
195 // Start computation
196 ///////////////////////////////////
197

Callers

nothing calls this directly

Calls 15

setLogTypeMethod · 0.80
setParametersMethod · 0.80
getChromatogramsMethod · 0.80
setDataPointsMethod · 0.80
fitModelMethod · 0.80
StringClass · 0.50
loadMethod · 0.45
copyMethod · 0.45
toStringMethod · 0.45
getValueMethod · 0.45
sizeMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected