| 237 | } |
| 238 | |
| 239 | ExitCodes main_(int, const char**) override |
| 240 | { |
| 241 | //------------------------------------------------------------- |
| 242 | // general variables and data |
| 243 | //------------------------------------------------------------- |
| 244 | FileHandler fh; |
| 245 | vector<PeptideIdentification> peptide_identifications; |
| 246 | vector<ProteinIdentification> protein_identifications; |
| 247 | SpectrumMetaDataLookup lookup; |
| 248 | IdentificationData id_data; |
| 249 | |
| 250 | //------------------------------------------------------------- |
| 251 | // reading input |
| 252 | //------------------------------------------------------------- |
| 253 | const String in = getStringOption_("in"); |
| 254 | const String mz_file = getStringOption_("mz_file"); |
| 255 | FileTypes::Type in_type = FileTypes::UNKNOWN; // set below if 'in' isn't a directory |
| 256 | |
| 257 | const String out = getStringOption_("out"); |
| 258 | FileTypes::Type out_type = FileHandler::getConsistentOutputfileType(out, getStringOption_("out_type")); |
| 259 | if (out_type == FileTypes::UNKNOWN) |
| 260 | { |
| 261 | writeLogError_("Error: Could not determine output file type!"); |
| 262 | return PARSE_ERROR; |
| 263 | } |
| 264 | |
| 265 | ProgressLogger logger; |
| 266 | logger.setLogType(ProgressLogger::CMD); |
| 267 | logger.startProgress(0, 1, "Loading..."); |
| 268 | |
| 269 | if (File::isDirectory(in)) |
| 270 | { |
| 271 | const String in_directory = File::absolutePath(in).ensureLastChar('/'); |
| 272 | const bool ignore_proteins_per_peptide = getFlag_("ignore_proteins_per_peptide"); |
| 273 | |
| 274 | UInt i = 0; |
| 275 | FileTypes::Type type; |
| 276 | PeakMap msexperiment; |
| 277 | // Note: we had issues with leading zeroes, so let us represent scan numbers as Int (next line used to be map<String, float> num_and_rt;) However, now String::toInt() might throw. |
| 278 | map<Int, float> num_and_rt; |
| 279 | vector<String> NativeID; |
| 280 | |
| 281 | // The mz-File (if given) |
| 282 | if (!mz_file.empty()) |
| 283 | { |
| 284 | type = fh.getTypeByFileName(mz_file); |
| 285 | fh.loadExperiment(mz_file, msexperiment, type, log_type_, false, false); |
| 286 | |
| 287 | for (PeakMap::Iterator spectra_it = msexperiment.begin(); spectra_it != msexperiment.end(); ++spectra_it) |
| 288 | { |
| 289 | String(spectra_it->getNativeID()).split('=', NativeID); |
| 290 | try |
| 291 | { |
| 292 | num_and_rt[NativeID[1].toInt()] = spectra_it->getRT(); |
| 293 | // cout << "num_and_rt: " << NativeID[1] << " = " << NativeID[1].toInt() << " : " << num_and_rt[NativeID[1].toInt()] << endl; // CG debuggging 2009-07-01 |
| 294 | } |
| 295 | catch (Exception::ConversionError& e) |
| 296 | { |
nothing calls this directly
no test coverage detected