35 #ifndef OPENMS_FORMAT_HANDLERS_MZXMLHANDLER_H 36 #define OPENMS_FORMAT_HANDLERS_MZXMLHANDLER_H 50 class MetaInfoInterface;
61 template <
typename MapType>
105 virtual void endElement(
const XMLCh*
const uri,
const XMLCh*
const local_name,
const XMLCh*
const qname);
108 virtual void startElement(
const XMLCh*
const uri,
const XMLCh*
const local_name,
const XMLCh*
const qname,
const xercesc::Attributes& attributes);
111 virtual void characters(
const XMLCh*
const chars,
const XMLSize_t length);
114 void writeTo(std::ostream& os);
147 String(
";Quadrupole;Quadrupole Ion Trap;;;TOF;Magnetic Sector;FT-ICR;").
split(
';',
cv_terms_[3]);
231 std::vector<String> keys;
234 for (std::vector<String>::const_iterator it = keys.begin(); it != keys.end(); ++it)
269 std::vector<double> data;
289 spectrum_data.
spectrum.push_back(peak);
295 std::vector<float> data;
314 spectrum_data.
spectrum.push_back(peak);
334 #pragma omp parallel for 346 spectrum_data_[i].spectrum.sortByPosition();
351 #pragma omp critical(HandleException) 363 for (
Size i = 0; i < spectrum_data_.size(); i++)
365 if (consumer_ != NULL)
370 exp_->addSpectrum(spectrum_data_[i].spectrum);
375 exp_->addSpectrum(spectrum_data_[i].
spectrum);
380 spectrum_data_.clear();
425 static bool init(
false);
428 s_value_ = xercesc::XMLString::transcode(
"value");
429 s_count_ = xercesc::XMLString::transcode(
"scanCount");
430 s_type_ = xercesc::XMLString::transcode(
"type");
431 s_name_ = xercesc::XMLString::transcode(
"name");
432 s_version_ = xercesc::XMLString::transcode(
"version");
433 s_filename_ = xercesc::XMLString::transcode(
"fileName");
434 s_filetype_ = xercesc::XMLString::transcode(
"fileType");
435 s_filesha1_ = xercesc::XMLString::transcode(
"fileSha1");
436 s_completiontime_ = xercesc::XMLString::transcode(
"completionTime");
437 s_precision_ = xercesc::XMLString::transcode(
"precision");
438 s_byteorder_ = xercesc::XMLString::transcode(
"byteOrder");
439 s_pairorder_ = xercesc::XMLString::transcode(
"pairOrder");
440 s_compressionType_ = xercesc::XMLString::transcode(
"compressionType");
441 s_precursorintensity_ = xercesc::XMLString::transcode(
"precursorIntensity");
442 s_precursorcharge_ = xercesc::XMLString::transcode(
"precursorCharge");
443 s_windowwideness_ = xercesc::XMLString::transcode(
"windowWideness");
444 s_mslevel_ = xercesc::XMLString::transcode(
"msLevel");
445 s_peakscount_ = xercesc::XMLString::transcode(
"peaksCount");
446 s_polarity_ = xercesc::XMLString::transcode(
"polarity");
447 s_scantype_ = xercesc::XMLString::transcode(
"scanType");
448 s_filterline_ = xercesc::XMLString::transcode(
"filterLine");
449 s_retentiontime_ = xercesc::XMLString::transcode(
"retentionTime");
450 s_startmz_ = xercesc::XMLString::transcode(
"startMz");
451 s_endmz_ = xercesc::XMLString::transcode(
"endMz");
452 s_first_ = xercesc::XMLString::transcode(
"first");
453 s_last_ = xercesc::XMLString::transcode(
"last");
454 s_phone_ = xercesc::XMLString::transcode(
"phone");
455 s_email_ = xercesc::XMLString::transcode(
"email");
456 s_uri_ = xercesc::XMLString::transcode(
"URI");
457 s_num_ = xercesc::XMLString::transcode(
"num");
458 s_intensitycutoff_ = xercesc::XMLString::transcode(
"intensityCutoff");
459 s_centroided_ = xercesc::XMLString::transcode(
"centroided");
460 s_deisotoped_ = xercesc::XMLString::transcode(
"deisotoped");
461 s_chargedeconvoluted_ = xercesc::XMLString::transcode(
"chargeDeconvoluted");
473 template <
typename MapType>
475 template <
typename MapType>
477 template <
typename MapType>
479 template <
typename MapType>
481 template <
typename MapType>
483 template <
typename MapType>
485 template <
typename MapType>
487 template <
typename MapType>
489 template <
typename MapType>
491 template <
typename MapType>
493 template <
typename MapType>
495 template <
typename MapType>
497 template <
typename MapType>
499 template <
typename MapType>
501 template <
typename MapType>
503 template <
typename MapType>
505 template <
typename MapType>
507 template <
typename MapType>
509 template <
typename MapType>
511 template <
typename MapType>
513 template <
typename MapType>
515 template <
typename MapType>
517 template <
typename MapType>
519 template <
typename MapType>
521 template <
typename MapType>
523 template <
typename MapType>
525 template <
typename MapType>
527 template <
typename MapType>
529 template <
typename MapType>
531 template <
typename MapType>
533 template <
typename MapType>
535 template <
typename MapType>
537 template <
typename MapType>
539 template <
typename MapType>
542 template <
typename MapType>
544 const XMLCh*
const ,
const XMLCh*
const qname,
545 const xercesc::Attributes& attributes)
549 static bool init_static_members(
false);
550 if (!init_static_members)
567 exp_->reserve(count);
573 else if (tag ==
"parentFile")
579 exp_->getSourceFiles().push_back(sf);
581 else if (tag ==
"software")
584 if (parent_tag ==
"dataProcessing")
594 else if (parent_tag ==
"msInstrument")
600 else if (tag ==
"peaks")
610 String byte_order =
"network";
612 if (byte_order !=
"network")
614 error(
LOAD,
String(
"Invalid or missing byte order '") + byte_order +
"' in element 'peaks'. Must be 'network'!");
617 String pair_order =
"m/z-int";
619 if (pair_order !=
"m/z-int")
621 error(
LOAD,
String(
"Invalid or missing pair order '") + pair_order +
"' in element 'peaks'. Must be 'm/z-int'!");
628 error(
LOAD,
String(
"Invalid compression type ") +
spectrum_data_.back().compressionType_ +
"in elements 'peaks'. Must be 'none' or 'zlib'! ");
631 else if (tag ==
"precursorMz")
642 error(
LOAD,
"Mandatory attribute 'precursorIntensity' of tag 'precursorMz' not found! Setting precursor intensity to zero!");
648 spectrum_data_.back().spectrum.getPrecursors().back().setCharge(charge);
654 spectrum_data_.back().spectrum.getPrecursors().back().setIsolationWindowLowerOffset(window);
657 else if (tag ==
"scan")
669 warning(
LOAD,
String(
"Invalid 'msLevel' attribute with value '0' in 'scan' element found. Assuming ms level 1!"));
674 double retention_time = 0.0;
678 time_string = time_string.
suffix(
'T');
680 if (time_string.
has(
'H'))
683 time_string = time_string.
suffix(
'H');
686 if (time_string.
has(
'M'))
689 time_string = time_string.
suffix(
'M');
692 if (time_string.
has(
'S'))
695 time_string = time_string.
suffix(
'S');
730 if (window.
begin != 0.0 || window.
end != 0.0)
732 spectrum_data_.back().spectrum.getInstrumentSettings().getScanWindows().push_back(window);
742 if (!filterLine.empty())
744 spectrum_data_.back().spectrum.setMetaValue(
"filter string", filterLine);
753 else if (type ==
"zoom")
755 spectrum_data_.back().spectrum.getInstrumentSettings().setZoomScan(
true);
758 else if (type ==
"Full")
765 else if (type ==
"SIM")
769 else if (type ==
"SRM" || type ==
"MRM")
773 else if (type ==
"CRM")
777 else if (type ==
"Q1")
781 else if (type ==
"Q3")
785 else if (type ==
"EMS")
789 else if (type ==
"EPI")
794 else if (type ==
"ER")
796 spectrum_data_.back().spectrum.getInstrumentSettings().setZoomScan(
true);
807 else if (tag ==
"operator")
809 exp_->getContacts().resize(1);
815 exp_->getContacts().back().setEmail(tmp);
821 exp_->getContacts().back().setMetaValue(
"#phone", tmp);
826 exp_->getContacts().back().setURL(tmp);
828 else if (tag ==
"msManufacturer")
832 else if (tag ==
"msModel")
836 else if (tag ==
"msIonisation")
838 exp_->getInstrument().getIonSources().resize(1);
841 else if (tag ==
"msMassAnalyzer")
843 exp_->getInstrument().getMassAnalyzers().resize(1);
846 else if (tag ==
"msDetector")
848 exp_->getInstrument().getIonDetectors().resize(1);
851 else if (tag ==
"msResolution")
855 else if (tag ==
"dataProcessing")
861 if (
boolean ==
"true" ||
boolean ==
"1")
868 if (
boolean ==
"true" ||
boolean ==
"1")
882 if (
boolean ==
"true" ||
boolean ==
"1")
887 else if (tag ==
"nameValue")
899 if (parent_tag ==
"msInstrument")
901 exp_->getInstrument().setMetaValue(name, value);
903 else if (parent_tag ==
"scan")
909 std::cout <<
" Warning: Unexpected tag 'nameValue' in tag '" << parent_tag <<
"'" <<
"\n";
912 else if (tag ==
"processingOperation")
928 template <
typename MapType>
935 static const XMLCh* s_mzxml = xercesc::XMLString::transcode(
"mzXML");
936 static const XMLCh* s_scan = xercesc::XMLString::transcode(
"scan");
940 if (
equal_(qname, s_mzxml))
948 else if (
equal_(qname, s_scan))
964 template <
typename MapType>
987 double mz_pos =
asDouble_(transcoded_chars);
989 spectrum_data_.back().spectrum.getPrecursors().back().setMZ(mz_pos);
991 double window_width =
spectrum_data_.back().spectrum.getPrecursors().back().getIsolationWindowLowerOffset();
992 if (window_width != 0.0)
994 spectrum_data_.back().spectrum.getPrecursors().back().setIsolationWindowLowerOffset(0.5 * window_width);
995 spectrum_data_.back().spectrum.getPrecursors().back().setIsolationWindowUpperOffset(0.5 * window_width);
1004 if (parent_tag ==
"msInstrument")
1006 exp_->getInstrument().setMetaValue(
"#comment",
String(transcoded_chars));
1008 else if (parent_tag ==
"dataProcessing")
1012 else if (parent_tag ==
"scan")
1016 else if (
String(transcoded_chars).trim() !=
"")
1024 if (
String(transcoded_chars).trim() !=
"")
1031 template <
typename MapType>
1035 UInt count_tmp_ = 0;
1036 for (
Size s = 0; s <
cexp_->size(); s++)
1039 if (spec.size() != 0)
1042 if (count_tmp_ == 0)
1045 os <<
"<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n" 1046 <<
"<mzXML xmlns=\"http://sashimi.sourceforge.net/schema_revision/mzXML_2.1\" " 1047 <<
"xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" " 1048 <<
"xsi:schemaLocation=\"http://sashimi.sourceforge.net/schema_revision/mzXML_2.1 " 1049 <<
"http://sashimi.sourceforge.net/schema_revision/mzXML_2.1/mzXML_idx_2.1.xsd\">\n" 1050 <<
"\t<msRun scanCount=\"" << count_tmp_ <<
"\">\n";
1055 if (
cexp_->getSourceFiles().empty())
1057 os <<
"\t\t<parentFile fileName=\"\" fileType=\"processedData\" fileSha1=\"0000000000000000000000000000000000000000\"/>\n";
1061 for (
Size i = 0; i <
cexp_->getSourceFiles().size(); ++i)
1064 os <<
"\t\t<parentFile fileName=\"" << sf.
getNameOfFile() <<
"\" fileType=\"";
1074 os <<
"processedData";
1077 os <<
"\" fileSha1=\"";
1081 os <<
"0000000000000000000000000000000000000000";
1097 os <<
"\t\t<msInstrument>\n" 1098 <<
"\t\t\t<msManufacturer category=\"msManufacturer\" value=\"" << inst.
getVendor() <<
"\"/>\n" <<
"\t\t\t<msModel category=\"msModel\" value=\"" << inst.
getModel() <<
"\"/>\n";
1101 os <<
"\t\t\t<msIonisation category=\"msIonisation\" value=\"\"/>\n";
1105 os <<
"\t\t\t<msIonisation category=\"msIonisation\" value=\"" <<
cv_terms_[2][inst.
getIonSources()[0].getIonizationMethod()] <<
"\"/>\n";
1108 if (analyzers.empty() || !analyzers[0].getResolutionMethod())
1110 os <<
"\t\t\t<msMassAnalyzer category=\"msMassAnalyzer\" value=\"\"/>\n";
1114 os <<
"\t\t\t<msMassAnalyzer category=\"msMassAnalyzer\" value=\"" <<
cv_terms_[3][analyzers[0].getType()] <<
"\"/>\n";
1118 os <<
"\t\t\t<msDetector category=\"msDetector\" value=\"\"/>\n";
1122 os <<
"\t\t\t<msDetector category=\"msDetector\" value=\"" <<
cv_terms_[4][inst.
getIonDetectors()[0].getType()] <<
"\"/>\n";
1125 if (analyzers.empty() || !analyzers[0].getResolutionMethod())
1127 os <<
"\t\t\t<msResolution category=\"msResolution\" value=\"\"/>\n";
1131 os <<
"\t\t\t<msResolution category=\"msResolution\" value=\"" <<
cv_terms_[5][analyzers[0].getResolutionMethod()] <<
"\"/>\n";
1134 if (
cexp_->getContacts().size() > 0)
1142 os <<
" email=\"" << cont.
getEmail() <<
"\"";
1147 os <<
" URI=\"" << cont.
getURL() <<
"\"";
1164 os <<
"\t\t</msInstrument>\n";
1170 if (
cexp_->size() == 0 || (*cexp_)[0].getDataProcessing().empty())
1172 os <<
"\t\t<dataProcessing>\n" 1173 <<
"\t\t\t<software type=\"processing\" name=\"\" version=\"\"/>\n" 1174 <<
"\t\t</dataProcessing>\n";
1178 for (
Size i = 0; i < (*cexp_)[0].getDataProcessing().size(); ++i)
1180 const DataProcessing& data_processing = (*cexp_)[0].getDataProcessing()[i];
1181 os <<
"\t\t<dataProcessing deisotoped=\"" 1183 <<
"\" chargeDeconvoluted=\"" 1185 <<
"\" centroided=\"" 1193 <<
"\t\t\t<software type=\"";
1208 os <<
"\" completionTime=\"" << data_processing.
getCompletionTime().
get().substitute(
' ',
'T');
1213 os <<
"\t\t</dataProcessing>\n";
1219 bool all_numbers =
true;
1220 bool all_empty =
true;
1221 bool all_prefixed_numbers =
true;
1222 for (
Size s = 0; s <
cexp_->size(); s++)
1224 String native_id = (*cexp_)[s].getNativeID();
1227 all_prefixed_numbers =
false;
1231 native_id = native_id.
substr(5);
1239 all_numbers =
false;
1240 all_prefixed_numbers =
false;
1241 if (native_id !=
"")
1248 if (!all_numbers && !all_empty)
1250 warning(
STORE,
"Not all spectrum native IDs are numbers or correctly prefixed with 'scan='. The spectra are renumbered and the native IDs are lost!");
1254 std::stack<UInt> open_scans;
1255 for (
Size s = 0; s <
cexp_->size(); s++)
1261 open_scans.push(ms_level);
1263 Size spectrum_id = s + 1;
1264 if (all_prefixed_numbers)
1268 else if (all_numbers)
1273 os <<
String(ms_level + 1,
'\t')
1274 <<
"<scan num=\"" << spectrum_id <<
"\" msLevel=\"" 1275 << ms_level <<
"\" peaksCount=\"" 1276 << spec.size() <<
"\" polarity=\"";
1301 os <<
"\" scanType=\"zoom";
1305 os <<
"\" scanType=\"Full";
1310 os <<
"\" scanType=\"SIM";
1314 os <<
"\" scanType=\"SRM";
1318 os <<
"\" scanType=\"CRM";
1322 os <<
"\" scanType=\"Full";
1329 os <<
"\" filterLine=\"";
1335 os <<
"\" basePeakMz=\"";
1336 double basePeakInt = 0;
1337 double basePeakMz = 0;
1338 for (
Size j = 0; j < spec.size(); j++)
1340 if (spec[j].getIntensity() > basePeakInt)
1342 basePeakInt = spec[j].getIntensity();
1343 basePeakMz = spec[j].getMZ();
1349 os <<
"\" retentionTime=\"";
1350 if (spec.
getRT() < 0)
1352 os <<
"PT" << std::fabs(spec.
getRT()) <<
"S\"";
1359 warning(
STORE,
"The MzXML format can store only one scan window for each scan. Only the first one is stored!");
1370 os <<
String(ms_level + 2,
'\t') <<
"<precursorMz precursorIntensity=\"" << precursor.
getIntensity();
1373 os <<
"\" precursorCharge=\"" << precursor.
getCharge();
1378 os <<
"\">" << precursor.
getMZ() <<
"</precursorMz>\n";
1383 os <<
String(ms_level + 2,
'\t') <<
"<peaks precision=\"32\"" <<
" byteOrder=\"network\" pairOrder=\"m/z-int\">";
1386 std::vector<float> tmp;
1387 for (
Size i = 0; i < spec.size(); i++)
1389 tmp.push_back(spec[i].getMZ());
1390 tmp.push_back(spec[i].getIntensity());
1395 os << encoded <<
"</peaks>\n";
1399 os <<
String(ms_level + 2,
'\t') <<
"<peaks precision=\"32\"" <<
" byteOrder=\"network\" pairOrder=\"m/z-int\" xsi:nil=\"true\"/>\n";
1405 os <<
String(ms_level + 2,
'\t') <<
"<comment>" << spec.
getComment() <<
"</comment>\n";
1409 UInt next_ms_level = 0;
1410 if (s < cexp_->size() - 1)
1412 next_ms_level = ((*cexp_)[s + 1]).getMSLevel();
1415 if (next_ms_level <= ms_level)
1417 for (
Size i = 0; i <= ms_level - next_ms_level && !open_scans.empty(); ++i)
1419 os <<
String(ms_level - i + 1,
'\t') <<
"</scan>\n";
1425 os <<
"\t</msRun>\n" 1426 <<
"\t<indexOffset>0</indexOffset>\n" Deisotoping.
Definition: DataProcessing.h:62
Description of the applied preprocessing steps.
Definition: DataProcessing.h:51
std::vector< String > open_tags_
Stack of open XML tags.
Definition: XMLHandler.h:200
ChecksumType getChecksumType() const
returns the checksum type
void writeUserParam_(std::ostream &os, const MetaInfoInterface &meta, int indent=4, String tag="nameValue")
write metaInfo to xml (usually in nameValue-tag)
Definition: MzXMLHandler.h:229
Definition: IonSource.h:134
Big endian type.
Definition: Base64.h:78
Description of a MS instrument.
Definition: Instrument.h:64
bool hasMZRange() const
returns true if an MZ range has been set
bool optionalAttributeAsString_(String &value, const xercesc::Attributes &a, const char *name) const
Assigns the attribute content to the String value if the attribute is present.
Definition: XMLHandler.h:415
double getIsolationWindowLowerOffset() const
Returns the lower offset from the target m/z.
const String & getNameOfFile() const
returns the file name
const Software & getSoftware() const
returns a const reference to the instrument software
static const XMLCh * s_count_
Definition: MzXMLHandler.h:388
A more convenient string class.
Definition: String.h:57
Precursor meta information.
Definition: Precursor.h:56
Class to encode and decode Base64.
Definition: Base64.h:64
Exception that is thrown if the parsing is ended by some event (e.g. if only a prefix of the XML file...
Definition: XMLHandler.h:104
void warning(const xercesc::SAXParseException &exception)
const std::vector< IonSource > & getIonSources() const
returns a const reference to the ion source list
bool getAlwaysAppendData() const
returns whether or not to always append the data to the given map (even if a consumer is given) ...
static const XMLCh * s_peakscount_
Definition: MzXMLHandler.h:404
bool encloses(const PositionType &position) const
Checks whether this range contains a certain point.
Definition: DRange.h:172
UInt getMSLevel() const
Returns the MS level.
Definition: MSSpectrum.h:259
static const XMLCh * s_name_
Definition: MzXMLHandler.h:390
Definition: MassAnalyzer.h:86
bool hasIntensityRange() const
returns true if an intensity range has been set
IntensityType getIntensity() const
Definition: Peak1D.h:109
static const XMLCh * s_first_
Definition: MzXMLHandler.h:411
static const XMLCh * s_phone_
Definition: MzXMLHandler.h:413
static const XMLCh * s_centroided_
Definition: MzXMLHandler.h:418
SignedSize cvStringToEnum_(const Size section, const String &term, const char *message, const SignedSize result_on_error=0)
Definition: XMLHandler.h:224
static const XMLCh * s_filterline_
Definition: MzXMLHandler.h:407
UInt spec_write_counter_
spectrum counter (spectra without peaks are not written)
Definition: MzXMLHandler.h:217
void setMSDataConsumer(Interfaces::IMSDataConsumer< MapType > *consumer)
Set the IMSDataConsumer consumer which will consume the read data.
Definition: MzXMLHandler.h:129
const std::set< ProcessingAction > & getProcessingActions() const
returns a const reference to the applied processing actions
static const XMLCh * s_precursorcharge_
Definition: MzXMLHandler.h:401
static const XMLCh * s_filesha1_
Definition: MzXMLHandler.h:394
UInt peak_count_
Definition: MzXMLHandler.h:201
const DRange< 1 > & getIntensityRange() const
returns the intensity range
const String & getComment() const
returns the free-text comment
#define OPENMS_PRECONDITION(condition, message)
Precondition macro.
Definition: openms/include/OpenMS/CONCEPT/Macros.h:107
Negative polarity.
Definition: IonSource.h:144
bool hasMSLevels() const
returns true, if MS levels have been set
const std::vector< MassAnalyzer > & getMassAnalyzers() const
returns a const reference to the mass analyzer list
String toString() const
Conversion to String.
void clear()
Frees memory of all owned strings.
void setFileType(const String &file_type)
sets the file type
XML handlers for MzXMLFile.
Definition: MzXMLHandler.h:62
bool optionalAttributeAsInt_(Int &value, const xercesc::Attributes &a, const char *name) const
Assigns the attribute content to the Int value if the attribute is present.
Definition: XMLHandler.h:431
CoordinateType getMZ() const
Non-mutable access to m/z.
Definition: Peak1D.h:114
bool hasRTRange() const
returns true if an RT range has been set
Positive polarity.
Definition: IonSource.h:143
void error(const xercesc::SAXParseException &exception)
Definition: MassAnalyzer.h:70
Int getCharge() const
Non-mutable access to the charge.
virtual void startElement(const XMLCh *const uri, const XMLCh *const local_name, const XMLCh *const qname, const xercesc::Attributes &attributes)
Parsing method for opening tags.
Definition: MzXMLHandler.h:543
Base class for XML handlers.
Definition: XMLHandler.h:99
DateTime asDateTime_(String date_string)
Conversion of a xs:datetime string to a DataTime value.
Definition: XMLHandler.h:340
bool getSortSpectraByMZ() const
gets whether or not peaks in spectra should be sorted
ptrdiff_t SignedSize
Signed Size type e.g. used as pointer difference.
Definition: Types.h:128
const std::vector< IonDetector > & getIonDetectors() const
returns a const reference to the ion detector list
Description of a file location, used to store the origin of (meta) data.
Definition: SourceFile.h:47
static const XMLCh * s_retentiontime_
Definition: MzXMLHandler.h:408
double begin
Begin of the window.
Definition: ScanWindow.h:62
XMLHandler()
Not implemented.
Int attributeAsInt_(const xercesc::Attributes &a, const char *name) const
Converts an attribute to a Int.
Definition: XMLHandler.h:374
bool containsMSLevel(int level) const
returns true, if MS level level has been set
bool has(Byte byte) const
true if String contains the byte, false otherwise
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
MS2+ mass spectrum, is a "mass spectrum".
Definition: InstrumentSettings.h:58
void setMZ(CoordinateType mz)
Mutable access to m/z.
Definition: Peak1D.h:120
void setIntensity(IntensityType intensity)
Mutable access to the data point intensity (height)
Definition: Peak1D.h:111
Type
Detector type.
Definition: IonDetector.h:52
Selected reaction monitoring scan Synonyms: 'Multiple reaction monitoring scan', 'SRM scan', 'MRM scan'.
Definition: InstrumentSettings.h:60
void setChecksum(const String &checksum, ChecksumType type)
sets the file's checksum
static const XMLCh * s_scantype_
Definition: MzXMLHandler.h:406
static String writeXMLEscape(const String &to_escape)
Escapes a string and returns the escaped string.
Definition: XMLHandler.h:169
const MapType * cexp_
map pointer for writing
Definition: MzXMLHandler.h:182
double getIsolationWindowUpperOffset() const
Returns the upper offset from the target m/z.
bool equal_(const XMLCh *a, const XMLCh *b) const
Returns if two xerces strings are equal.
Definition: XMLHandler.h:203
bool getZoomScan() const
return if this scan is a zoom (enhanced resolution) scan
ScanMode getScanMode() const
returns the scan mode
Definition: IonDetector.h:76
MSExperiment< Peak1D > MapType
Definition: PeakPickerIterative.cpp:87
void get(UInt &month, UInt &day, UInt &year, UInt &hour, UInt &minute, UInt &second) const
Fills the arguments with the date and the time.
ResolutionMethod
resolution method
Definition: MassAnalyzer.h:80
static const XMLCh * s_polarity_
Definition: MzXMLHandler.h:405
virtual ~MzXMLHandler()
Destructor.
Definition: MzXMLHandler.h:101
String precision_
Definition: MzXMLHandler.h:202
Int toInt() const
Conversion to int.
void init_()
initialize members (call from C'tor)
Definition: MzXMLHandler.h:136
const std::vector< ScanWindow > & getScanWindows() const
returns a const reference to the m/z scan windows
void endProgress() const
Ends the progress display.
static const XMLCh * s_byteorder_
Definition: MzXMLHandler.h:397
Interfaces::IMSDataConsumer< MapType > * consumer_
Consumer class to work on spectra.
Definition: MzXMLHandler.h:220
static const XMLCh * s_completiontime_
Definition: MzXMLHandler.h:395
const DRange< 1 > & getRTRange() const
returns the RT range
bool getSizeOnly() const
returns whether or not to load only meta data
UInt getScanCount()
Gets the scan count.
Definition: MzXMLHandler.h:123
String & toLower()
Converts the string to lowercase.
Storing a file.
Definition: XMLHandler.h:119
bool hasSubstring(const String &string) const
true if String contains the string, false otherwise
double attributeAsDouble_(const xercesc::Attributes &a, const char *name) const
Converts an attribute to a double.
Definition: XMLHandler.h:382
PeakFileOptions options_
Options for loading and storing.
Definition: MzXMLHandler.h:185
static const XMLCh * s_num_
Definition: MzXMLHandler.h:416
const String & getModel() const
returns the instrument model
XMLCh * convert(const char *str) const
Transcode the supplied C string to XMLCh* and take ownership of the XMLCh*.
A 1-dimensional raw data point or peak.
Definition: Peak1D.h:55
Scan window description.
Definition: ScanWindow.h:47
double getRT() const
Definition: MSSpectrum.h:243
const String & getVendor() const
returns the instrument vendor
void setOptions(const PeakFileOptions &options)
Sets the options.
Definition: MzXMLHandler.h:117
static const XMLCh * s_value_
Definition: MzXMLHandler.h:387
full scan mass spectrum, is a "mass spectrum" Synonyms: 'full spectrum', 'Q1 spectrum', 'Q3 spectrum', 'Single-Stage Mass Spectrometry'
Definition: InstrumentSettings.h:57
String file_
File name.
Definition: XMLHandler.h:187
const Software & getSoftware() const
returns a const reference to the software used for processing
char * attributeAsString_(const xercesc::Attributes &a, const char *name) const
Converts an attribute to a String.
Definition: XMLHandler.h:366
IonizationMethod
ionization method
Definition: IonSource.h:80
Int nesting_level_
Definition: MzXMLHandler.h:190
const String & getName() const
returns the name of the software
static const XMLCh * s_pairorder_
Definition: MzXMLHandler.h:398
Selected ion monitoring scan Synonyms: 'Multiple ion monitoring scan', 'SIM scan', 'MIM scan'.
Definition: InstrumentSettings.h:59
void populateSpectraWithData_()
Populate all spectra on the stack with data from input.
Definition: MzXMLHandler.h:326
std::vector< DataProcessing > data_processing_
data processing auxiliary variable
Definition: MzXMLHandler.h:244
Invalid conversion exception.
Definition: Exception.h:363
Loading a file.
Definition: XMLHandler.h:118
void setNameOfFile(const String &name_of_file)
sets the file name
double end
End of the window.
Definition: ScanWindow.h:64
PeakType PeakType
Peak type.
Definition: MSSpectrum.h:105
String compressionType_
Definition: MzXMLHandler.h:203
static const XMLCh * s_version_
Definition: MzXMLHandler.h:391
std::vector< SpectrumData > spectrum_data_
Vector of spectrum data stored for later parallel processing.
Definition: MzXMLHandler.h:210
const String & getFileType() const
returns the file type
double asDouble_(const String &in)
Conversion of a String to a double value.
Definition: XMLHandler.h:287
bool getFillData() const
returns whether to fill the actual data into the container (spectrum/chromatogram) ...
StringManager sm_
Helper class for string conversion.
Definition: XMLHandler.h:193
MapType::PeakType PeakType
Peak type.
Definition: MzXMLHandler.h:175
Secure Hash Algorithm-1.
Definition: SourceFile.h:55
static const XMLCh * s_last_
Definition: MzXMLHandler.h:412
Consecutive reaction monitoring scan Synonyms: 'CRM scan'.
Definition: InstrumentSettings.h:61
SpectrumType spectrum
Definition: MzXMLHandler.h:205
UInt scan_count_
Consumer class to work on spectra.
Definition: MzXMLHandler.h:223
const String & getVersion() const
returns the software version
const DateTime & getCompletionTime() const
returns the time of completion of the processing
bool optionalAttributeAsDouble_(double &value, const xercesc::Attributes &a, const char *name) const
Assigns the attribute content to the double value if the attribute is present.
Definition: XMLHandler.h:463
IonSource::Polarity getPolarity() const
returns the polarity
MzXMLHandler(const MapType &exp, const String &filename, const String &version, const ProgressLogger &logger)
Constructor for a write-only handler.
Definition: MzXMLHandler.h:85
String & removeWhitespaces()
removes whitespaces (space, tab, line feed, carriage return)
MSSpectrum< PeakType > SpectrumType
Spectrum type.
Definition: MzXMLHandler.h:177
static void appendASCII(const XMLCh *str, const XMLSize_t length, String &result)
Transcodes the supplied XMLCh* and appends it to the OpenMS String.
The interface of a consumer of spectra and chromatograms.
Definition: IMSDataConsumer.h:68
Unknown scan method.
Definition: InstrumentSettings.h:55
String prefix(SizeType length) const
returns the prefix of length length
const String & getChecksum() const
returns the file's checksum
DateTime Class.
Definition: DateTime.h:55
Base class for all classes that want to report their progress.
Definition: ProgressLogger.h:55
void startProgress(SignedSize begin, SignedSize end, const String &label) const
Initializes the progress display.
String char_rest_
Definition: MzXMLHandler.h:204
String substr(size_t pos=0, size_t n=npos) const
Wrapper for the STL substr() method. Returns a String object with its contents initialized to a subst...
bool skip_spectrum_
Flag that indicates whether this spectrum should be skipped (due to options)
Definition: MzXMLHandler.h:214
void encode(std::vector< FromType > &in, ByteOrder to_byte_order, String &out, bool zlib_compression=false)
Encodes a vector of floating point numbers to a Base64 string.
Definition: Base64.h:207
virtual void consumeSpectrum(SpectrumType &s)=0
Consume a spectrum.
Data necessary to generate a single spectrum.
Definition: MzXMLHandler.h:199
void setProgress(SignedSize value) const
Sets the current progress.
const InstrumentSettings & getInstrumentSettings() const
returns a const reference to the instrument settings of the current spectrum
void doPopulateSpectraWithData_(SpectrumData &spectrum_data)
Fill a single spectrum with data from input.
Definition: MzXMLHandler.h:253
Peak picking (conversion from raw to peak data)
Definition: DataProcessing.h:67
static const XMLCh * s_startmz_
Definition: MzXMLHandler.h:409
Base64 decoder_
Definition: MzXMLHandler.h:189
Size getMaxDataPoolSize() const
Get maximal size of the data pool.
static const XMLCh * s_type_
Definition: MzXMLHandler.h:389
general spectrum type
Definition: InstrumentSettings.h:56
const DRange< 1 > & getMZRange() const
returns the MZ range
const std::vector< Precursor > & getPrecursors() const
returns a const reference to the precursors
Options for loading files containing peak data.
Definition: PeakFileOptions.h:48
std::vector< std::vector< String > > cv_terms_
Array of CV term lists (one sublist denotes one term and it's children)
Definition: XMLHandler.h:220
AnalyzerType
analyzer type
Definition: MassAnalyzer.h:53
virtual void endElement(const XMLCh *const uri, const XMLCh *const local_name, const XMLCh *const qname)
Parsing method for closing tags.
Definition: MzXMLHandler.h:929
const ProgressLogger & logger_
Progress logging class.
Definition: MzXMLHandler.h:226
static const std::string NamesOfScanMode[SIZE_OF_SCANMODE]
Names of scan modes.
Definition: InstrumentSettings.h:74
const String & getNativeID() const
returns the native identifier for the spectrum, used by the acquisition software. ...
static const XMLCh * s_filename_
Definition: MzXMLHandler.h:392
virtual void characters(const XMLCh *const chars, const XMLSize_t length)
Parsing method for character data.
Definition: MzXMLHandler.h:965
String suffix(SizeType length) const
returns the suffix of length length
bool skip_data
Definition: MzXMLHandler.h:206
void initStaticMembers_()
Definition: MzXMLHandler.h:423
int Int
Signed integer type.
Definition: Types.h:96
MapType * exp_
map pointer for reading
Definition: MzXMLHandler.h:180
static const XMLCh * s_endmz_
Definition: MzXMLHandler.h:410
static const XMLCh * s_deisotoped_
Definition: MzXMLHandler.h:419
bool split(const char splitter, std::vector< String > &substrings, bool quote_protect=false) const
Splits a string into substrings using splitter as delimiter.
static const XMLCh * s_uri_
Definition: MzXMLHandler.h:415
Charge deconvolution.
Definition: DataProcessing.h:61
MzXMLHandler()
Not implemented.
void writeTo(std::ostream &os)
Write the contents to a stream.
Definition: MzXMLHandler.h:1032
static const XMLCh * s_filetype_
Definition: MzXMLHandler.h:393
static const XMLCh * s_intensitycutoff_
Definition: MzXMLHandler.h:417
void decode(const String &in, ByteOrder from_byte_order, std::vector< ToType > &out, bool zlib_compression=false)
Decodes a Base64 string to a vector of floating point numbers.
Definition: Base64.h:334
static const XMLCh * s_mslevel_
Definition: MzXMLHandler.h:403
static const XMLCh * s_email_
Definition: MzXMLHandler.h:414
Polarity
Polarity of the ion source.
Definition: IonSource.h:140
static const XMLCh * s_precursorintensity_
Definition: MzXMLHandler.h:400
static const XMLCh * s_compressionType_
Definition: MzXMLHandler.h:399
bool hasPrefix(const String &string) const
true if String begins with string, false otherwise
Parse Error exception.
Definition: Exception.h:608
static const XMLCh * s_windowwideness_
Definition: MzXMLHandler.h:402
static const XMLCh * s_chargedeconvoluted_
Definition: MzXMLHandler.h:420
static const XMLCh * s_precision_
Definition: MzXMLHandler.h:396
bool getMetadataOnly() const
returns whether or not to load only meta data