| 155 | } |
| 156 | |
| 157 | ExitCodes main_(int, const char**) override |
| 158 | { |
| 159 | ExitCodes ret = checkParameters_(); |
| 160 | if (ret != EXECUTION_OK) |
| 161 | { |
| 162 | return ret; |
| 163 | } |
| 164 | //------------------------------------------------------------- |
| 165 | // parsing parameters |
| 166 | //------------------------------------------------------------- |
| 167 | StringList in_files = getStringList_("in"); |
| 168 | StringList out_files = getStringList_("out"); |
| 169 | StringList out_trafos = getStringList_("trafo_out"); |
| 170 | //------------------------------------------------------------- |
| 171 | // reading input |
| 172 | //------------------------------------------------------------- |
| 173 | Size in_files_size = in_files.size(); |
| 174 | FeatureXMLFile fxml_file; |
| 175 | // define here because needed to load and store |
| 176 | FeatureFileOptions param = fxml_file.getOptions(); |
| 177 | // to save memory don't load convex hulls and subordinates |
| 178 | param.setLoadSubordinates(false); |
| 179 | param.setLoadConvexHull(false); |
| 180 | fxml_file.setOptions(param); |
| 181 | |
| 182 | vector<FeatureMap> feature_maps(in_files_size); |
| 183 | loadInputMaps_(feature_maps, in_files, fxml_file); |
| 184 | |
| 185 | //------------------------------------------------------------- |
| 186 | // calculations |
| 187 | //------------------------------------------------------------- |
| 188 | |
| 189 | // constructing tree |
| 190 | vector<vector<double>> maps_ranges(in_files_size); // to save ranges for alignment (larger rt_range -> reference) |
| 191 | std::vector<BinaryTreeNode> tree; // to construct tree with pearson coefficient |
| 192 | MapAlignmentAlgorithmTreeGuided algoTree; |
| 193 | Param algo_params = getParam_().copy("algorithm:", true); |
| 194 | algoTree.setParameters(algo_params); |
| 195 | OpenMS::MapAlignmentAlgorithmTreeGuided::buildTree(feature_maps, tree, maps_ranges); |
| 196 | |
| 197 | // print tree |
| 198 | ClusterAnalyzer ca; |
| 199 | OPENMS_LOG_INFO << " Alignment follows Newick tree: " << ca.newickTree(tree, true) << endl; |
| 200 | |
| 201 | // alignment |
| 202 | vector<Size> trafo_order; |
| 203 | FeatureMap map_transformed; |
| 204 | // depending on the selected parameter, the input data for the alignment are copied or reloaded after alignment |
| 205 | if (getStringOption_("copy_data") == "true") |
| 206 | { |
| 207 | vector<FeatureMap> copied_maps = feature_maps; |
| 208 | algoTree.treeGuidedAlignment(tree, copied_maps, maps_ranges, map_transformed, trafo_order); |
| 209 | } |
| 210 | else |
| 211 | { |
| 212 | algoTree.treeGuidedAlignment(tree, feature_maps, maps_ranges, map_transformed, trafo_order); |
| 213 | // load() of FeatureXMLFile clears featureMap, so we don't have to care |
| 214 | loadInputMaps_(feature_maps, in_files, fxml_file); |
nothing calls this directly
no test coverage detected