| 139 | } |
| 140 | |
| 141 | ExitCodes main_(int, const char **) override |
| 142 | { |
| 143 | //------------------------------------------------------------- |
| 144 | // parameter handling |
| 145 | //------------------------------------------------------------- |
| 146 | in = getStringOption_("in"); |
| 147 | out = getStringOption_("out"); |
| 148 | String process_option = getStringOption_("processOption"); |
| 149 | |
| 150 | Param filter_param = getParam_().copy("algorithm:", true); |
| 151 | writeDebug_("Parameters passed to filter", filter_param, 3); |
| 152 | |
| 153 | GaussFilter gauss; |
| 154 | gauss.setLogType(log_type_); |
| 155 | gauss.setParameters(filter_param); |
| 156 | |
| 157 | if (process_option == "lowmemory") |
| 158 | { |
| 159 | return doLowMemAlgorithm(gauss); |
| 160 | } |
| 161 | |
| 162 | //------------------------------------------------------------- |
| 163 | // loading input |
| 164 | //------------------------------------------------------------- |
| 165 | MzMLFile mz_data_file; |
| 166 | mz_data_file.setLogType(log_type_); |
| 167 | PeakMap exp; |
| 168 | mz_data_file.load(in, exp); |
| 169 | |
| 170 | if (exp.empty() && exp.getChromatograms().empty()) |
| 171 | { |
| 172 | OPENMS_LOG_WARN << "The given file does not contain any conventional peak data, but might" |
| 173 | " contain chromatograms. This tool currently cannot handle them, sorry."; |
| 174 | return INCOMPATIBLE_INPUT_DATA; |
| 175 | } |
| 176 | //check for peak type (profile data required) |
| 177 | if (!exp.empty() && exp[0].getType(true) == SpectrumSettings::CENTROID) |
| 178 | { |
| 179 | writeLogWarn_("Warning: OpenMS peak type estimation indicates that this is not profile data!"); |
| 180 | } |
| 181 | |
| 182 | //check if spectra are sorted |
| 183 | for (Size i = 0; i < exp.size(); ++i) |
| 184 | { |
| 185 | if (!exp[i].isSorted()) |
| 186 | { |
| 187 | writeLogError_("Error: Not all spectra are sorted according to peak m/z positions. Use FileFilter to sort the input!"); |
| 188 | return INCOMPATIBLE_INPUT_DATA; |
| 189 | } |
| 190 | } |
| 191 | |
| 192 | //check if chromatograms are sorted |
| 193 | for (Size i = 0; i < exp.getChromatograms().size(); ++i) |
| 194 | { |
| 195 | if (!exp.getChromatogram(i).isSorted()) |
| 196 | { |
| 197 | writeLogError_("Error: Not all chromatograms are sorted according to peak m/z positions. Use FileFilter to sort the input!"); |
| 198 | return INCOMPATIBLE_INPUT_DATA; |
nothing calls this directly
no test coverage detected