173 rt(
std::numeric_limits<
double>::quiet_NaN()),
174 precursor_rt(
std::numeric_limits<
double>::quiet_NaN()),
175 precursor_mz(
std::numeric_limits<
double>::quiet_NaN()),
176 precursor_charge(0), ms_level(0), scan_number(-1), native_id(
"")
199 template <
typename SpectrumContainer>
201 const String& scan_regexp = default_scan_regexp,
202 bool get_precursor_rt =
false)
207 n_spectra_ = spectra.size();
208 metadata_.reserve(n_spectra_);
209 setScanRegExp_(scan_regexp);
211 std::map<Size, double> precursor_rts;
212 for (
Size i = 0; i < n_spectra_; ++i)
216 getSpectrumMetaData(spectrum, meta, scan_regexp_, precursor_rts);
217 if (get_precursor_rt) precursor_rts[meta.
ms_level] = meta.
rt;
219 metadata_.push_back(meta);
231 this->spectra_data_ref = spectra_data;
241 void getSpectrumMetaData(
Size index, SpectrumMetaData& meta)
const;
253 static void getSpectrumMetaData(
254 const MSSpectrum& spectrum, SpectrumMetaData& meta,
255 const boost::regex& scan_regexp = boost::regex(),
256 const std::map<Size, double>& precursor_rts = (std::map<Size, double>()));
269 void getSpectrumMetaData(
const String& spectrum_ref, SpectrumMetaData& meta,
270 MetaDataFlags flags = MDF_ALL)
const;
283 static bool addMissingRTsToPeptideIDs(std::vector<PeptideIdentification>& peptides,
const String &filename,
284 bool stop_on_error =
false);
299 static bool addMissingSpectrumReferences(std::vector<PeptideIdentification>& peptides,
const String& filename,
300 bool stop_on_error =
false,
bool override_spectra_data =
false, std::vector<ProteinIdentification> proteins = std::vector<ProteinIdentification>());
Helper class for looking up spectra based on different attributes.
Definition: SpectrumLookup.h:67
A more convenient string class.
Definition: String.h:57
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:46
The representation of a 1D spectrum.
Definition: MSSpectrum.h:66
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:127
int Int
Signed integer type.
Definition: Types.h:102