55 class EmpiricalFormula;
74 double getNeutralMass(
double observed_mz)
const;
77 double getMZ(
double neutral_mass)
const;
84 int getCharge()
const;
87 const String& getName()
const;
122 double getObservedMZ()
const;
125 void setObservedMZ(
const double&);
128 double getCalculatedMZ()
const;
131 void setCalculatedMZ(
const double&);
134 double getQueryMass()
const;
137 void setQueryMass(
const double&);
140 double getFoundMass()
const;
143 void setFoundMass(
const double&);
146 Int getCharge()
const;
149 void setCharge(
const Int&);
152 double getMZErrorPPM()
const;
155 void setMZErrorPPM(
const double);
158 double getObservedRT()
const;
161 void setObservedRT(
const double& rt);
164 double getObservedIntensity()
const;
167 void setObservedIntensity(
const double&);
170 std::vector<double> getIndividualIntensities()
const;
173 void setIndividualIntensities(
const std::vector<double>&);
175 Size getMatchingIndex()
const;
176 void setMatchingIndex(
const Size&);
178 Size getSourceFeatureIndex()
const;
179 void setSourceFeatureIndex(
const Size&);
181 const String& getFoundAdduct()
const;
182 void setFoundAdduct(
const String&);
184 const String& getFormulaString()
const;
185 void setEmpiricalFormula(
const String&);
187 const std::vector<String>& getMatchingHMDBids()
const;
188 void setMatchingHMDBids(
const std::vector<String>&);
191 const std::vector<double>& getMasstraceIntensities()
const;
192 void setMasstraceIntensities(
const std::vector<double>&);
194 double getIsotopesSimScore()
const;
195 void setIsotopesSimScore(
const double&);
270 void queryByMZ(
const double& observed_mz,
const Int& observed_charge,
const String& ion_mode, std::vector<AccurateMassSearchResult>& results)
const;
271 void queryByFeature(
const Feature& feature,
const Size& feature_index,
const String& ion_mode, std::vector<AccurateMassSearchResult>& results)
const;
272 void queryByConsensusFeature(
const ConsensusFeature& cfeat,
const Size& cf_index,
const Size& number_of_maps,
const String& ion_mode, std::vector<AccurateMassSearchResult>& results)
const;
287 void updateMembers_()
override;
297 String ion_mode_detect_msg =
"";
300 if (map[0].metaValueExists(
"scan_polarity"))
302 StringList pols = ListUtils::create<String>(
String(map[0].getMetaValue(
"scan_polarity")),
';');
303 if (pols.size() == 1 && pols[0].size() > 0)
306 if (pols[0] ==
"positive" || pols[0] ==
"negative")
308 ion_mode_internal = pols[0];
309 LOG_INFO <<
"Setting auto ion-mode to '" << ion_mode_internal <<
"' for file " <<
File::basename(map.getLoadedFilePath()) << std::endl;
311 else ion_mode_detect_msg =
String(
"Meta value 'scan_polarity' does not contain unknown ion mode") +
String(map[0].getMetaValue(
"scan_polarity"));
315 ion_mode_detect_msg =
String(
"ambiguous ion mode: ") +
String(map[0].getMetaValue(
"scan_polarity"));
320 ion_mode_detect_msg =
String(
"Meta value 'scan_polarity' not found in (Consensus-)Feature map");
325 LOG_INFO <<
"Meta value 'scan_polarity' cannot be determined since (Consensus-)Feature map is empty!" << std::endl;
328 if (ion_mode_detect_msg.size() > 0)
330 throw Exception::InvalidParameter(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION,
String(
"Auto ionization mode could not resolve ion mode of data (") + ion_mode_detect_msg +
"!");
333 return ion_mode_internal;
337 void parseStructMappingFile_(
const StringList&);
338 void parseAdductsFile_(
const String& filename, std::vector<AdductInfo>& result);
339 void searchMass_(
double neutral_query_mass,
double diff_mass, std::pair<Size, Size>& hit_indices)
const;
342 void annotate_(
const std::vector<AccurateMassSearchResult>&,
BaseFeature&)
const;
346 double computeCosineSim_(
const std::vector<double>& x,
const std::vector<double>& y)
const;
378 template <
typename T1,
typename T2>
381 return asMass(t1) < asMass(t2);
String name_
members
Definition: AccurateMassSearchEngine.h:99
String formula
Definition: AccurateMassSearchEngine.h:362
std::vector< AdductInfo > pos_adducts_
Definition: AccurateMassSearchEngine.h:402
String ion_mode_
Definition: AccurateMassSearchEngine.h:393
String mass_error_unit_
Definition: AccurateMassSearchEngine.h:392
bool operator()(T1 const &t1, T2 const &t2) const
Definition: AccurateMassSearchEngine.h:379
Definition: AccurateMassSearchEngine.h:57
double searched_mass_
Definition: AccurateMassSearchEngine.h:204
A more convenient string class.
Definition: String.h:57
bool iso_similarity_
Definition: AccurateMassSearchEngine.h:394
bool keep_unidentified_masses_
Definition: AccurateMassSearchEngine.h:408
Definition: AccurateMassSearchEngine.h:366
#define LOG_INFO
Macro if a information, e.g. a status should be reported.
Definition: LogStream.h:454
int charge_
negative or positive charge; must not be 0
Definition: AccurateMassSearchEngine.h:102
String empirical_formula_
Definition: AccurateMassSearchEngine.h:215
double db_mass_
Definition: AccurateMassSearchEngine.h:205
std::vector< std::vector< String > > MassIDMapping
private member variables
Definition: AccurateMassSearchEngine.h:355
A container for features.
Definition: FeatureMap.h:93
unsigned int UInt
Unsigned integer type.
Definition: Types.h:94
A container for consensus elements.
Definition: ConsensusMap.h:75
String database_name_
Definition: AccurateMassSearchEngine.h:405
std::vector< double > individual_intensities_
Definition: AccurateMassSearchEngine.h:210
double theoretical_mz_
Definition: AccurateMassSearchEngine.h:203
StringList db_mapping_file_
Definition: AccurateMassSearchEngine.h:399
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:46
Definition: AccurateMassSearchEngine.h:358
std::vector< String > massIDs
Definition: AccurateMassSearchEngine.h:361
A basic LC-MS feature.
Definition: BaseFeature.h:55
std::vector< String > matching_hmdb_ids_
Definition: AccurateMassSearchEngine.h:216
String found_adduct_
Definition: AccurateMassSearchEngine.h:214
double observed_rt_
Definition: AccurateMassSearchEngine.h:208
UInt mol_multiplier_
Mol multiplier, e.g. 2 in 2M+H;+1.
Definition: AccurateMassSearchEngine.h:103
Definition: AccurateMassSearchEngine.h:106
HMDBPropsMapping hmdb_properties_mapping_
Definition: AccurateMassSearchEngine.h:386
std::vector< AdductInfo > neg_adducts_
Definition: AccurateMassSearchEngine.h:403
String resolveAutoMode_(const MAPTYPE &map) const
private member functions
Definition: AccurateMassSearchEngine.h:294
double mass
Definition: AccurateMassSearchEngine.h:360
String pos_adducts_fname_
Definition: AccurateMassSearchEngine.h:396
std::map< String, std::vector< String > > HMDBPropsMapping
Definition: AccurateMassSearchEngine.h:356
Int charge_
Definition: AccurateMassSearchEngine.h:206
String & toLower()
Converts the string to lowercase.
std::ostream & operator<<(std::ostream &os, const AccurateMassSearchResult &amsr)
std::vector< std::vector< AccurateMassSearchResult > > QueryResultsTable
Definition: AccurateMassSearchEngine.h:350
double observed_mz_
Stored information/results of DB query.
Definition: AccurateMassSearchEngine.h:202
Exception indicating that an invalid parameter was handed over to an algorithm.
Definition: Exception.h:347
An LC-MS feature.
Definition: Feature.h:70
double mz_error_ppm_
Definition: AccurateMassSearchEngine.h:207
static String basename(const String &file)
Returns the basename of the file (without the path).
std::vector< String > StringList
Vector of String.
Definition: ListUtils.h:73
double asMass(double t) const
Definition: AccurateMassSearchEngine.h:373
StringList db_struct_file_
Definition: AccurateMassSearchEngine.h:400
double isotopes_sim_score_
Definition: AccurateMassSearchEngine.h:219
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:127
EmpiricalFormula ef_
EF for the actual adduct e.g. 'H' in 2M+H;+1.
Definition: AccurateMassSearchEngine.h:100
Base class for all classes that want to report their progress.
Definition: ProgressLogger.h:54
double mass_error_value_
parameter stuff
Definition: AccurateMassSearchEngine.h:391
double mass_
computed from ef_.getMonoWeight(), but stored explicitly for efficiency
Definition: AccurateMassSearchEngine.h:101
A base class for all classes handling default parameters.
Definition: DefaultParamHandler.h:91
Size source_feature_index_
Definition: AccurateMassSearchEngine.h:212
Size matching_index_
Definition: AccurateMassSearchEngine.h:211
String neg_adducts_fname_
Definition: AccurateMassSearchEngine.h:397
double observed_intensity_
Definition: AccurateMassSearchEngine.h:209
int Int
Signed integer type.
Definition: Types.h:102
std::vector< double > mass_trace_intensities_
Definition: AccurateMassSearchEngine.h:218
double asMass(const MappingEntry_ &v) const
Definition: AccurateMassSearchEngine.h:368
bool is_initialized_
true if init_() was called without any subsequent param changes
Definition: AccurateMassSearchEngine.h:388
std::vector< MappingEntry_ > mass_mappings_
Definition: AccurateMassSearchEngine.h:364
String database_version_
Definition: AccurateMassSearchEngine.h:406
A consensus feature spanning multiple LC-MS/MS experiments.
Definition: ConsensusFeature.h:69
Data model of MzTab files. Please see the official MzTab specification at https://code.google.com/p/mztab/.
Definition: MzTab.h:699
An algorithm to search for exact mass matches from a spectrum against a database (e.g. HMDB).
Definition: AccurateMassSearchEngine.h:255