35 #ifndef OPENMS_ANALYSIS_ID_ACCURATEMASSSEARCHENGINE_H 36 #define OPENMS_ANALYSIS_ID_ACCURATEMASSSEARCHENGINE_H 56 class EmpiricalFormula;
75 double getNeutralMass(
double observed_mz)
const;
78 double getMZ(
double neutral_mass)
const;
85 int getCharge()
const;
88 const String& getName()
const;
123 double getObservedMZ()
const;
126 void setObservedMZ(
const double&);
129 double getCalculatedMZ()
const;
132 void setCalculatedMZ(
const double&);
135 double getQueryMass()
const;
138 void setQueryMass(
const double&);
141 double getFoundMass()
const;
144 void setFoundMass(
const double&);
147 Int getCharge()
const;
150 void setCharge(
const Int&);
153 double getMZErrorPPM()
const;
156 void setMZErrorPPM(
const double);
159 double getObservedRT()
const;
162 void setObservedRT(
const double& rt);
165 double getObservedIntensity()
const;
168 void setObservedIntensity(
const double&);
171 std::vector<double> getIndividualIntensities()
const;
174 void setIndividualIntensities(
const std::vector<double>&);
176 Size getMatchingIndex()
const;
177 void setMatchingIndex(
const Size&);
179 Size getSourceFeatureIndex()
const;
180 void setSourceFeatureIndex(
const Size&);
182 const String& getFoundAdduct()
const;
183 void setFoundAdduct(
const String&);
185 const String& getFormulaString()
const;
186 void setEmpiricalFormula(
const String&);
188 const std::vector<String>& getMatchingHMDBids()
const;
189 void setMatchingHMDBids(
const std::vector<String>&);
192 const std::vector<double>& getMasstraceIntensities()
const;
193 void setMasstraceIntensities(
const std::vector<double>&);
195 double getIsotopesSimScore()
const;
196 void setIsotopesSimScore(
const double&);
271 void queryByMZ(
const double& observed_mz,
const Int& observed_charge,
const String& ion_mode, std::vector<AccurateMassSearchResult>& results)
const;
272 void queryByFeature(
const Feature& feature,
const Size& feature_index,
const String& ion_mode, std::vector<AccurateMassSearchResult>& results)
const;
273 void queryByConsensusFeature(
const ConsensusFeature& cfeat,
const Size& cf_index,
const Size& number_of_maps,
const String& ion_mode, std::vector<AccurateMassSearchResult>& results)
const;
288 virtual void updateMembers_();
298 String ion_mode_detect_msg =
"";
301 if (map[0].metaValueExists(
"scan_polarity"))
303 StringList pols = ListUtils::create<String>(
String(map[0].getMetaValue(
"scan_polarity")),
';');
304 if (pols.size() == 1 && pols[0].size() > 0)
307 if (pols[0] ==
"positive" || pols[0] ==
"negative")
309 ion_mode_internal = pols[0];
310 LOG_INFO <<
"Setting auto ion-mode to '" << ion_mode_internal <<
"' for file " <<
File::basename(map.getLoadedFilePath()) << std::endl;
312 else ion_mode_detect_msg =
String(
"Meta value 'scan_polarity' does not contain unknown ion mode") +
String(map[0].getMetaValue(
"scan_polarity"));
316 ion_mode_detect_msg =
String(
"ambiguous ion mode: ") +
String(map[0].getMetaValue(
"scan_polarity"));
321 ion_mode_detect_msg =
String(
"Meta value 'scan_polarity' not found in (Consensus-)Feature map");
326 LOG_INFO <<
"Meta value 'scan_polarity' cannot be determined since (Consensus-)Feature map is empty!" << std::endl;
329 if (ion_mode_detect_msg.size() > 0)
331 throw Exception::InvalidParameter(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION,
String(
"Auto ionization mode could not resolve ion mode of data (") + ion_mode_detect_msg +
"!");
334 return ion_mode_internal;
338 void parseStructMappingFile_(
const StringList&);
339 void parseAdductsFile_(
const String& filename, std::vector<AdductInfo>& result);
340 void searchMass_(
double neutral_query_mass,
double diff_mass, std::pair<Size, Size>& hit_indices)
const;
343 void annotate_(
const std::vector<AccurateMassSearchResult>&,
BaseFeature&)
const;
347 double computeCosineSim_(
const std::vector<double>& x,
const std::vector<double>& y)
const;
353 void exportMzTab_(
const QueryResultsTable& overall_results,
const Size number_of_maps,
MzTab& mztab_out)
const;
379 template <
typename T1,
typename T2>
382 return asMass(t1) < asMass(t2);
414 #endif // OPENMS_ANALYSIS_ID_ACCURATEMASSSEARCHENGINE_H String name_
members
Definition: AccurateMassSearchEngine.h:100
String formula
Definition: AccurateMassSearchEngine.h:363
std::vector< AdductInfo > pos_adducts_
Definition: AccurateMassSearchEngine.h:403
String ion_mode_
Definition: AccurateMassSearchEngine.h:394
String mass_error_unit_
Definition: AccurateMassSearchEngine.h:393
bool operator()(T1 const &t1, T2 const &t2) const
Definition: AccurateMassSearchEngine.h:380
Definition: AccurateMassSearchEngine.h:58
double searched_mass_
Definition: AccurateMassSearchEngine.h:205
A more convenient string class.
Definition: String.h:57
bool iso_similarity_
Definition: AccurateMassSearchEngine.h:395
bool keep_unidentified_masses_
Definition: AccurateMassSearchEngine.h:409
Definition: AccurateMassSearchEngine.h:367
#define LOG_INFO
Macro if a information, e.g. a status should be reported.
Definition: LogStream.h:455
int charge_
Definition: AccurateMassSearchEngine.h:103
String empirical_formula_
Definition: AccurateMassSearchEngine.h:216
double db_mass_
Definition: AccurateMassSearchEngine.h:206
std::vector< std::vector< String > > MassIDMapping
private member variables
Definition: AccurateMassSearchEngine.h:356
A container for features.
Definition: FeatureMap.h:94
unsigned int UInt
Unsigned integer type.
Definition: Types.h:95
A container for consensus elements.
Definition: ConsensusMap.h:72
String database_name_
Definition: AccurateMassSearchEngine.h:406
std::vector< double > individual_intensities_
Definition: AccurateMassSearchEngine.h:211
double theoretical_mz_
Definition: AccurateMassSearchEngine.h:204
StringList db_mapping_file_
Definition: AccurateMassSearchEngine.h:400
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
Definition: AccurateMassSearchEngine.h:359
std::vector< String > massIDs
Definition: AccurateMassSearchEngine.h:362
A basic LC-MS feature.
Definition: BaseFeature.h:56
std::vector< String > matching_hmdb_ids_
Definition: AccurateMassSearchEngine.h:217
String found_adduct_
Definition: AccurateMassSearchEngine.h:215
double observed_rt_
Definition: AccurateMassSearchEngine.h:209
UInt mol_multiplier_
Definition: AccurateMassSearchEngine.h:104
Definition: AccurateMassSearchEngine.h:107
HMDBPropsMapping hmdb_properties_mapping_
Definition: AccurateMassSearchEngine.h:387
std::vector< AdductInfo > neg_adducts_
Definition: AccurateMassSearchEngine.h:404
String resolveAutoMode_(const MAPTYPE &map) const
private member functions
Definition: AccurateMassSearchEngine.h:295
double mass
Definition: AccurateMassSearchEngine.h:361
String pos_adducts_fname_
Definition: AccurateMassSearchEngine.h:397
std::map< String, std::vector< String > > HMDBPropsMapping
Definition: AccurateMassSearchEngine.h:357
Int charge_
Definition: AccurateMassSearchEngine.h:207
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:351
double observed_mz_
Stored information/results of DB query.
Definition: AccurateMassSearchEngine.h:203
Exception indicating that an invalid parameter was handed over to an algorithm.
Definition: Exception.h:348
An LC-MS feature.
Definition: Feature.h:70
double mz_error_ppm_
Definition: AccurateMassSearchEngine.h:208
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:74
double asMass(double t) const
Definition: AccurateMassSearchEngine.h:374
StringList db_struct_file_
Definition: AccurateMassSearchEngine.h:401
double isotopes_sim_score_
Definition: AccurateMassSearchEngine.h:220
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:128
EmpiricalFormula ef_
Definition: AccurateMassSearchEngine.h:101
Base class for all classes that want to report their progress.
Definition: ProgressLogger.h:55
double mass_error_value_
parameter stuff
Definition: AccurateMassSearchEngine.h:392
double mass_
Definition: AccurateMassSearchEngine.h:102
A base class for all classes handling default parameters.
Definition: DefaultParamHandler.h:92
Size source_feature_index_
Definition: AccurateMassSearchEngine.h:213
Size matching_index_
Definition: AccurateMassSearchEngine.h:212
String neg_adducts_fname_
Definition: AccurateMassSearchEngine.h:398
double observed_intensity_
Definition: AccurateMassSearchEngine.h:210
int Int
Signed integer type.
Definition: Types.h:103
std::vector< double > mass_trace_intensities_
Definition: AccurateMassSearchEngine.h:219
double asMass(const MappingEntry_ &v) const
Definition: AccurateMassSearchEngine.h:369
bool is_initialized_
Definition: AccurateMassSearchEngine.h:389
std::vector< MappingEntry_ > mass_mappings_
Definition: AccurateMassSearchEngine.h:365
String database_version_
Definition: AccurateMassSearchEngine.h:407
A 2-dimensional consensus feature.
Definition: ConsensusFeature.h:65
Data model of MzTab files. Please see the official MzTab specification at https://code.google.com/p/mztab/.
Definition: MzTab.h:700
An algorithm to search for exact mass matches from a spectrum against a database (e.g. HMDB).
Definition: AccurateMassSearchEngine.h:256