174 rt(std::numeric_limits<
double>::quiet_NaN()),
175 precursor_rt(std::numeric_limits<
double>::quiet_NaN()),
176 precursor_mz(std::numeric_limits<
double>::quiet_NaN()),
177 precursor_charge(0), ms_level(0), scan_number(-1), native_id(
"")
212 template <
typename SpectrumContainer>
214 const String& scan_regexp = default_scan_regexp,
215 bool get_precursor_rt =
false)
220 n_spectra_ = spectra.size();
221 metadata_.reserve(n_spectra_);
222 setScanRegExp_(scan_regexp);
224 std::map<Size, double> precursor_rts;
225 for (
Size i = 0; i < n_spectra_; ++i)
229 getSpectrumMetaData(spectrum, meta, scan_regexp_, precursor_rts);
230 if (get_precursor_rt) precursor_rts[meta.
ms_level] = meta.
rt;
232 metadata_.push_back(meta);
244 this->spectra_data_ref = spectra_data;
254 void getSpectrumMetaData(
Size index, SpectrumMetaData& meta)
const;
266 static void getSpectrumMetaData(
267 const MSSpectrum& spectrum, SpectrumMetaData& meta,
268 const boost::regex& scan_regexp = boost::regex(),
269 const std::map<Size, double>& precursor_rts = (std::map<Size, double>()));
282 void getSpectrumMetaData(
const String& spectrum_ref, SpectrumMetaData& meta,
283 MetaDataFlags flags = MDF_ALL)
const;
296 static bool addMissingRTsToPeptideIDs(std::vector<PeptideIdentification>& peptides,
const String &filename,
297 bool stop_on_error =
false);
313 static bool addMissingSpectrumReferences(std::vector<PeptideIdentification>& peptides,
315 bool stop_on_error =
false,
316 bool override_spectra_data =
false,
317 bool override_spectra_references =
false,
318 std::vector<ProteinIdentification> proteins = std::vector<ProteinIdentification>());