35 #ifndef OPENMS_METADATA_SPECTRUMMETADATALOOKUP_H 36 #define OPENMS_METADATA_SPECTRUMMETADATALOOKUP_H 151 static const MetaDataFlags MDF_RT = 1;
152 static const MetaDataFlags MDF_PRECURSORRT = 2;
153 static const MetaDataFlags MDF_PRECURSORMZ = 4;
154 static const MetaDataFlags MDF_PRECURSORCHARGE = 8;
155 static const MetaDataFlags MDF_MSLEVEL = 16;
156 static const MetaDataFlags MDF_SCANNUMBER = 32;
157 static const MetaDataFlags MDF_NATIVEID = 64;
158 static const MetaDataFlags MDF_ALL = 127;
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(
"")
200 template <
typename SpectrumContainer>
202 const String& scan_regexp = default_scan_regexp,
203 bool get_precursor_rt =
false)
208 n_spectra_ = spectra.size();
209 metadata_.reserve(n_spectra_);
210 setScanRegExp_(scan_regexp);
212 std::map<Size, double> precursor_rts;
213 for (
Size i = 0; i < n_spectra_; ++i)
217 getSpectrumMetaData(spectrum, meta, scan_regexp_, precursor_rts);
218 if (get_precursor_rt) precursor_rts[meta.
ms_level] = meta.
rt;
220 metadata_.push_back(meta);
232 this->spectra_data_ref = spectra_data;
254 static void getSpectrumMetaData(
256 const boost::regex& scan_regexp = boost::regex(),
257 const std::map<Size, double>& precursor_rts = (std::map<Size, double>()));
271 MetaDataFlags flags = MDF_ALL)
const;
284 static bool addMissingRTsToPeptideIDs(std::vector<PeptideIdentification>& peptides,
const String &filename,
285 bool stop_on_error =
false);
300 static bool addMissingSpectrumReferences(std::vector<PeptideIdentification>& peptides,
const String& filename,
301 bool stop_on_error =
false,
bool override_spectra_data =
false, std::vector<ProteinIdentification> proteins = std::vector<ProteinIdentification>());
320 #endif // OPENMS_METADATA_SPECTRUMMETADATALOOKUP_H Helper class for looking up spectra based on different attributes.
Definition: SpectrumLookup.h:68
A more convenient string class.
Definition: String.h:57
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
The representation of a 1D spectrum.
Definition: MSSpectrum.h:67
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:128
int Int
Signed integer type.
Definition: Types.h:103