35 #ifndef OPENMS_FORMAT_HANDLERS_MZMLHANDLER_H 36 #define OPENMS_FORMAT_HANDLERS_MZMLHANDLER_H 87 class ControlledVocabulary;
107 template <
typename MapType>
148 LOG_ERROR <<
"MzMLHandler was initialized with an invalid version number: " <<
version_ << std::endl;
185 LOG_ERROR <<
"MzMLHandler was initialized with an invalid version number: " <<
version_ << std::endl;
197 virtual void endElement(
const XMLCh*
const ,
const XMLCh*
const ,
const XMLCh*
const qname);
200 virtual void startElement(
const XMLCh*
const ,
const XMLCh*
const ,
const XMLCh*
const qname,
const xercesc::Attributes& attributes);
203 virtual void characters(
const XMLCh*
const chars,
const XMLSize_t length);
206 virtual void writeTo(std::ostream& os);
265 std::vector<std::vector<DataProcessing> >& dps);
269 template <
typename ContainerT>
276 std::vector<double> data_to_encode(container.size());
277 if (array_type ==
"intensity")
279 for (
Size p = 0; p < container.size(); ++p)
281 data_to_encode[p] = container[p].getIntensity();
286 for (
Size p = 0; p < container.size(); ++p)
288 data_to_encode[p] = container[p].getMZ();
295 std::vector<float> data_to_encode(container.size());
297 if (array_type ==
"intensity")
299 for (
Size p = 0; p < container.size(); ++p)
301 data_to_encode[p] = container[p].getIntensity();
306 for (
Size p = 0; p < container.size(); ++p)
308 data_to_encode[p] = container[p].getMZ();
330 #pragma omp parallel for 349 #pragma omp critical(HandleException) 394 #pragma omp parallel for 440 template <
typename SpectrumType>
442 const Size n, SpectrumType& spectrum)
const 446 UInt meta_float_array_index = 0;
447 UInt meta_int_array_index = 0;
448 UInt meta_string_array_index = 0;
449 for (
Size i = 0; i < input_data.size(); i++)
451 if (input_data[i].meta.getName() !=
"m/z array" && input_data[i].meta.getName() !=
"intensity array")
455 if (n < input_data[i].size)
460 ++meta_float_array_index;
464 if (n < input_data[i].size)
469 ++meta_int_array_index;
473 if (n < input_data[i].decoded_char.size())
475 String value = input_data[i].decoded_char[n];
478 ++meta_string_array_index;
494 template <
typename SpectrumType>
497 SpectrumType& spectrum)
505 bool mz_precision_64 =
true;
506 bool int_precision_64 =
true;
513 if (int_index == -1 || mz_index == -1)
516 if (default_arr_length != 0)
518 warning(
LOAD,
String(
"The m/z or intensity array of spectrum '") + spectrum.
getNativeID() +
"' is missing and default_arr_length is " + default_arr_length +
".");
524 if ((input_data[mz_index].ints_32.size() > 0) || (input_data[mz_index].ints_64.size() > 0))
526 fatalError(
LOAD,
"Encoding m/z array as integer is not allowed!");
528 if ((input_data[int_index].ints_32.size() > 0) || (input_data[int_index].ints_64.size() > 0))
530 fatalError(
LOAD,
"Encoding intensity array as integer is not allowed!");
534 Size mz_size = mz_precision_64 ? input_data[mz_index].floats_64.size() : input_data[mz_index].floats_32.size();
535 Size int_size = int_precision_64 ? input_data[int_index].floats_64.size() : input_data[int_index].floats_32.size();
537 if (mz_size != int_size)
539 fatalError(
LOAD,
String(
"The length of m/z and integer values of spectrum '") + spectrum.
getNativeID() +
"' differ (mz-size: " + mz_size +
", int-size: " + int_size +
"! Not reading spectrum!");
541 bool repair_array_length =
false;
542 if (default_arr_length != mz_size)
544 warning(
LOAD,
String(
"The m/z array of spectrum '") + spectrum.
getNativeID() +
"' has the size " + mz_size +
", but it should have size " + default_arr_length +
" (defaultArrayLength).");
545 repair_array_length =
true;
547 if (default_arr_length != int_size)
549 warning(
LOAD,
String(
"The intensity array of spectrum '") + spectrum.
getNativeID() +
"' has the size " + int_size +
", but it should have size " + default_arr_length +
" (defaultArrayLength).");
550 repair_array_length =
true;
552 if (repair_array_length)
554 default_arr_length = int_size;
555 warning(
LOAD,
String(
"Fixing faulty defaultArrayLength to ") + default_arr_length +
".");
559 if (input_data.size() > 2)
561 for (
Size i = 0; i < input_data.size(); i++)
563 if (input_data[i].meta.getName() !=
"m/z array" && input_data[i].meta.getName() !=
"intensity array")
572 spectrum.
getFloatDataArrays().back().MetaInfoDescription::operator=(input_data[i].meta);
598 for (
Size i = 0; i < input_data.size(); i++)
600 if (input_data[i].meta.getName() ==
"m/z array" || input_data[i].meta.getName() ==
"intensity array")
602 std::vector<UInt> keys;
603 input_data[i].meta.getKeys(keys);
604 for (
Size k = 0;
k < keys.size(); ++
k)
606 spectrum.
setMetaValue(keys[
k], input_data[i].meta.getMetaValue(keys[k]));
616 spectrum.reserve(default_arr_length);
620 if ( mz_precision_64 && !int_precision_64 &&
621 input_data.size() == 2 &&
626 std::vector< double >::iterator mz_it = input_data[mz_index].floats_64.begin();
627 std::vector< float >::iterator int_it = input_data[int_index].floats_32.begin();
628 for (
Size n = 0; n < default_arr_length; n++)
631 tmp.setIntensity(*int_it);
635 spectrum.push_back(tmp);
640 for (
Size n = 0; n < default_arr_length; n++)
642 double mz = mz_precision_64 ? input_data[mz_index].floats_64[n] : input_data[mz_index].floats_32[n];
643 double intensity = int_precision_64 ? input_data[int_index].floats_64[n] : input_data[int_index].floats_32[n];
648 tmp.setIntensity(intensity);
650 spectrum.push_back(tmp);
655 if (input_data.size() > 2)
670 template <
typename ChromatogramType>
673 ChromatogramType& inp_chromatogram)
681 bool int_precision_64 =
true;
682 bool rt_precision_64 =
true;
689 if (int_index == -1 || rt_index == -1)
692 if (default_arr_length != 0)
694 warning(
LOAD,
String(
"The m/z or intensity array of chromatogram '") + inp_chromatogram.
getNativeID() +
"' is missing and default_arr_length is " + default_arr_length +
".");
700 Size rt_size = rt_precision_64 ? input_data[rt_index].floats_64.size() : input_data[rt_index].floats_32.size();
701 if (default_arr_length != rt_size)
703 warning(
LOAD,
String(
"The base64-decoded rt array of chromatogram '") + inp_chromatogram.
getNativeID() +
"' has the size " + rt_size +
", but it should have size " + default_arr_length +
" (defaultArrayLength).");
705 Size int_size = int_precision_64 ? input_data[int_index].floats_64.size() : input_data[int_index].floats_32.size();
706 if (default_arr_length != int_size)
708 warning(
LOAD,
String(
"The base64-decoded intensity array of chromatogram '") + inp_chromatogram.
getNativeID() +
"' has the size " + int_size +
", but it should have size " + default_arr_length +
" (defaultArrayLength).");
712 if (input_data.size() > 2)
714 for (
Size i = 0; i < input_data.size(); i++)
716 if (input_data[i].meta.getName() !=
"intensity array" && input_data[i].meta.getName() !=
"time array")
725 inp_chromatogram.
getFloatDataArrays().back().MetaInfoDescription::operator=(input_data[i].meta);
734 inp_chromatogram.
getIntegerDataArrays().back().MetaInfoDescription::operator=(input_data[i].meta);
743 inp_chromatogram.
getStringDataArrays().back().MetaInfoDescription::operator=(input_data[i].meta);
751 for (
Size i = 0; i < input_data.size(); i++)
753 if (input_data[i].meta.getName() ==
"time array" || input_data[i].meta.getName() ==
"intensity array")
755 std::vector<UInt> keys;
756 input_data[i].meta.getKeys(keys);
757 for (
Size k = 0;
k < keys.size(); ++
k)
759 inp_chromatogram.
setMetaValue(keys[
k], input_data[i].meta.getMetaValue(keys[k]));
765 inp_chromatogram.reserve(default_arr_length);
766 ChromatogramPeakType tmp;
767 for (
Size n = 0; n < default_arr_length; n++)
769 double rt = rt_precision_64 ? input_data[rt_index].floats_64[n] : input_data[rt_index].floats_32[n];
770 double intensity = int_precision_64 ? input_data[int_index].floats_64[n] : input_data[int_index].floats_32[n];
775 tmp.setIntensity(intensity);
777 inp_chromatogram.push_back(tmp);
780 UInt meta_float_array_index = 0;
781 UInt meta_int_array_index = 0;
782 UInt meta_string_array_index = 0;
783 for (
Size i = 0; i < input_data.size(); i++)
785 if (input_data[i].meta.getName() !=
"intensity array" && input_data[i].meta.getName() !=
"time array")
789 if (n < input_data[i].size)
794 ++meta_float_array_index;
798 if (n < input_data[i].size)
803 ++meta_int_array_index;
807 if (n < input_data[i].decoded_char.size())
809 String value = input_data[i].decoded_char[n];
812 ++meta_string_array_index;
820 template <
typename DataType>
824 bool no_numpress =
true;
829 String compression_term_no_np;
831 if (array_type ==
"mz")
833 cv_term_type =
"\t\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000514\" name=\"m/z array\" unitAccession=\"MS:1000040\" unitName=\"m/z\" unitCvRef=\"MS\" />\n";
838 else if (array_type ==
"time")
840 cv_term_type =
"\t\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000595\" name=\"time array\" unitAccession=\"UO:0000010\" unitName=\"second\" unitCvRef=\"MS\" />\n";
845 else if (array_type ==
"intensity")
847 cv_term_type =
"\t\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000515\" name=\"intensity array\" unitAccession=\"MS:1000131\" unitName=\"number of detector counts\" unitCvRef=\"MS\"/>\n";
861 if (!encoded_string.empty())
865 os <<
"\t\t\t\t\t<binaryDataArray encodedLength=\"" << encoded_string.size() <<
"\">\n";
867 os <<
"\t\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000523\" name=\"64-bit float\" />\n";
872 if (is32bit && no_numpress)
874 compression_term = compression_term_no_np;
876 os <<
"\t\t\t\t\t<binaryDataArray encodedLength=\"" << encoded_string.size() <<
"\">\n";
878 os <<
"\t\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000521\" name=\"32-bit float\" />\n";
880 else if (!is32bit && no_numpress)
882 compression_term = compression_term_no_np;
884 os <<
"\t\t\t\t\t<binaryDataArray encodedLength=\"" << encoded_string.size() <<
"\">\n";
886 os <<
"\t\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000523\" name=\"64-bit float\" />\n";
889 os <<
"\t\t\t\t\t\t" << compression_term <<
"\n";
890 os <<
"\t\t\t\t\t\t<binary>" << encoded_string <<
"</binary>\n";
891 os <<
"\t\t\t\t\t</binaryDataArray>\n";
1047 template <
typename MapType>
1056 if (current_tag ==
"binary")
1061 else if (current_tag ==
"offset" || current_tag ==
"indexListOffset" || current_tag ==
"fileChecksum")
1071 String transcoded_chars2 = transcoded_chars;
1072 transcoded_chars2.
trim();
1073 if (transcoded_chars2 !=
"")
1074 warning(
LOAD,
String(
"Unhandled character content in tag '") + current_tag +
"': " + transcoded_chars2);
1078 template <
typename MapType>
1081 static const XMLCh* s_count = xercesc::XMLString::transcode(
"count");
1082 static const XMLCh* s_default_array_length = xercesc::XMLString::transcode(
"defaultArrayLength");
1083 static const XMLCh* s_array_length = xercesc::XMLString::transcode(
"arrayLength");
1084 static const XMLCh* s_accession = xercesc::XMLString::transcode(
"accession");
1085 static const XMLCh* s_name = xercesc::XMLString::transcode(
"name");
1086 static const XMLCh* s_type = xercesc::XMLString::transcode(
"type");
1087 static const XMLCh* s_value = xercesc::XMLString::transcode(
"value");
1088 static const XMLCh* s_unit_accession = xercesc::XMLString::transcode(
"unitAccession");
1089 static const XMLCh* s_id = xercesc::XMLString::transcode(
"id");
1090 static const XMLCh* s_spot_id = xercesc::XMLString::transcode(
"spotID");
1092 static const XMLCh* s_ref = xercesc::XMLString::transcode(
"ref");
1093 static const XMLCh* s_version = xercesc::XMLString::transcode(
"version");
1094 static const XMLCh* s_order = xercesc::XMLString::transcode(
"order");
1095 static const XMLCh* s_location = xercesc::XMLString::transcode(
"location");
1096 static const XMLCh* s_sample_ref = xercesc::XMLString::transcode(
"sampleRef");
1097 static const XMLCh* s_software_ref = xercesc::XMLString::transcode(
"softwareRef");
1098 static const XMLCh* s_source_file_ref = xercesc::XMLString::transcode(
"sourceFileRef");
1099 static const XMLCh* s_default_instrument_configuration_ref = xercesc::XMLString::transcode(
"defaultInstrumentConfigurationRef");
1100 static const XMLCh* s_instrument_configuration_ref = xercesc::XMLString::transcode(
"instrumentConfigurationRef");
1101 static const XMLCh* s_default_data_processing_ref = xercesc::XMLString::transcode(
"defaultDataProcessingRef");
1102 static const XMLCh* s_data_processing_ref = xercesc::XMLString::transcode(
"dataProcessingRef");
1103 static const XMLCh* s_start_time_stamp = xercesc::XMLString::transcode(
"startTimeStamp");
1104 static const XMLCh* s_external_spectrum_id = xercesc::XMLString::transcode(
"externalSpectrumID");
1105 static const XMLCh* s_default_source_file_ref = xercesc::XMLString::transcode(
"defaultSourceFileRef");
1106 static const XMLCh* s_scan_settings_ref = xercesc::XMLString::transcode(
"scanSettingsRef");
1115 String parent_parent_tag;
1126 if (tag ==
"spectrum")
1146 String data_processing_ref;
1156 else if (tag ==
"chromatogram")
1168 String data_processing_ref;
1178 else if (tag ==
"spectrumList")
1188 exp_->reserveSpaceSpectra(count);
1192 else if (tag ==
"chromatogramList")
1202 exp_->reserveSpaceChromatograms(count);
1206 else if (tag ==
"binaryDataArrayList" )
1210 else if (tag ==
"binaryDataArray" )
1214 data_.back().compression =
false;
1219 data_.back().size = array_length;
1222 String data_processing_ref;
1228 else if (tag ==
"cvParam")
1232 String unit_accession =
"";
1236 else if (tag ==
"userParam")
1244 else if (tag ==
"referenceableParamGroup")
1248 else if (tag ==
"sourceFile")
1254 else if (tag ==
"referenceableParamGroupRef")
1263 else if (tag ==
"scan")
1274 String external_spectrum_id;
1283 String instrument_configuration_ref;
1286 warning(
LOAD,
"Unhandled attribute 'instrumentConfigurationRef' in 'scan' tag.");
1291 else if (tag ==
"mzML")
1308 if (current_version < mzML_min_version)
1310 fatalError(
LOAD,
String(
"Only mzML 1.1.0 or higher is supported! This file has version '") + file_version +
"'.");
1314 warning(
LOAD,
"The mzML file version (" + file_version +
") is newer than the parser version (" +
version_ +
"). This might lead to undefined behavior.");
1322 exp_->setIdentifier(accession);
1328 exp_->setMetaValue(
"mzml_id",
id);
1331 else if (tag ==
"contact")
1335 else if (tag ==
"sample")
1344 else if (tag ==
"run")
1362 String default_source_file_ref;
1368 else if (tag ==
"software")
1373 else if (tag ==
"dataProcessing")
1377 else if (tag ==
"processingMethod")
1388 LOG_ERROR <<
"Warning: Parsing error, \"processingMethod\" is missing the required attribute \"softwareRef\".\n" <<
1389 "The software tool which generated this mzML should be fixed. Please notify the maintainers." << std::endl;
1394 else if (tag ==
"instrumentConfiguration")
1399 String scan_settings_ref;
1402 warning(
LOAD,
"Unhandled attribute 'scanSettingsRef' in 'instrumentConfiguration' tag.");
1405 else if (tag ==
"softwareRef")
1410 else if (tag ==
"source")
1415 else if (tag ==
"analyzer")
1420 else if (tag ==
"detector")
1425 else if (tag ==
"precursor")
1440 String external_spectrum_id;
1443 spec_.
getPrecursors().back().setMetaValue(
"external_spectrum_id", external_spectrum_id);
1459 String external_spectrum_id;
1467 else if (tag ==
"product")
1479 else if (tag ==
"selectedIon")
1484 else if (tag ==
"selectedIonList")
1489 warning(
LOAD,
"OpenMS can currently handle only one selection ion per precursor! Only the first ion is loaded!");
1492 else if (tag ==
"scanWindow")
1498 template <
typename MapType>
1501 static const XMLCh* s_spectrum = xercesc::XMLString::transcode(
"spectrum");
1502 static const XMLCh* s_chromatogram = xercesc::XMLString::transcode(
"chromatogram");
1503 static const XMLCh* s_spectrum_list = xercesc::XMLString::transcode(
"spectrumList");
1504 static const XMLCh* s_chromatogram_list = xercesc::XMLString::transcode(
"chromatogramList");
1505 static const XMLCh* s_mzml = xercesc::XMLString::transcode(
"mzML");
1509 if (
equal_(qname, s_spectrum))
1549 else if (
equal_(qname, s_chromatogram))
1574 else if (
equal_(qname, s_spectrum_list))
1579 else if (
equal_(qname, s_chromatogram_list))
1584 else if (
equal_(qname, s_mzml))
1602 template <
typename MapType>
1613 if (parent_tag !=
"sample")
1615 warning(
LOAD,
String(
"Unknown cvParam '") + accession +
"' in tag '" + parent_tag +
"'.");
1626 warning(
LOAD,
String(
"Obsolete CV term '") + accession +
" - " + term.
name +
"' used in tag '" + parent_tag +
"'.");
1629 String parsed_name = name;
1632 correct_name.
trim();
1633 if (parsed_name != correct_name)
1635 warning(
LOAD,
String(
"Name of CV term not correct: '") + term.
id +
" - " + parsed_name +
"' should be '" + correct_name +
"'");
1639 warning(
LOAD,
String(
"Obsolete CV term '") + accession +
" - " + term.
name +
"' used in tag '" + parent_tag +
"'.");
1649 warning(
LOAD,
String(
"The CV term '") + accession +
" - " + term.
name +
"' used in tag '" + parent_tag +
"' must not have a value. The value is '" + value +
"'.");
1668 termValue = value.
toInt();
1672 warning(
LOAD,
String(
"The CV term '") + accession +
" - " + term.
name +
"' used in tag '" + parent_tag +
"' must have an integer value. The value is '" + value +
"'.");
1685 warning(
LOAD,
String(
"The CV term '") + accession +
" - " + term.
name +
"' used in tag '" + parent_tag +
"' must have a floating-point value. The value is '" + value +
"'.");
1699 warning(
LOAD,
String(
"The CV term '") + accession +
" - " + term.
name +
"' used in tag '" + parent_tag +
"' must be a valid date. The value is '" + value +
"'.");
1713 warning(
LOAD,
String(
"The CV term '") + accession +
" - " + term.
name +
"' used in tag '" + parent_tag +
"' should have a numerical value. The value is '" + value +
"'.");
1718 if (unit_accession !=
"") termValue.
setUnit(unit_accession);
1721 if (parent_tag ==
"run")
1724 if (accession ==
"MS:1000858")
1726 exp_->setFractionIdentifier(value);
1729 warning(
LOAD,
String(
"Unhandled cvParam '") + accession +
"' in tag '" + parent_tag +
"'.");
1732 else if (parent_tag ==
"binaryDataArray")
1742 warning(
LOAD,
String(
"Unhandled cvParam '") + accession +
"' in tag '" + parent_tag +
"'.");
1747 else if (parent_tag ==
"spectrum")
1750 if (accession ==
"MS:1000294")
1754 else if (accession ==
"MS:1000579")
1758 else if (accession ==
"MS:1000580")
1762 else if (accession ==
"MS:1000581")
1766 else if (accession ==
"MS:1000582")
1770 else if (accession ==
"MS:1000583")
1774 else if (accession ==
"MS:1000804")
1778 else if (accession ==
"MS:1000805")
1782 else if (accession ==
"MS:1000806")
1786 else if (accession ==
"MS:1000325")
1790 else if (accession ==
"MS:1000326")
1794 else if (accession ==
"MS:1000341")
1798 else if (accession ==
"MS:1000789")
1802 else if (accession ==
"MS:1000790")
1807 else if (accession ==
"MS:1000127")
1811 else if (accession ==
"MS:1000128")
1815 else if (accession ==
"MS:1000525")
1820 else if (accession ==
"MS:1000511")
1829 else if (accession ==
"MS:1000497")
1833 else if (accession ==
"MS:1000285")
1838 else if (accession ==
"MS:1000504")
1843 else if (accession ==
"MS:1000505")
1848 else if (accession ==
"MS:1000527")
1853 else if (accession ==
"MS:1000528")
1858 else if (accession ==
"MS:1000618")
1863 else if (accession ==
"MS:1000619")
1868 else if (accession ==
"MS:1000796")
1873 else if (accession ==
"MS:1000797")
1878 else if (accession ==
"MS:1000798")
1884 else if (accession ==
"MS:1000129")
1888 else if (accession ==
"MS:1000130")
1893 warning(
LOAD,
String(
"Unhandled cvParam '") + accession +
"' in tag '" + parent_tag +
"'.");
1896 else if (parent_tag ==
"scanWindow")
1898 if (accession ==
"MS:1000501")
1902 else if (accession ==
"MS:1000500")
1907 warning(
LOAD,
String(
"Unhandled cvParam '") + accession +
"' in tag '" + parent_tag +
"'.");
1910 else if (parent_tag ==
"referenceableParamGroup")
1920 else if (parent_tag ==
"selectedIon")
1926 if (accession ==
"MS:1000744")
1938 else if (accession ==
"MS:1000041")
1949 else if (accession ==
"MS:1000042")
1960 else if (accession ==
"MS:1000633")
1972 warning(
LOAD,
String(
"Unhandled cvParam '") + accession +
"' in tag '" + parent_tag +
"'.");
1975 else if (parent_tag ==
"activation")
1980 if (accession ==
"MS:1000245")
1985 else if (accession ==
"MS:1000045")
1990 else if (accession ==
"MS:1000412")
1995 else if (accession ==
"MS:1000419")
2000 else if (accession ==
"MS:1000509")
2004 else if (accession ==
"MS:1000138")
2009 else if (accession ==
"MS:1000869")
2015 else if (accession ==
"MS:1000044")
2019 else if (accession ==
"MS:1000133")
2023 else if (accession ==
"MS:1000134")
2027 else if (accession ==
"MS:1000135")
2031 else if (accession ==
"MS:1000136")
2035 else if (accession ==
"MS:1000242")
2039 else if (accession ==
"MS:1000250")
2043 else if (accession ==
"MS:1000262")
2047 else if (accession ==
"MS:1000282")
2051 else if (accession ==
"MS:1000422")
2055 else if (accession ==
"MS:1000433")
2059 else if (accession ==
"MS:1000435")
2063 else if (accession ==
"MS:1000598")
2067 else if (accession ==
"MS:1000599")
2072 warning(
LOAD,
String(
"Unhandled cvParam '") + accession +
"' in tag '" + parent_tag +
"'.");
2076 if (accession ==
"MS:1000245")
2081 else if (accession ==
"MS:1000045")
2086 else if (accession ==
"MS:1000412")
2091 else if (accession ==
"MS:1000419")
2096 else if (accession ==
"MS:1000509")
2100 else if (accession ==
"MS:1000138")
2105 else if (accession ==
"MS:1000869")
2111 else if (accession ==
"MS:1000044")
2115 else if (accession ==
"MS:1000133")
2119 else if (accession ==
"MS:1000134")
2123 else if (accession ==
"MS:1000135")
2127 else if (accession ==
"MS:1000136")
2131 else if (accession ==
"MS:1000242")
2135 else if (accession ==
"MS:1000250")
2139 else if (accession ==
"MS:1000262")
2143 else if (accession ==
"MS:1000282")
2147 else if (accession ==
"MS:1000422")
2151 else if (accession ==
"MS:1000433")
2155 else if (accession ==
"MS:1000435")
2159 else if (accession ==
"MS:1000598")
2163 else if (accession ==
"MS:1000599")
2168 warning(
LOAD,
String(
"Unhandled cvParam '") + accession +
"' in tag '" + parent_tag +
"'.");
2172 else if (parent_tag ==
"isolationWindow")
2174 if (parent_parent_tag ==
"precursor")
2176 if (accession ==
"MS:1000827")
2187 else if (accession ==
"MS:1000828")
2198 else if (accession ==
"MS:1000829")
2210 warning(
LOAD,
String(
"Unhandled cvParam '") + accession +
"' in tag '" + parent_tag +
"'.");
2212 else if (parent_parent_tag ==
"product")
2214 if (accession ==
"MS:1000827")
2225 else if (accession ==
"MS:1000829")
2236 else if (accession ==
"MS:1000828")
2248 warning(
LOAD,
String(
"Unhandled cvParam '") + accession +
"' in tag '" + parent_tag +
"'.");
2252 else if (parent_tag ==
"scanList")
2259 warning(
LOAD,
String(
"Unhandled cvParam '") + accession +
"' in tag '" + parent_tag +
"'.");
2262 else if (parent_tag ==
"scan")
2265 if (accession ==
"MS:1000502")
2270 else if (accession ==
"MS:1000011")
2275 else if (accession ==
"MS:1000015")
2280 else if (accession ==
"MS:1000016")
2282 if (unit_accession ==
"UO:0000031")
2297 else if (accession ==
"MS:1000826")
2299 if (unit_accession ==
"UO:0000031")
2308 else if (accession ==
"MS:1000512")
2313 else if (accession ==
"MS:1000803")
2318 else if (accession ==
"MS:1000616")
2323 else if (accession ==
"MS:1000800")
2328 else if (accession ==
"MS:1000880")
2334 else if (accession ==
"MS:1000092")
2339 else if (accession ==
"MS:1000093")
2345 else if (accession ==
"MS:1000094")
2350 else if (accession ==
"MS:1000095")
2355 else if (accession ==
"MS:1000096")
2361 warning(
LOAD,
String(
"Unhandled cvParam '") + accession +
"' in tag '" + parent_tag +
"'.");
2364 else if (parent_tag ==
"contact")
2366 if (accession ==
"MS:1000586")
2368 exp_->getContacts().back().setName(value);
2370 else if (accession ==
"MS:1000587")
2372 exp_->getContacts().back().setAddress(value);
2374 else if (accession ==
"MS:1000588")
2376 exp_->getContacts().back().setURL(value);
2378 else if (accession ==
"MS:1000589")
2380 exp_->getContacts().back().setEmail(value);
2382 else if (accession ==
"MS:1000590")
2384 exp_->getContacts().back().setInstitution(value);
2387 warning(
LOAD,
String(
"Unhandled cvParam '") + accession +
"' in tag '" + parent_tag +
"'.");
2390 else if (parent_tag ==
"sourceFile")
2392 if (accession ==
"MS:1000569")
2396 else if (accession ==
"MS:1000568")
2409 warning(
LOAD,
String(
"Unhandled cvParam '") + accession +
"' in tag '" + parent_tag +
"'.");
2412 else if (parent_tag ==
"sample")
2414 if (accession ==
"MS:1000004")
2418 else if (accession ==
"MS:1000001")
2422 else if (accession ==
"MS:1000005")
2426 else if (accession ==
"MS:1000006")
2430 else if (accession ==
"MS:1000053")
2435 else if (accession ==
"MS:1000047")
2439 else if (accession ==
"MS:1000048")
2443 else if (accession ==
"MS:1000049")
2447 else if (accession ==
"MS:1000050")
2451 else if (accession ==
"MS:1000051")
2455 else if (accession ==
"MS:1000052")
2475 warning(
LOAD,
String(
"Unhandled cvParam '") + accession +
"' in tag '" + parent_tag +
"'.");
2478 else if (parent_tag ==
"instrumentConfiguration")
2481 if (accession ==
"MS:1000031")
2490 else if (accession ==
"MS:1000529")
2495 else if (accession ==
"MS:1000032")
2499 else if (accession ==
"MS:1000236")
2505 else if (accession ==
"MS:1000246")
2509 else if (accession ==
"MS:1000221")
2513 else if (accession ==
"MS:1000275")
2517 else if (accession ==
"MS:1000281")
2521 else if (accession ==
"MS:1000286")
2525 else if (accession ==
"MS:1000300")
2529 else if (accession ==
"MS:1000307")
2533 else if (accession ==
"MS:1000309")
2537 else if (accession ==
"MS:1000310")
2541 else if (accession ==
"MS:1000311")
2545 else if (accession ==
"MS:1000320")
2550 else if (accession ==
"MS:1000304")
2555 else if (accession ==
"MS:1000216")
2560 else if (accession ==
"MS:1000308")
2565 else if (accession ==
"MS:1000319")
2571 warning(
LOAD,
String(
"Unhandled cvParam '") + accession +
"' in tag '" + parent_tag +
"'.");
2573 else if (parent_tag ==
"source")
2576 if (accession ==
"MS:1000055")
2580 else if (accession ==
"MS:1000056")
2584 else if (accession ==
"MS:1000057")
2588 else if (accession ==
"MS:1000058")
2592 else if (accession ==
"MS:1000059")
2596 else if (accession ==
"MS:1000060")
2600 else if (accession ==
"MS:1000061")
2604 else if (accession ==
"MS:1000062")
2608 else if (accession ==
"MS:1000063")
2612 else if (accession ==
"MS:1000064")
2616 else if (accession ==
"MS:1000065")
2620 else if (accession ==
"MS:1000066")
2624 else if (accession ==
"MS:1000067")
2628 else if (accession ==
"MS:1000068")
2632 else if (accession ==
"MS:1000069")
2636 else if (accession ==
"MS:1000248")
2640 else if (accession ==
"MS:1000249")
2644 else if (accession ==
"MS:1000396")
2648 else if (accession ==
"MS:1000485")
2653 else if (accession ==
"MS:1000071")
2657 else if (accession ==
"MS:1000073")
2661 else if (accession ==
"MS:1000074")
2665 else if (accession ==
"MS:1000227")
2669 else if (accession ==
"MS:1000240")
2673 else if (accession ==
"MS:1000247")
2677 else if (accession ==
"MS:1000255")
2681 else if (accession ==
"MS:1000258")
2685 else if (accession ==
"MS:1000259")
2689 else if (accession ==
"MS:1000271")
2693 else if (accession ==
"MS:1000272")
2697 else if (accession ==
"MS:1000273")
2701 else if (accession ==
"MS:1000274")
2705 else if (accession ==
"MS:1000276")
2709 else if (accession ==
"MS:1000380")
2713 else if (accession ==
"MS:1000381")
2717 else if (accession ==
"MS:1000383")
2721 else if (accession ==
"MS:1000384")
2725 else if (accession ==
"MS:1000385")
2729 else if (accession ==
"MS:1000386")
2733 else if (accession ==
"MS:1000388")
2737 else if (accession ==
"MS:1000389")
2741 else if (accession ==
"MS:1000395")
2745 else if (accession ==
"MS:1000399")
2749 else if (accession ==
"MS:1000400")
2753 else if (accession ==
"MS:1000402")
2757 else if (accession ==
"MS:1000403")
2761 else if (accession ==
"MS:1000404")
2765 else if (accession ==
"MS:1000406")
2769 else if (accession ==
"MS:1000407")
2773 else if (accession ==
"MS:1000408")
2777 else if (accession ==
"MS:1000446")
2781 else if (accession ==
"MS:1000070")
2785 else if (accession ==
"MS:1000239")
2789 else if (accession ==
"MS:1000382")
2793 else if (accession ==
"MS:1000075")
2797 else if (accession ==
"MS:1000257")
2801 else if (accession ==
"MS:1000387")
2805 else if (accession ==
"MS:1000393")
2809 else if (accession ==
"MS:1000405")
2813 else if (accession ==
"MS:1000397")
2817 else if (accession ==
"MS:1000398")
2821 else if (accession ==
"MS:1000278")
2825 else if (accession ==
"MS:1000279")
2829 else if (accession ==
"MS:1000008")
2834 else if (accession ==
"MS:1000392")
2839 else if (accession ==
"MS:1000486")
2844 else if (accession ==
"MS:1000875")
2849 else if (accession ==
"MS:1000876")
2854 else if (accession ==
"MS:1000877")
2860 else if (accession ==
"MS:1000843")
2865 else if (accession ==
"MS:1000844")
2870 else if (accession ==
"MS:1000845")
2875 else if (accession ==
"MS:1000846")
2880 else if (accession ==
"MS:1000847")
2885 else if (accession ==
"MS:1000848")
2890 else if (accession ==
"MS:1000849")
2896 else if (accession ==
"MS:1000850")
2901 else if (accession ==
"MS:1000851")
2906 else if (accession ==
"MS:1000852")
2911 else if (accession ==
"MS:1000853")
2917 else if (accession ==
"MS:1000834")
2922 else if (accession ==
"MS:1000835")
2928 else if (accession ==
"MS:1000836")
2933 else if (accession ==
"MS:1000837")
2938 else if (accession ==
"MS:1000838")
2943 else if (accession ==
"MS:1000839")
2949 warning(
LOAD,
String(
"Unhandled cvParam '") + accession +
"' in tag '" + parent_tag +
"'.");
2951 else if (parent_tag ==
"analyzer")
2954 if (accession ==
"MS:1000079")
2958 else if (accession ==
"MS:1000080")
2962 else if (accession ==
"MS:1000081")
2966 else if (accession ==
"MS:1000084")
2970 else if (accession ==
"MS:1000254")
2974 else if (accession ==
"MS:1000264")
2978 else if (accession ==
"MS:1000284")
2982 else if (accession ==
"MS:1000288")
2986 else if (accession ==
"MS:1000484")
2990 else if (accession ==
"MS:1000078")
2994 else if (accession ==
"MS:1000082")
2998 else if (accession ==
"MS:1000083")
3002 else if (accession ==
"MS:1000291")
3006 else if (accession ==
"MS:1000443")
3011 else if (accession ==
"MS:1000014")
3015 else if (accession ==
"MS:1000022")
3019 else if (accession ==
"MS:1000024")
3023 else if (accession ==
"MS:1000025")
3027 else if (accession ==
"MS:1000105")
3031 else if (accession ==
"MS:1000106")
3036 warning(
LOAD,
String(
"Unhandled cvParam '") + accession +
"' in tag '" + parent_tag +
"'.");
3038 else if (parent_tag ==
"detector")
3041 if (accession ==
"MS:1000107")
3045 else if (accession ==
"MS:1000110")
3049 else if (accession ==
"MS:1000112")
3053 else if (accession ==
"MS:1000114")
3057 else if (accession ==
"MS:1000115")
3061 else if (accession ==
"MS:1000116")
3065 else if (accession ==
"MS:1000253")
3069 else if (accession ==
"MS:1000345")
3073 else if (accession ==
"MS:1000346")
3077 else if (accession ==
"MS:1000347")
3081 else if (accession ==
"MS:1000348")
3085 else if (accession ==
"MS:1000349")
3089 else if (accession ==
"MS:1000350")
3093 else if (accession ==
"MS:1000351")
3097 else if (accession ==
"MS:1000621")
3101 else if (accession ==
"MS:1000624")
3105 else if (accession ==
"MS:1000108")
3109 else if (accession ==
"MS:1000109")
3113 else if (accession ==
"MS:1000111")
3117 else if (accession ==
"MS:1000113")
3121 else if (accession ==
"MS:1000026")
3126 else if (accession ==
"MS:1000028")
3130 else if (accession ==
"MS:1000029")
3135 else if (accession ==
"MS:1000117")
3139 else if (accession ==
"MS:1000118")
3143 else if (accession ==
"MS:1000119")
3147 else if (accession ==
"MS:1000120")
3152 warning(
LOAD,
String(
"Unhandled cvParam '") + accession +
"' in tag '" + parent_tag +
"'.");
3154 else if (parent_tag ==
"processingMethod")
3157 if (accession ==
"MS:1000629")
3161 else if (accession ==
"MS:1000631")
3165 else if (accession ==
"MS:1000787")
3169 else if (accession ==
"MS:1000788")
3173 else if (accession ==
"MS:1000747")
3178 else if (accession ==
"MS:1000530")
3182 else if (accession ==
"MS:1000544")
3186 else if (accession ==
"MS:1000545")
3190 else if (accession ==
"MS:1000546")
3194 else if (accession ==
"MS:1000741")
3199 else if (accession ==
"MS:1000543")
3203 else if (accession ==
"MS:1000033")
3207 else if (accession ==
"MS:1000034")
3211 else if (accession ==
"MS:1000035" ||
cv_.
isChildOf(accession,
"MS:1000035"))
3215 else if (accession ==
"MS:1000592" ||
cv_.
isChildOf(accession,
"MS:1000592"))
3219 else if (accession ==
"MS:1000778" ||
cv_.
isChildOf(accession,
"MS:1000778"))
3223 else if (accession ==
"MS:1000780" ||
cv_.
isChildOf(accession,
"MS:1000780"))
3227 else if (accession ==
"MS:1000593")
3231 else if (accession ==
"MS:1000745")
3235 else if (accession ==
"MS:1001484")
3239 else if (accession ==
"MS:1001485")
3243 else if (accession ==
"MS:1001486" ||
cv_.
isChildOf(accession,
"MS:1001486"))
3248 warning(
LOAD,
String(
"Unhandled cvParam '") + accession +
"' in tag '" + parent_tag +
"'.");
3250 else if (parent_tag ==
"fileContent")
3263 warning(
LOAD,
String(
"Unhandled cvParam '") + accession +
"' in tag '" + parent_tag +
"'.");
3265 else if (parent_tag ==
"software")
3269 if (accession ==
"MS:1000799")
3280 warning(
LOAD,
String(
"Unhandled cvParam '") + accession +
"' in tag '" + parent_tag +
"'.");
3284 else if (parent_tag ==
"chromatogram")
3286 if (accession ==
"MS:1000810")
3290 else if (accession ==
"MS:1000235")
3294 else if (accession ==
"MS:1000627")
3298 else if (accession ==
"MS:1000628")
3302 else if (accession ==
"MS:1001472")
3306 else if (accession ==
"MS:1001473")
3310 else if (accession ==
"MS:1001474")
3314 else if (accession ==
"MS:1000811")
3318 else if (accession ==
"MS:1000812")
3322 else if (accession ==
"MS:1000813")
3326 else if (accession ==
"MS:1000809")
3331 warning(
LOAD,
String(
"Unhandled cvParam '") + accession +
"' in tag '" + parent_tag +
"'.");
3333 else if (parent_tag ==
"target")
3338 warning(
LOAD,
String(
"Unhandled cvParam '") + accession +
"' in tag '" + parent_tag +
"'.");
3341 template <
typename MapType>
3347 if (type ==
"xsd:double" || type ==
"xsd:float")
3352 else if (type ==
"xsd:byte" || type ==
"xsd:decimal" || type ==
"xsd:int" || type ==
"xsd:integer" || type ==
"xsd:long" || type ==
"xsd:negativeInteger" || type ==
"xsd:nonNegativeInteger" || type ==
"xsd:nonPositiveInteger" || type ==
"xsd:positiveInteger" || type ==
"xsd:short" || type ==
"xsd:unsignedByte" || type ==
"xsd:unsignedInt" || type ==
"xsd:unsignedLong" || type ==
"xsd:unsignedShort")
3363 if (parent_tag ==
"run")
3365 exp_->setMetaValue(name, data_value);
3367 else if (parent_tag ==
"instrumentConfiguration")
3371 else if (parent_tag ==
"source")
3375 else if (parent_tag ==
"analyzer")
3379 else if (parent_tag ==
"detector")
3383 else if (parent_tag ==
"sample")
3387 else if (parent_tag ==
"software")
3391 else if (parent_tag ==
"contact")
3393 exp_->getContacts().back().setMetaValue(name, data_value);
3395 else if (parent_tag ==
"sourceFile")
3399 else if (parent_tag ==
"binaryDataArray")
3401 data_.back().meta.setMetaValue(name, data_value);
3403 else if (parent_tag ==
"spectrum")
3407 else if (parent_tag ==
"chromatogram")
3411 else if (parent_tag ==
"scanList")
3415 else if (parent_tag ==
"scan")
3419 else if (parent_tag ==
"scanWindow")
3423 else if (parent_tag ==
"isolationWindow")
3426 if (parent_parent_tag ==
"precursor")
3437 else if (parent_parent_tag ==
"product")
3449 else if (parent_tag ==
"selectedIon")
3465 else if (parent_tag ==
"activation")
3477 else if (parent_tag ==
"processingMethod")
3481 else if (parent_tag ==
"fileContent")
3486 warning(
LOAD,
String(
"Unhandled userParam '") + name +
"' in tag '" + parent_tag +
"'.");
3489 template <
typename MapType>
3499 return validator.SemanticValidator::locateTerm(path, sc);
3502 template <
typename MapType>
3505 String cvTerm =
"<cvParam cvRef=\"" + c.
id.
prefix(
':') +
"\" accession=\"" + c.
id +
"\" name=\"" + c.
name;
3513 cvTerm +=
"\" unitAccession=\"" + unit.
id +
"\" unitName=\"" + unit.
name +
"\" unitCvRef=\"" + unit.
id.
prefix(2);
3520 template <
typename MapType>
3523 std::vector<String> cvParams;
3524 std::vector<String> userParams;
3526 std::vector<String> keys;
3529 for (std::vector<String>::iterator key = keys.begin(); key != keys.end(); ++key)
3534 if (*key ==
"GO cellular component" || *key ==
"brenda source tissue")
3550 bool writtenAsCVTerm =
false;
3558 writtenAsCVTerm =
true;
3563 if (!writtenAsCVTerm)
3565 String userParam =
"<userParam name=\"" + *key +
"\" type=\"";
3571 userParam +=
"xsd:integer";
3575 userParam +=
"xsd:double";
3579 userParam +=
"xsd:string";
3582 userParams.push_back(userParam);
3588 for (std::vector<String>::iterator term = cvParams.begin(); term != cvParams.end(); ++term)
3590 os <<
String(indent,
'\t') << *term;
3593 for (std::vector<String>::iterator term = userParams.begin(); term != userParams.end(); ++term)
3595 os <<
String(indent,
'\t') << *term;
3599 template <
typename MapType>
3602 std::set<String> terms;
3604 for (std::set<String>::const_iterator it = terms.begin(); it != terms.end(); ++it)
3614 template <
typename MapType>
3617 os <<
"\t\t<software id=\"" <<
id <<
"\" version=\"" << software.
getVersion() <<
"\" >\n";
3619 if (so_term.
id ==
"")
3623 if (so_term.
id ==
"")
3627 if (so_term.
id ==
"MS:1000799")
3629 os <<
"\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000799\" name=\"custom unreleased software tool\" value=\"\" />\n";
3631 else if (so_term.
id !=
"")
3633 os <<
"\t\t\t<cvParam cvRef=\"MS\" accession=\"" << so_term.
id <<
"\" name=\"" <<
writeXMLEscape(so_term.
name) <<
"\" />\n";
3637 os <<
"\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000799\" name=\"custom unreleased software tool\" value=\"" <<
writeXMLEscape(software.
getName()) <<
"\" />\n";
3639 writeUserParam_(os, software, 3,
"/mzML/Software/cvParam/@accession", validator);
3640 os <<
"\t\t</software>\n";
3643 template <
typename MapType>
3650 os <<
"\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000569\" name=\"SHA-1\" value=\"" << source_file.
getChecksum() <<
"\" />\n";
3654 os <<
"\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000568\" name=\"MD5\" value=\"" << source_file.
getChecksum() <<
"\" />\n";
3658 os <<
"\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000569\" name=\"SHA-1\" value=\"\" />\n";
3666 if (ft_term.
id !=
"")
3668 os <<
"\t\t\t\t<cvParam cvRef=\"MS\" accession=\"" << ft_term.
id <<
"\" name=\"" << ft_term.
name <<
"\" />\n";
3672 os <<
"\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000564\" name=\"PSI mzData format\" />\n";
3676 if (id_term.
id !=
"")
3678 os <<
"\t\t\t\t<cvParam cvRef=\"MS\" accession=\"" << id_term.
id <<
"\" name=\"" << id_term.
name <<
"\" />\n";
3682 os <<
"\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000777\" name=\"spectrum identifier nativeID format\" />\n";
3684 writeUserParam_(os, source_file, 4,
"/mzML/fileDescription/sourceFileList/sourceFile/cvParam/@accession", validator);
3685 os <<
"\t\t\t</sourceFile>\n";
3688 template <
typename MapType>
3691 os <<
"\t\t<dataProcessing id=\"" <<
id <<
"\">\n";
3696 os <<
"\t\t\t<processingMethod order=\"0\" softwareRef=\"so_default\">\n";
3697 os <<
"\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000544\" name=\"Conversion to mzML\" />\n";
3698 os <<
"\t\t\t\t<userParam name=\"warning\" type=\"xsd:string\" value=\"fictional processing method used to fulfill format requirements\" />\n";
3699 os <<
"\t\t\t</processingMethod>\n";
3702 bool written =
false;
3703 for (
Size i = 0; i < dps.size(); ++i)
3706 os <<
"\t\t\t<processingMethod order=\"0\" softwareRef=\"so_" <<
id <<
"_pm_" << i <<
"\">\n";
3709 os <<
"\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000543\" name=\"data processing action\" />\n";
3714 os <<
"\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000034\" name=\"charge deconvolution\" />\n";
3719 os <<
"\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000033\" name=\"deisotoping\" />\n";
3724 os <<
"\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000592\" name=\"smoothing\" />\n";
3729 os <<
"\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000778\" name=\"charge state calculation\" />\n";
3734 os <<
"\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000780\" name=\"precursor recalculation\" />\n";
3739 os <<
"\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000593\" name=\"baseline reduction\" />\n";
3744 os <<
"\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000035\" name=\"peak picking\" />\n";
3749 os <<
"\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000745\" name=\"retention time alignment\" />\n";
3754 os <<
"\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1001485\" name=\"m/z calibration\" />\n";
3759 os <<
"\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1001484\" name=\"intensity normalization\" />\n";
3764 os <<
"\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1001486\" name=\"data filtering\" />\n";
3770 os <<
"\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000530\" name=\"file format conversion\" />\n";
3775 os <<
"\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000546\" name=\"Conversion to mzData\" />\n";
3780 os <<
"\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000544\" name=\"Conversion to mzML\" />\n";
3785 os <<
"\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000545\" name=\"Conversion to mzXML\" />\n";
3790 os <<
"\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000741\" name=\"Conversion to dta\" />\n";
3795 os <<
"\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000543\" name=\"data processing action\" />\n";
3799 if (dps[i].getCompletionTime().isValid())
3801 os <<
"\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000747\" name=\"completion time\" value=\"" << dps[i].getCompletionTime().toString(
"yyyy-MM-dd+hh:mm").toStdString() <<
"\" />\n";
3804 writeUserParam_(os, dps[i], 4,
"/mzML/dataProcessingList/dataProcessing/processingMethod/cvParam/@accession", validator);
3805 os <<
"\t\t\t</processingMethod>\n";
3808 os <<
"\t\t</dataProcessing>\n";
3811 template <
typename MapType>
3814 os <<
"\t\t\t\t\t<precursor>\n";
3818 os <<
"\t\t\t\t\t\t<isolationWindow>\n";
3819 os <<
"\t\t\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000827\" name=\"isolation window target m/z\" value=\"" << precursor.
getMZ() <<
"\" unitAccession=\"MS:1000040\" unitName=\"m/z\" unitCvRef=\"MS\" />\n";
3820 os <<
"\t\t\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000828\" name=\"isolation window lower offset\" value=\"" << precursor.
getIsolationWindowLowerOffset() <<
"\" unitAccession=\"MS:1000040\" unitName=\"m/z\" unitCvRef=\"MS\" />\n";
3821 os <<
"\t\t\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000829\" name=\"isolation window upper offset\" value=\"" << precursor.
getIsolationWindowUpperOffset() <<
"\" unitAccession=\"MS:1000040\" unitName=\"m/z\" unitCvRef=\"MS\" />\n";
3822 os <<
"\t\t\t\t\t\t</isolationWindow>\n";
3828 os <<
"\t\t\t\t\t\t<selectedIonList count=\"1\">\n";
3829 os <<
"\t\t\t\t\t\t\t<selectedIon>\n";
3830 os <<
"\t\t\t\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000744\" name=\"selected ion m/z\" value=\"" << precursor.
getMZ() <<
"\" unitAccession=\"MS:1000040\" unitName=\"m/z\" unitCvRef=\"MS\" />\n";
3831 os <<
"\t\t\t\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000041\" name=\"charge state\" value=\"" << precursor.
getCharge() <<
"\" />\n";
3832 os <<
"\t\t\t\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000042\" name=\"peak intensity\" value=\"" << precursor.
getIntensity() <<
"\" unitAccession=\"MS:1000132\" unitName=\"percent of base peak\" unitCvRef=\"MS\" />\n";
3835 os <<
"\t\t\t\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000633\" name=\"possible charge state\" value=\"" << precursor.
getPossibleChargeStates()[j] <<
"\" />\n";
3838 os <<
"\t\t\t\t\t\t\t</selectedIon>\n";
3839 os <<
"\t\t\t\t\t\t</selectedIonList>\n";
3844 os <<
"\t\t\t\t\t\t<activation>\n";
3845 #pragma clang diagnostic push 3846 #pragma clang diagnostic ignored "-Wfloat-equal" 3848 #pragma clang diagnostic pop
3850 os <<
"\t\t\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000509\" name=\"activation energy\" value=\"" << precursor.
getActivationEnergy() <<
"\" unitAccession=\"UO:0000266\" unitName=\"electronvolt\" unitCvRef=\"UO\" />\n";
3854 os <<
"\t\t\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000133\" name=\"collision-induced dissociation\" />\n";
3858 os <<
"\t\t\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000134\" name=\"plasma desorption\" />\n";
3862 os <<
"\t\t\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000135\" name=\"post-source decay\" />\n";
3866 os <<
"\t\t\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000136\" name=\"surface-induced dissociation\" />\n";
3870 os <<
"\t\t\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000242\" name=\"blackbody infrared radiative dissociation\" />\n";
3874 os <<
"\t\t\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000250\" name=\"electron capture dissociation\" />\n";
3878 os <<
"\t\t\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000262\" name=\"infrared multiphoton dissociation\" />\n";
3882 os <<
"\t\t\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000282\" name=\"sustained off-resonance irradiation\" />\n";
3886 os <<
"\t\t\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000422\" name=\"high-energy collision-induced dissociation\" />\n";
3890 os <<
"\t\t\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000433\" name=\"low-energy collision-induced dissociation\" />\n";
3894 os <<
"\t\t\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000435\" name=\"photodissociation\" />\n";
3898 os <<
"\t\t\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000598\" name=\"electron transfer dissociation\" />\n";
3902 os <<
"\t\t\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000599\" name=\"pulsed q dissociation\" />\n";
3906 os <<
"\t\t\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000044\" name=\"dissociation method\" />\n";
3909 writeUserParam_(os, precursor, 6,
"/mzML/run/spectrumList/spectrum/precursorList/precursor/activation/cvParam/@accession", validator);
3910 os <<
"\t\t\t\t\t\t</activation>\n";
3911 os <<
"\t\t\t\t\t</precursor>\n";
3915 template <
typename MapType>
3918 os <<
"\t\t\t\t\t<product>\n";
3919 os <<
"\t\t\t\t\t\t<isolationWindow>\n";
3920 os <<
"\t\t\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000827\" name=\"isolation window target m/z\" value=\"" << product.
getMZ() <<
"\" unitAccession=\"MS:1000040\" unitName=\"m/z\" unitCvRef=\"MS\" />\n";
3921 os <<
"\t\t\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000828\" name=\"isolation window lower offset\" value=\"" << product.
getIsolationWindowLowerOffset() <<
"\" unitAccession=\"MS:1000040\" unitName=\"m/z\" unitCvRef=\"MS\" />\n";
3922 os <<
"\t\t\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000829\" name=\"isolation window upper offset\" value=\"" << product.
getIsolationWindowUpperOffset() <<
"\" unitAccession=\"MS:1000040\" unitName=\"m/z\" unitCvRef=\"MS\" />\n";
3923 writeUserParam_(os, product, 7,
"/mzML/run/spectrumList/spectrum/productList/product/isolationWindow/cvParam/@accession", validator);
3924 os <<
"\t\t\t\t\t\t</isolationWindow>\n";
3925 os <<
"\t\t\t\t\t</product>\n";
3928 template <
typename MapType>
3936 std::vector<std::vector<DataProcessing> > dps;
3945 if (exp.size() != 0)
3951 os <<
"\t\t<spectrumList count=\"" << exp.size() <<
"\" defaultDataProcessingRef=\"dp_sp_0\">\n";
3954 bool renew_native_ids =
false;
3955 for (
Size s = 0; s < exp.size(); ++s)
3957 if (!exp[s].getNativeID().has(
'='))
3959 renew_native_ids =
true;
3964 if (renew_native_ids)
3966 warning(
STORE,
String(
"Invalid native IDs detected. Using spectrum identifier nativeID format (spectrum=xsd:nonNegativeInteger) for all spectra."));
3970 for (
Size s = 0; s < exp.size(); ++s)
3976 os <<
"\t\t</spectrumList>\n";
3982 if (!exp.getChromatograms().empty())
3988 os <<
"\t\t<chromatogramList count=\"" << exp.getChromatograms().size() <<
"\" defaultDataProcessingRef=\"dp_sp_0\">\n";
3989 for (
Size c = 0;
c != exp.getChromatograms().size(); ++
c)
3995 os <<
"\t\t</chromatogramList>" <<
"\n";
4002 template <
typename MapType>
4006 os <<
"<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n";
4010 os <<
"<indexedmzML xmlns=\"http://psi.hupo.org/ms/mzml\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://psi.hupo.org/ms/mzml http://psidev.info/files/ms/mzML/xsd/mzML1.1.0_idx.xsd\">\n";
4012 os <<
"<mzML xmlns=\"http://psi.hupo.org/ms/mzml\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://psi.hupo.org/ms/mzml http://psidev.info/files/ms/mzML/xsd/mzML1.1.0.xsd\" accession=\"" <<
writeXMLEscape(exp.getIdentifier()) <<
"\" version=\"" <<
version_ <<
"\">\n";
4016 os <<
"\t<cvList count=\"5\">\n" 4017 <<
"\t\t<cv id=\"MS\" fullName=\"Proteomics Standards Initiative Mass Spectrometry Ontology\" URI=\"http://psidev.cvs.sourceforge.net/*checkout*/psidev/psi/psi-ms/mzML/controlledVocabulary/psi-ms.obo\"/>\n" 4018 <<
"\t\t<cv id=\"UO\" fullName=\"Unit Ontology\" URI=\"http://obo.cvs.sourceforge.net/obo/obo/ontology/phenotype/unit.obo\"/>\n" 4019 <<
"\t\t<cv id=\"BTO\" fullName=\"BrendaTissue545\" version=\"unknown\" URI=\"http://www.brenda-enzymes.info/ontology/tissue/tree/update/update_files/BrendaTissueOBO\"/>\n" 4020 <<
"\t\t<cv id=\"GO\" fullName=\"Gene Ontology - Slim Versions\" version=\"unknown\" URI=\"http://www.geneontology.org/GO_slims/goslim_goa.obo\"/>\n" 4021 <<
"\t\t<cv id=\"PATO\" fullName=\"Quality ontology\" version=\"unknown\" URI=\"http://obo.cvs.sourceforge.net/*checkout*/obo/obo/ontology/phenotype/quality.obo\"/>\n" 4026 os <<
"\t<fileDescription>\n";
4027 os <<
"\t\t<fileContent>\n";
4029 for (
Size i = 0; i < exp.size(); ++i)
4031 ++file_content[exp[i].getInstrumentSettings().getScanMode()];
4035 os <<
"\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000294\" name=\"mass spectrum\" />\n";
4039 os <<
"\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000579\" name=\"MS1 spectrum\" />\n";
4043 os <<
"\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000580\" name=\"MSn spectrum\" />\n";
4047 os <<
"\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000582\" name=\"SIM spectrum\" />\n";
4051 os <<
"\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000583\" name=\"SRM spectrum\" />\n";
4055 os <<
"\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000581\" name=\"CRM spectrum\" />\n";
4059 os <<
"\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000341\" name=\"precursor ion spectrum\" />\n";
4063 os <<
"\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000325\" name=\"constant neutral gain spectrum\" />\n";
4067 os <<
"\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000326\" name=\"constant neutral loss spectrum\" />\n";
4071 os <<
"\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000804\" name=\"electromagnetic radiation spectrum\" />\n";
4075 os <<
"\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000805\" name=\"emission spectrum\" />\n";
4079 os <<
"\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000806\" name=\"absorption spectrum\" />\n";
4083 os <<
"\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000789\" name=\"enhanced multiply charged spectrum\" />\n";
4087 os <<
"\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000789\" name=\"time-delayed fragmentation spectrum\" />\n";
4091 os <<
"\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000294\" name=\"mass spectrum\" />\n";
4094 os <<
"\t\t</fileContent>\n";
4100 UInt sf_sp_count = 0;
4101 for (
Size i = 0; i < exp.size(); ++i)
4108 if (exp.getSourceFiles().size() > 0 || sf_sp_count > 0)
4110 os <<
"\t\t<sourceFileList count=\"" << exp.getSourceFiles().size() + sf_sp_count <<
"\">\n";
4113 for (
Size i = 0; i < exp.getSourceFiles().size(); ++i)
4119 if (sf_sp_count > 0)
4122 for (
Size i = 0; i < exp.size(); ++i)
4124 if (exp[i].getSourceFile() != sf_default)
4131 os <<
"\t\t</sourceFileList>\n";
4137 for (
Size i = 0; i < exp.getContacts().size(); ++i)
4140 os <<
"\t\t<contact>\n";
4142 os <<
"\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000590\" name=\"contact affiliation\" value=\"" <<
writeXMLEscape(cp.
getInstitution()) <<
"\" />\n";
4146 os <<
"\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000587\" name=\"contact address\" value=\"" <<
writeXMLEscape(cp.
getAddress()) <<
"\" />\n";
4150 os <<
"\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000588\" name=\"contact URL\" value=\"" <<
writeXMLEscape(cp.
getURL()) <<
"\" />\n";
4154 os <<
"\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000589\" name=\"contact email\" value=\"" <<
writeXMLEscape(cp.
getEmail()) <<
"\" />\n";
4160 writeUserParam_(os, cp, 3,
"/mzML/fileDescription/contact/cvParam/@accession", validator);
4161 os <<
"\t\t</contact>\n";
4163 os <<
"\t</fileDescription>\n";
4168 const Sample& sa = exp.getSample();
4169 os <<
"\t<sampleList count=\"1\">\n";
4173 os <<
"\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000001\" name=\"sample number\" value=\"" <<
writeXMLEscape(sa.
getNumber()) <<
"\" />\n";
4175 os <<
"\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000004\" name=\"sample mass\" value=\"" << sa.
getMass() <<
"\" unitAccession=\"UO:0000021\" unitName=\"gram\" unitCvRef=\"UO\" />\n";
4176 os <<
"\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000005\" name=\"sample volume\" value=\"" << sa.
getVolume() <<
"\" unitAccession=\"UO:0000098\" unitName=\"milliliter\" unitCvRef=\"UO\" />\n";
4177 os <<
"\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000006\" name=\"sample concentration\" value=\"" << sa.
getConcentration() <<
"\" unitAccession=\"UO:0000175\" unitName=\"gram per liter\" unitCvRef=\"UO\" />\n";
4180 os <<
"\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000047\" name=\"emulsion\" />\n";
4184 os <<
"\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000048\" name=\"gas\" />\n";
4188 os <<
"\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000049\" name=\"liquid\" />\n";
4192 os <<
"\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000050\" name=\"solid\" />\n";
4196 os <<
"\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000051\" name=\"solution\" />\n";
4200 os <<
"\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000052\" name=\"suspension\" />\n";
4204 os <<
"\t\t\t<userParam name=\"comment\" type=\"xsd:string\" value=\"" <<
writeXMLEscape(sa.
getComment()) <<
"\" />\n";
4206 writeUserParam_(os, sa, 3,
"/mzML/sampleList/sample/cvParam/@accession", validator);
4207 os <<
"\t\t</sample>\n";
4208 os <<
"\t</sampleList>\n";
4215 Size num_software(2);
4216 for (
Size s = 0; s < exp.size(); ++s)
4218 if (find(dps.begin(), dps.end(), exp[s].getDataProcessing()) == dps.end())
4220 dps.push_back(exp[s].getDataProcessing());
4221 num_software += exp[s].getDataProcessing().size();
4224 for (
Size s = 0; s < exp.getChromatograms().size(); ++s)
4226 if (find(dps.begin(), dps.end(), exp.getChromatograms()[s].getDataProcessing()) == dps.end())
4228 dps.push_back(exp.getChromatograms()[s].getDataProcessing());
4229 num_software += exp.getChromatograms()[s].getDataProcessing().size();
4234 Size num_bi_software(0);
4236 for (
Size s = 0; s < exp.size(); ++s)
4238 for (
Size m = 0; m < exp[s].getFloatDataArrays().size(); ++m)
4240 for (
Size i = 0; i < exp[s].getFloatDataArrays()[m].getDataProcessing().size(); ++i)
4247 os <<
"\t<softwareList count=\"" << num_software + num_bi_software <<
"\">\n";
4249 writeSoftware_(os,
"so_in_0", exp.getInstrument().getSoftware(), validator);
4255 for (
Size s1 = 0; s1 != dps.size(); ++s1)
4257 for (
Size s2 = 0; s2 != dps[s1].size(); ++s2)
4259 writeSoftware_(os,
String(
"so_dp_sp_") + s1 +
"_pm_" + s2, dps[s1][s2].getSoftware(), validator);
4264 for (
Size s = 0; s < exp.size(); ++s)
4266 for (
Size m = 0; m < exp[s].getFloatDataArrays().size(); ++m)
4268 for (
Size i = 0; i < exp[s].getFloatDataArrays()[m].getDataProcessing().size(); ++i)
4270 writeSoftware_(os,
String(
"so_dp_sp_") + s +
"_bi_" + m +
"_pm_" + i, exp[s].getFloatDataArrays()[m].getDataProcessing()[i].getSoftware(), validator);
4274 os <<
"\t</softwareList>\n";
4280 os <<
"\t<instrumentConfigurationList count=\"1\">\n";
4281 os <<
"\t\t<instrumentConfiguration id=\"ic_0\">\n";
4283 if (in_term.
id !=
"")
4285 os <<
"\t\t\t<cvParam cvRef=\"MS\" accession=\"" << in_term.
id <<
"\" name=\"" <<
writeXMLEscape(in_term.
name) <<
"\" />\n";
4289 os <<
"\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000031\" name=\"instrument model\" />\n";
4300 os <<
"\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000221\" name=\"magnetic deflection\" />\n";
4304 os <<
"\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000246\" name=\"delayed extraction\" />\n";
4308 os <<
"\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000275\" name=\"collision quadrupole\" />\n";
4312 os <<
"\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000281\" name=\"selected ion flow tube\" />\n";
4316 os <<
"\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000286\" name=\"time lag focusing\" />\n";
4320 os <<
"\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000300\" name=\"reflectron\" />\n";
4324 os <<
"\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000307\" name=\"einzel lens\" />\n";
4328 os <<
"\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000309\" name=\"first stability region\" />\n";
4332 os <<
"\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000310\" name=\"fringing field\" />\n";
4336 os <<
"\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000311\" name=\"kinetic energy analyzer\" />\n";
4340 os <<
"\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000320\" name=\"static field\" />\n";
4343 writeUserParam_(os, in, 3,
"/mzML/instrumentConfigurationList/instrumentConfiguration/cvParam/@accession", validator);
4345 if (component_count != 0)
4347 os <<
"\t\t\t<componentList count=\"" << (std::max)((
Size)3, component_count) <<
"\">\n";
4354 os <<
"\t\t\t\t<source order=\"" << so.
getOrder() <<
"\">\n";
4358 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000055\" name=\"continuous flow fast atom bombardment\" />\n";
4362 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000056\" name=\"direct inlet\" />\n";
4366 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000057\" name=\"electrospray inlet\" />\n";
4370 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000058\" name=\"flow injection analysis\" />\n";
4374 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000059\" name=\"inductively coupled plasma\" />\n";
4378 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000060\" name=\"infusion\" />\n";
4382 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000061\" name=\"jet separator\" />\n";
4386 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000062\" name=\"membrane separator\" />\n";
4390 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000063\" name=\"moving belt\" />\n";
4394 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000064\" name=\"moving wire\" />\n";
4398 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000065\" name=\"open split\" />\n";
4402 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000066\" name=\"particle beam\" />\n";
4406 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000067\" name=\"reservoir\" />\n";
4410 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000068\" name=\"septum\" />\n";
4414 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000069\" name=\"thermospray inlet\" />\n";
4418 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000248\" name=\"direct insertion probe\" />\n";
4422 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000249\" name=\"direct liquid introduction\" />\n";
4426 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000396\" name=\"membrane inlet\" />\n";
4430 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000485\" name=\"nanospray inlet\" />\n";
4435 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000070\" name=\"atmospheric pressure chemical ionization\" />\n";
4439 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000071\" name=\"chemical ionization\" />\n";
4443 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000073\" name=\"electrospray ionization\" />\n";
4447 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000074\" name=\"fast atom bombardment ionization\" />\n";
4451 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000075\" name=\"matrix-assisted laser desorption ionization\" />\n";
4455 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000227\" name=\"multiphoton ionization\" />\n";
4459 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000239\" name=\"atmospheric pressure matrix-assisted laser desorption ionization\" />\n";
4463 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000240\" name=\"atmospheric pressure ionization\" />\n";
4467 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000247\" name=\"desorption ionization\" />\n";
4471 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000255\" name=\"flowing afterglow\" />\n";
4475 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000257\" name=\"field desorption\" />\n";
4479 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000258\" name=\"field ionization\" />\n";
4483 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000259\" name=\"glow discharge ionization\" />\n";
4487 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000271\" name=\"Negative ion chemical ionization\" />\n";
4491 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000272\" name=\"neutralization reionization mass spectrometry\" />\n";
4495 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000273\" name=\"photoionization\" />\n";
4499 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000274\" name=\"pyrolysis mass spectrometry\" />\n";
4503 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000276\" name=\"resonance enhanced multiphoton ionization\" />\n";
4507 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000278\" name=\"surface enhanced laser desorption ionization\" />\n";
4511 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000279\" name=\"surface enhanced neat desorption\" />\n";
4515 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000380\" name=\"adiabatic ionization\" />\n";
4519 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000381\" name=\"associative ionization\" />\n";
4523 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000382\" name=\"atmospheric pressure photoionization\" />\n";
4527 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000383\" name=\"autodetachment\" />\n";
4531 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000384\" name=\"autoionization\" />\n";
4535 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000385\" name=\"charge exchange ionization\" />\n";
4539 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000386\" name=\"chemi-ionization\" />\n";
4543 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000387\" name=\"desorption/ionization on silicon\" />\n";
4547 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000388\" name=\"dissociative ionization\" />\n";
4551 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000389\" name=\"electron ionization\" />\n";
4555 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000393\" name=\"laser desorption ionization\" />\n";
4559 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000395\" name=\"liquid secondary ionization\" />\n";
4563 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000397\" name=\"microelectrospray\" />\n";
4567 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000398\" name=\"nanoelectrospray\" />\n";
4571 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000399\" name=\"penning ionization\" />\n";
4575 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000400\" name=\"plasma desorption ionization\" />\n";
4579 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000402\" name=\"secondary ionization\" />\n";
4583 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000403\" name=\"soft ionization\" />\n";
4587 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000404\" name=\"spark ionization\" />\n";
4591 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000405\" name=\"surface-assisted laser desorption ionization\" />\n";
4595 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000406\" name=\"surface ionization\" />\n";
4599 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000407\" name=\"thermal ionization\" />\n";
4603 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000408\" name=\"vertical ionization\" />\n";
4607 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000446\" name=\"fast ion bombardment\" />\n";
4611 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000008\" name=\"ionization type\" />\n";
4614 writeUserParam_(os, so, 5,
"/mzML/instrumentConfigurationList/instrumentConfiguration/componentList/source/cvParam/@accession", validator);
4615 os <<
"\t\t\t\t</source>\n";
4620 os <<
"\t\t\t\t<source order=\"1234\">\n";
4621 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000446\" name=\"fast ion bombardment\" />\n";
4622 os <<
"\t\t\t\t\t<userParam name=\"warning\" type=\"xsd:string\" value=\"invented ion source, to fulfill mzML schema\" />\n";
4623 os <<
"\t\t\t\t</source>\n";
4631 os <<
"\t\t\t\t<analyzer order=\"" << ma.
getOrder() <<
"\">\n";
4633 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000014\" name=\"accuracy\" value=\"" << ma.
getAccuracy() <<
"\" unitAccession=\"UO:0000169\" unitName=\"parts per million\" unitCvRef=\"UO\" />\n";
4635 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000022\" name=\"TOF Total Path Length\" value=\"" << ma.
getTOFTotalPathLength() <<
"\" unitAccession=\"UO:0000008\" unitName=\"meter\" unitCvRef=\"UO\" />\n";
4636 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000024\" name=\"final MS exponent\" value=\"" << ma.
getFinalMSExponent() <<
"\" />\n";
4637 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000025\" name=\"magnetic field strength\" value=\"" << ma.
getMagneticFieldStrength() <<
"\" unitAccession=\"UO:0000228\" unitName=\"tesla\" unitCvRef=\"UO\" />\n";
4641 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000106\" name=\"reflectron on\" />\n";
4646 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000105\" name=\"reflectron off\" />\n";
4651 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000079\" name=\"fourier transform ion cyclotron resonance mass spectrometer\" />\n";
4655 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000080\" name=\"magnetic sector\" />\n";
4659 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000081\" name=\"quadrupole\" />\n";
4663 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000084\" name=\"time-of-flight\" />\n";
4667 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000254\" name=\"electrostatic energy analyzer\" />\n";
4671 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000264\" name=\"ion trap\" />\n";
4675 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000284\" name=\"stored waveform inverse fourier transform\" />\n";
4679 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000288\" name=\"cyclotron\" />\n";
4683 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000484\" name=\"orbitrap\" />\n";
4687 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000078\" name=\"axial ejection linear ion trap\" />\n";
4691 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000082\" name=\"quadrupole ion trap\" />\n";
4695 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000083\" name=\"radial ejection linear ion trap\" />\n";
4699 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000291\" name=\"linear ion trap\" />\n";
4703 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000443\" name=\"mass analyzer type\" />\n";
4706 writeUserParam_(os, ma, 5,
"/mzML/instrumentConfigurationList/instrumentConfiguration/componentList/analyzer/cvParam/@accession", validator);
4707 os <<
"\t\t\t\t</analyzer>\n";
4712 os <<
"\t\t\t\t<analyzer order=\"1234\">\n";
4713 os <<
"\t\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000288\" name=\"cyclotron\" />\n";
4714 os <<
"\t\t\t\t\t<userParam name=\"warning\" type=\"xsd:string\" value=\"invented mass analyzer, to fulfill mzML schema\" />\n";
4715 os <<
"\t\t\t\t</analyzer>\n";
4723 os <<
"\t\t\t\t<detector order=\"" <<
id.getOrder() <<
"\">\n";
4725 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000028\" name=\"detector resolution\" value=\"" <<
id.getResolution() <<
"\" />\n";
4726 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000029\" name=\"sampling frequency\" value=\"" <<
id.getADCSamplingFrequency() <<
"\" unitAccession=\"UO:0000106\" unitName=\"hertz\" unitCvRef=\"UO\" />\n";
4730 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000117\" name=\"analog-digital converter\" />\n";
4734 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000118\" name=\"pulse counting\" />\n";
4738 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000119\" name=\"time-digital converter\" />\n";
4742 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000120\" name=\"transient recorder\" />\n";
4747 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000107\" name=\"channeltron\" />\n";
4751 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000110\" name=\"daly detector\" />\n";
4755 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000112\" name=\"faraday cup\" />\n";
4759 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000114\" name=\"microchannel plate detector\" />\n";
4763 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000115\" name=\"multi-collector\" />\n";
4767 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000116\" name=\"photomultiplier\" />\n";
4771 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000253\" name=\"electron multiplier\" />\n";
4775 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000345\" name=\"array detector\" />\n";
4779 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000346\" name=\"conversion dynode\" />\n";
4783 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000347\" name=\"dynode\" />\n";
4787 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000348\" name=\"focal plane collector\" />\n";
4791 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000349\" name=\"ion-to-photon detector\" />\n";
4795 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000350\" name=\"point collector\" />\n";
4799 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000351\" name=\"postacceleration detector\" />\n";
4803 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000621\" name=\"photodiode array detector\" />\n";
4807 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000624\" name=\"inductive detector\" />\n";
4811 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000108\" name=\"conversion dynode electron multiplier\" />\n";
4815 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000109\" name=\"conversion dynode photomultiplier\" />\n";
4819 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000111\" name=\"electron multiplier tube\" />\n";
4823 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000113\" name=\"focal plane array\" />\n";
4827 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000026\" name=\"detector type\" />\n";
4830 writeUserParam_(os,
id, 5,
"/mzML/instrumentConfigurationList/instrumentConfiguration/componentList/detector/cvParam/@accession", validator);
4831 os <<
"\t\t\t\t</detector>\n";
4836 os <<
"\t\t\t\t<detector order=\"1234\">\n";
4837 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000107\" name=\"channeltron\" />\n";
4838 os <<
"\t\t\t\t\t<userParam name=\"warning\" type=\"xsd:string\" value=\"invented ion detector, to fulfill mzML schema\" />\n";
4839 os <<
"\t\t\t\t</detector>\n";
4841 os <<
"\t\t\t</componentList>\n";
4843 os <<
"\t\t\t<softwareRef ref=\"so_in_0\" />\n";
4844 os <<
"\t\t</instrumentConfiguration>\n";
4845 os <<
"\t</instrumentConfigurationList>\n";
4853 for (
Size s = 0; s < exp.size(); ++s)
4855 for (
Size m = 0; m < exp[s].getFloatDataArrays().size(); ++m)
4861 os <<
"\t<dataProcessingList count=\"" << (std::max)((
Size)1, dps.size() + num_bi_dps) <<
"\">\n";
4865 std::vector<DataProcessing> dummy;
4869 for (
Size s = 0; s < dps.size(); ++s)
4875 for (
Size s = 0; s < exp.size(); ++s)
4877 for (
Size m = 0; m < exp[s].getFloatDataArrays().size(); ++m)
4883 os <<
"\t</dataProcessingList>\n";
4891 os <<
"\t<run id=\"ru_0\" defaultInstrumentConfigurationRef=\"ic_0\" sampleRef=\"sa_0\"";
4892 if (exp.getDateTime().isValid())
4894 os <<
" startTimeStamp=\"" << exp.getDateTime().get().substitute(
' ',
'T') <<
"\"";
4896 if (exp.getSourceFiles().size() > 0)
4898 os <<
" defaultSourceFileRef=\"sf_ru_0\"";
4903 if (exp.getFractionIdentifier() !=
"")
4905 os <<
"\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000858\" name=\"fraction identifier\" value=\"" << exp.getFractionIdentifier() <<
"\" />\n";
4908 writeUserParam_(os, exp, 2,
"/mzML/run/cvParam/@accession", validator);
4912 template <
typename MapType>
4916 std::vector<std::vector<DataProcessing> >& dps)
4920 if (renew_native_ids)
4922 native_id =
String(
"spectrum=") + s;
4925 long offset = os.tellp();
4929 os <<
"\t\t\t<spectrum id=\"" <<
writeXMLEscape(native_id) <<
"\" index=\"" << s <<
"\" defaultArrayLength=\"" << spec.size() <<
"\"";
4932 os <<
" sourceFileRef=\"sf_sp_" << s <<
"\"";
4938 Size dp_ref_num = s;
4941 for (
Size i = 0; i < dps.size(); ++i)
4950 os <<
" dataProcessingRef=\"dp_sp_" << dp_ref_num <<
"\"";
4957 os <<
"\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000127\" name=\"centroid spectrum\" />\n";
4961 os <<
"\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000128\" name=\"profile spectrum\" />\n";
4965 os <<
"\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000525\" name=\"spectrum representation\" />\n";
4971 os <<
"\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000511\" name=\"ms level\" value=\"" << spec.
getMSLevel() <<
"\" />\n";
4975 os <<
"\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000497\" name=\"zoom scan\" />\n";
4981 os <<
"\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000294\" name=\"mass spectrum\" />\n";
4985 os <<
"\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000579\" name=\"MS1 spectrum\" />\n";
4989 os <<
"\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000580\" name=\"MSn spectrum\" />\n";
4993 os <<
"\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000582\" name=\"SIM spectrum\" />\n";
4997 os <<
"\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000583\" name=\"SRM spectrum\" />\n";
5001 os <<
"\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000581\" name=\"CRM spectrum\" />\n";
5005 os <<
"\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000341\" name=\"precursor ion spectrum\" />\n";
5009 os <<
"\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000325\" name=\"constant neutral gain spectrum\" />\n";
5013 os <<
"\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000326\" name=\"constant neutral loss spectrum\" />\n";
5017 os <<
"\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000804\" name=\"electromagnetic radiation spectrum\" />\n";
5021 os <<
"\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000805\" name=\"emission spectrum\" />\n";
5025 os <<
"\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000806\" name=\"absorption spectrum\" />\n";
5029 os <<
"\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000789\" name=\"enhanced multiply charged spectrum\" />\n";
5033 os <<
"\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000789\" name=\"time-delayed fragmentation spectrum\" />\n";
5037 os <<
"\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000294\" name=\"mass spectrum\" />\n";
5043 os <<
"\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000129\" name=\"negative scan\" />\n";
5047 os <<
"\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000130\" name=\"positive scan\" />\n";
5050 writeUserParam_(os, spec, 4,
"/mzML/run/spectrumList/spectrum/cvParam/@accession", validator);
5056 if (ai_term.id !=
"")
5058 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"" << ai_term.
id <<
"\" name=\"" << ai_term.name <<
"\" />\n";
5062 os <<
"\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000795\" name=\"no combination\" />\n";
5072 os <<
"\t\t\t\t\t<scan ";
5074 os <<
"externalSpectrumID=\"" << ac.
getIdentifier() <<
"\"";
5078 os <<
"\t\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000016\" name=\"scan start time\" value=\"" << spec.
getRT() <<
"\" unitAccession=\"UO:0000010\" unitName=\"second\" unitCvRef=\"UO\" />\n";
5080 writeUserParam_(os, ac, 6,
"/mzML/run/spectrumList/spectrum/scanList/scan/cvParam/@accession", validator);
5087 os <<
"\t\t\t\t\t\t\t<scanWindow>\n";
5088 os <<
"\t\t\t\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000501\" name=\"scan window lower limit\" value=\"" << spec.
getInstrumentSettings().
getScanWindows()[
k].begin <<
"\" unitAccession=\"MS:1000040\" unitName=\"m/z\" unitCvRef=\"MS\" />\n";
5089 os <<
"\t\t\t\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000500\" name=\"scan window upper limit\" value=\"" << spec.
getInstrumentSettings().
getScanWindows()[
k].end <<
"\" unitAccession=\"MS:1000040\" unitName=\"m/z\" unitCvRef=\"MS\" />\n";
5091 os <<
"\t\t\t\t\t\t\t</scanWindow>\n";
5093 os <<
"\t\t\t\t\t\t</scanWindowList>\n";
5095 os <<
"\t\t\t\t\t</scan>\n";
5100 os <<
"\t\t\t\t\t<scan>\n";
5101 os <<
"\t\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000016\" name=\"scan start time\" value=\"" << spec.
getRT() <<
"\" unitAccession=\"UO:0000010\" unitName=\"second\" unitCvRef=\"UO\" />\n";
5108 os <<
"\t\t\t\t\t\t\t<scanWindow>\n";
5109 os <<
"\t\t\t\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000501\" name=\"scan window lower limit\" value=\"" << spec.
getInstrumentSettings().
getScanWindows()[j].begin <<
"\" unitAccession=\"MS:1000040\" unitName=\"m/z\" unitCvRef=\"MS\" />\n";
5110 os <<
"\t\t\t\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000500\" name=\"scan window upper limit\" value=\"" << spec.
getInstrumentSettings().
getScanWindows()[j].end <<
"\" unitAccession=\"MS:1000040\" unitName=\"m/z\" unitCvRef=\"MS\" />\n";
5112 os <<
"\t\t\t\t\t\t\t</scanWindow>\n";
5114 os <<
"\t\t\t\t\t\t</scanWindowList>\n";
5116 os <<
"\t\t\t\t\t</scan>\n";
5118 os <<
"\t\t\t\t</scanList>\n";
5125 os <<
"\t\t\t<precursorList count=\"" << spec.
getPrecursors().size() <<
"\">\n";
5130 os <<
"\t\t\t</precursorList>\n";
5138 os <<
"\t\t\t\t<productList count=\"" << spec.
getProducts().size() <<
"\">\n";
5143 os <<
"\t\t\t\t</productList>\n";
5149 if (spec.size() != 0)
5154 writeContainerData<SpectrumType>(os,
options_, spec,
"mz");
5155 writeContainerData<SpectrumType>(os,
options_, spec,
"intensity");
5159 for (
Size m = 0; m < spec.getFloatDataArrays().size(); ++m)
5161 const typename SpectrumType::FloatDataArray& array = spec.getFloatDataArrays()[m];
5162 std::vector<double> data64_to_encode(array.size());
5163 for (
Size p = 0; p < array.size(); ++p)
5164 data64_to_encode[p] = array[p];
5167 String data_processing_ref_string =
"";
5168 if (array.getDataProcessing().size() != 0)
5170 data_processing_ref_string =
String(
"dataProcessingRef=\"dp_sp_") + s +
"_bi_" + m +
"\"";
5172 os <<
"\t\t\t\t\t<binaryDataArray arrayLength=\"" << array.size() <<
"\" encodedLength=\"" << encoded_string.size() <<
"\" " << data_processing_ref_string <<
">\n";
5173 os <<
"\t\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000523\" name=\"64-bit float\" />\n";
5174 os <<
"\t\t\t\t\t\t" << compression_term <<
"\n";
5176 if (bi_term.
id !=
"")
5178 os <<
"\t\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"" << bi_term.
id <<
"\" name=\"" << bi_term.
name <<
"\" />\n";
5182 os <<
"\t\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000786\" name=\"non-standard data array\" value=\"" << array.getName() <<
"\" />\n";
5184 writeUserParam_(os, array, 6,
"/mzML/run/spectrumList/spectrum/binaryDataArrayList/binaryDataArray/cvParam/@accession", validator);
5185 os <<
"\t\t\t\t\t\t<binary>" << encoded_string <<
"</binary>\n";
5186 os <<
"\t\t\t\t\t</binaryDataArray>\n";
5189 for (
Size m = 0; m < spec.getIntegerDataArrays().size(); ++m)
5191 const typename SpectrumType::IntegerDataArray& array = spec.getIntegerDataArrays()[m];
5192 std::vector<Int64> data64_to_encode(array.size());
5193 for (
Size p = 0; p < array.size(); ++p)
5194 data64_to_encode[p] = array[p];
5196 String data_processing_ref_string =
"";
5197 if (array.getDataProcessing().size() != 0)
5199 data_processing_ref_string =
String(
"dataProcessingRef=\"dp_sp_") + s +
"_bi_" + m +
"\"";
5201 os <<
"\t\t\t\t\t<binaryDataArray arrayLength=\"" << array.size() <<
"\" encodedLength=\"" << encoded_string.size() <<
"\" " << data_processing_ref_string <<
">\n";
5202 os <<
"\t\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000522\" name=\"64-bit integer\" />\n";
5203 os <<
"\t\t\t\t\t\t" << compression_term <<
"\n";
5205 if (bi_term.
id !=
"")
5207 os <<
"\t\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"" << bi_term.
id <<
"\" name=\"" << bi_term.
name <<
"\" />\n";
5211 os <<
"\t\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000786\" name=\"non-standard data array\" value=\"" << array.getName() <<
"\" />\n";
5213 writeUserParam_(os, array, 6,
"/mzML/run/spectrumList/spectrum/binaryDataArrayList/binaryDataArray/cvParam/@accession", validator);
5214 os <<
"\t\t\t\t\t\t<binary>" << encoded_string <<
"</binary>\n";
5215 os <<
"\t\t\t\t\t</binaryDataArray>\n";
5218 for (
Size m = 0; m < spec.getStringDataArrays().size(); ++m)
5220 const typename SpectrumType::StringDataArray& array = spec.getStringDataArrays()[m];
5221 std::vector<String> data_to_encode;
5222 data_to_encode.resize(array.size());
5223 for (
Size p = 0; p < array.size(); ++p)
5224 data_to_encode[p] = array[p];
5226 String data_processing_ref_string =
"";
5227 if (array.getDataProcessing().size() != 0)
5229 data_processing_ref_string =
String(
"dataProcessingRef=\"dp_sp_") + s +
"_bi_" + m +
"\"";
5231 os <<
"\t\t\t\t\t<binaryDataArray arrayLength=\"" << array.size() <<
"\" encodedLength=\"" << encoded_string.size() <<
"\" " << data_processing_ref_string <<
">\n";
5232 os <<
"\t\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1001479\" name=\"null-terminated ASCII string\" />\n";
5233 os <<
"\t\t\t\t\t\t" << compression_term <<
"\n";
5234 os <<
"\t\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000786\" name=\"non-standard data array\" value=\"" << array.getName() <<
"\" />\n";
5235 writeUserParam_(os, array, 6,
"/mzML/run/spectrumList/spectrum/binaryDataArrayList/binaryDataArray/cvParam/@accession", validator);
5236 os <<
"\t\t\t\t\t\t<binary>" << encoded_string <<
"</binary>\n";
5237 os <<
"\t\t\t\t\t</binaryDataArray>\n";
5239 os <<
"\t\t\t\t</binaryDataArrayList>\n";
5242 os <<
"\t\t\t</spectrum>\n";
5245 template <
typename MapType>
5249 long offset = os.tellp();
5254 os <<
" <chromatogram id=\"" <<
writeXMLEscape(chromatogram.
getNativeID()) <<
"\" index=\"" << c <<
"\" defaultArrayLength=\"" << chromatogram.size() <<
"\">" <<
"\n";
5259 os <<
"\t\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000810\" name=\"mass chromatogram\" />\n";
5263 os <<
"\t\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000235\" name=\"total ion current chromatogram\" />\n";
5267 os <<
"\t\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000627\" name=\"selected ion current chromatogram\" />\n";
5271 os <<
"\t\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000628\" name=\"basepeak chromatogram\" />\n";
5275 os <<
"\t\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1001472\" name=\"selected ion monitoring chromatogram\" />\n";
5279 os <<
"\t\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1001473\" name=\"selected reaction monitoring chromatogram\" />\n";
5283 os <<
"\t\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000811\" name=\"electromagnetic radiation chromatogram\" />\n";
5287 os <<
"\t\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000812\" name=\"absorption chromatogram\" />\n";
5291 os <<
"\t\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000813\" name=\"emission chromatogram\" />\n";
5307 writeContainerData<ChromatogramType>(os,
options_, chromatogram,
"time");
5308 writeContainerData<ChromatogramType>(os,
options_, chromatogram,
"intensity");
5312 for (
Size m = 0; m < chromatogram.getFloatDataArrays().size(); ++m)
5314 const typename ChromatogramType::FloatDataArray& array = chromatogram.getFloatDataArrays()[m];
5315 std::vector<double> data64_to_encode(array.size());
5316 for (
Size p = 0; p < array.size(); ++p)
5317 data64_to_encode[p] = array[p];
5320 String data_processing_ref_string =
"";
5321 if (array.getDataProcessing().size() != 0)
5323 data_processing_ref_string =
String(
"dataProcessingRef=\"dp_sp_") + c +
"_bi_" + m +
"\"";
5325 os <<
"\t\t\t\t\t<binaryDataArray arrayLength=\"" << array.size() <<
"\" encodedLength=\"" << encoded_string.size() <<
"\" " << data_processing_ref_string <<
">\n";
5326 os <<
"\t\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000523\" name=\"64-bit float\" />\n";
5327 os <<
"\t\t\t\t\t\t" << compression_term <<
"\n";
5329 if (bi_term.
id !=
"")
5331 os <<
"\t\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"" << bi_term.
id <<
"\" name=\"" << bi_term.
name <<
"\" />\n";
5335 os <<
"\t\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000786\" name=\"non-standard data array\" value=\"" << array.getName() <<
"\" />\n";
5337 writeUserParam_(os, array, 6,
"/mzML/run/chromatogramList/chromatogram/binaryDataArrayList/binaryDataArray/cvParam/@accession", validator);
5338 os <<
"\t\t\t\t\t\t<binary>" << encoded_string <<
"</binary>\n";
5339 os <<
"\t\t\t\t\t</binaryDataArray>\n";
5342 for (
Size m = 0; m < chromatogram.getIntegerDataArrays().size(); ++m)
5344 const typename ChromatogramType::IntegerDataArray& array = chromatogram.getIntegerDataArrays()[m];
5345 std::vector<Int64> data64_to_encode(array.size());
5346 for (
Size p = 0; p < array.size(); ++p)
5347 data64_to_encode[p] = array[p];
5349 String data_processing_ref_string =
"";
5350 if (array.getDataProcessing().size() != 0)
5352 data_processing_ref_string =
String(
"dataProcessingRef=\"dp_sp_") + c +
"_bi_" + m +
"\"";
5354 os <<
"\t\t\t\t\t<binaryDataArray arrayLength=\"" << array.size() <<
"\" encodedLength=\"" << encoded_string.size() <<
"\" " << data_processing_ref_string <<
">\n";
5355 os <<
"\t\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000522\" name=\"64-bit integer\" />\n";
5356 os <<
"\t\t\t\t\t\t" << compression_term <<
"\n";
5358 if (bi_term.
id !=
"")
5360 os <<
"\t\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"" << bi_term.
id <<
"\" name=\"" << bi_term.
name <<
"\" />\n";
5364 os <<
"\t\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000786\" name=\"non-standard data array\" value=\"" << array.getName() <<
"\" />\n";
5366 writeUserParam_(os, array, 6,
"/mzML/run/chromatogramList/chromatogram/binaryDataArrayList/binaryDataArray/cvParam/@accession", validator);
5367 os <<
"\t\t\t\t\t\t<binary>" << encoded_string <<
"</binary>\n";
5368 os <<
"\t\t\t\t\t</binaryDataArray>\n";
5371 for (
Size m = 0; m < chromatogram.getStringDataArrays().size(); ++m)
5373 const typename ChromatogramType::StringDataArray& array = chromatogram.getStringDataArrays()[m];
5374 std::vector<String> data_to_encode;
5375 data_to_encode.resize(array.size());
5376 for (
Size p = 0; p < array.size(); ++p)
5377 data_to_encode[p] = array[p];
5379 String data_processing_ref_string =
"";
5380 if (array.getDataProcessing().size() != 0)
5382 data_processing_ref_string =
String(
"dataProcessingRef=\"dp_sp_") + c +
"_bi_" + m +
"\"";
5384 os <<
"\t\t\t\t\t<binaryDataArray arrayLength=\"" << array.size() <<
"\" encodedLength=\"" << encoded_string.size() <<
"\" " << data_processing_ref_string <<
">\n";
5385 os <<
"\t\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1001479\" name=\"null-terminated ASCII string\" />\n";
5386 os <<
"\t\t\t\t\t\t" << compression_term <<
"\n";
5387 os <<
"\t\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000786\" name=\"non-standard data array\" value=\"" << array.getName() <<
"\" />\n";
5388 writeUserParam_(os, array, 6,
"/mzML/run/chromatogramList/chromatogram/binaryDataArrayList/binaryDataArray/cvParam/@accession", validator);
5389 os <<
"\t\t\t\t\t\t<binary>" << encoded_string <<
"</binary>\n";
5390 os <<
"\t\t\t\t\t</binaryDataArray>\n";
5392 os <<
"\t\t\t\t</binaryDataArrayList>\n";
5393 os <<
"\t\t\t</chromatogram>" <<
"\n";
const String & getPathToFile() const
returns the file path
Deisotoping.
Definition: DataProcessing.h:62
String chop(Size n) const
Returns a substring where n characters were removed from the end of the string.
Continuous flow fast atom bombardment.
Definition: IonSource.h:70
const String & getNativeID() const
returns the native identifier for the spectrum, used by the acquisition software. ...
Description of the applied preprocessing steps.
Definition: DataProcessing.h:51
std::vector< String > open_tags_
Stack of open XML tags.
Definition: XMLHandler.h:200
const String & getCustomizations() const
returns a description of customizations
ChecksumType getChecksumType() const
returns the checksum type
Plasma desorption.
Definition: Precursor.h:68
Class to encode and decode data encoded with MSNumpress.
Definition: MSNumpressCoder.h:53
NumpressCompression np_compression
check error tolerance after encoding, guarantee abs(1.0-(encoded/decoded)) <= this, 0=do not guarantee anything
Definition: MSNumpressCoder.h:69
Definition: ControlledVocabulary.h:67
atmospheric pressure photo ionization
Definition: IonSource.h:100
time lag focusing
Definition: Instrument.h:78
static const VersionDetails EMPTY
Definition: VersionInfo.h:93
PeakFileOptions options_
Options that can be set for loading/storing.
Definition: MzMLHandler.h:902
Description of a MS instrument.
Definition: Instrument.h:64
bool getSkipXMLChecks() const
returns whether to skip some XML checks and be fast instead
bool hasUnit() const
Check if the value has a unit.
Definition: DataValue.h:370
Fourier transform ion cyclotron resonance mass spectrometer.
Definition: MassAnalyzer.h:62
Definition: MzMLHandlerHelper.h:64
bool hasMZRange() const
returns true if an MZ range has been set
Off.
Definition: MassAnalyzer.h:130
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
void populateSpectraWithData()
Populate all spectra on the stack with data from input.
Definition: MzMLHandler.h:322
double getIsolationWindowLowerOffset() const
Returns the lower offset from the target m/z.
const String & getNameOfFile() const
returns the file name
bool getSortChromatogramsByRT() const
gets whether or not peaks in chromatograms should be sorted
desorption ionization
Definition: IonSource.h:109
Photo multiplier.
Definition: IonDetector.h:56
static String getXRefTypeName(XRefType type)
Definition: MzMLHandlerHelper.h:61
autoionization
Definition: IonSource.h:121
Fast ion bombardment.
Definition: IonSource.h:106
String accession
Definition: SemanticValidator.h:75
bool isChildOf(const String &child, const String &parent) const
Returns if child is a child of parent.
Representation of a CV term.
Definition: ControlledVocabulary.h:60
void setIsolationWindowUpperOffset(double bound)
sets the upper offset from the target m/z
std::vector< SpectrumData > spectrum_data_
Vector of spectrum data stored for later parallel processing.
Definition: MzMLHandler.h:949
String writeCV_(const ControlledVocabulary::CVTerm &c, const DataValue &metaValue) const
Helper method to write an CV based on a meta value.
Definition: MzMLHandler.h:3503
dynode
Definition: IonDetector.h:68
A more convenient string class.
Definition: String.h:57
Particle beam.
Definition: IonSource.h:58
Precursor meta information.
Definition: Precursor.h:56
Class to encode and decode Base64.
Definition: Base64.h:64
Electro spray.
Definition: IonSource.h:67
const String & getNumber() const
returns the sample number (default: "")
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) ...
ControlledVocabulary cv_
Controlled vocabulary (psi-ms from OpenMS/share/OpenMS/CV/psi-ms.obo)
Definition: MzMLHandler.h:996
penning ionization
Definition: IonSource.h:126
atmospheric pressure matrix-assisted laser desorption ionization
Definition: IonSource.h:131
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
InletType getInletType() const
returns the inlet type
Multiphoton ionization.
Definition: IonSource.h:108
String version_
Schema version.
Definition: XMLHandler.h:190
Determination of the peak charge.
Definition: DataProcessing.h:64
void setZoomScan(bool zoom_scan)
sets if this scan is a zoom (enhanced resolution) scan
bool hasIntensityRange() const
returns true if an intensity range has been set
Septum.
Definition: IonSource.h:62
IntensityType getIntensity() const
Definition: Peak1D.h:109
Product meta information.
Definition: Product.h:49
void set(UInt month, UInt day, UInt year, UInt hour, UInt minute, UInt second)
sets data from six integers
Peak data (also called centroided data or stick data)
Definition: SpectrumSettings.h:74
Electrostatic energy analyzer.
Definition: MassAnalyzer.h:64
flowing afterglow
Definition: IonSource.h:110
Micro electrospray ionization.
Definition: IonSource.h:103
bool has(const Key &key) const
Test whether the map contains the given key.
Definition: Map.h:109
Moving wire.
Definition: IonSource.h:65
Recalculation of precursor m/z.
Definition: DataProcessing.h:65
Definition: ChromatogramSettings.h:70
Conversion dynode electron multiplier.
Definition: IonDetector.h:59
Definition: ChromatogramSettings.h:69
double getMass() const
returns the mass (in gram) (default: 0.0)
String id
Identifier.
Definition: ControlledVocabulary.h:81
Transient recorder.
Definition: IonDetector.h:88
bool rt_set_
Definition: MzMLHandler.h:993
void setChromatogramType(ChromatogramType type)
sets the chromatogram type
void writeDataProcessing_(std::ostream &os, const String &id, const std::vector< DataProcessing > &dps, Internal::MzMLValidator &validator)
Helper method that writes a data processing list.
Definition: MzMLHandler.h:3689
Time-digital converter.
Definition: IonDetector.h:87
const DRange< 1 > & getIntensityRange() const
returns the intensity range
High-energy collision-induced dissociation.
Definition: Precursor.h:74
Data filtering or extraction.
Definition: DataProcessing.h:71
const String & getNativeIDType() const
Returns the native ID type of the spectra.
General data processing (if no other term applies)
Definition: DataProcessing.h:60
bool hasSuffix(const String &string) const
true if String ends with string, false otherwise
static const DataValue EMPTY
Empty data value for comparisons.
Definition: DataValue.h:63
Data necessary to generate a single spectrum.
Definition: MzMLHandler.h:940
Conversion to DTA format.
Definition: DataProcessing.h:79
Semantically validates MzXML files.
Definition: MzMLValidator.h:52
channeltron
Definition: IonDetector.h:63
Negative polarity.
Definition: IonSource.h:144
integer value
Definition: DataValue.h:69
bool hasMSLevels() const
returns true, if MS levels have been set
void setProduct(const Product &product)
sets the products
virtual void startElement(const XMLCh *const , const XMLCh *const , const XMLCh *const qname, const xercesc::Attributes &attributes)
Parsing method for opening tags.
Definition: MzMLHandler.h:1079
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.
SpectrumType spec_
The current spectrum.
Definition: MzMLHandler.h:907
Conversion to mzXML format.
Definition: DataProcessing.h:78
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
const AcquisitionInfo & getAcquisitionInfo() const
returns a const reference to the acquisition info
Enhanced multiply charged scan.
Definition: InstrumentSettings.h:65
CoordinateType getMZ() const
Non-mutable access to m/z.
Definition: Peak1D.h:114
microchannel plate detector
Definition: IonDetector.h:65
electron multiplier tube
Definition: IonDetector.h:75
fast atom bombardment
Definition: IonSource.h:86
bool hasRTRange() const
returns true if an RT range has been set
Focal plane array.
Definition: IonDetector.h:57
void setScanMode(ScanMode scan_mode)
sets the scan mode
IonizationMethod getIonizationMethod() const
returns the ionization method
Positive polarity.
Definition: IonSource.h:143
surface-assisted laser desorption ionization
Definition: IonSource.h:133
std::vector< BinaryData > data
Definition: MzMLHandler.h:960
void setIsolationWindowLowerOffset(double bound)
sets the lower offset from the target m/z
AnalyzerType getType() const
returns the analyzer type
IonOpticsType getIonOptics() const
returns the ion optics type
const StringDataArrays & getStringDataArrays() const
Returns a const reference to the string meta data arrays.
Definition: MSChromatogram.h:262
Membrane inlet.
Definition: IonSource.h:72
Int getCharge() const
Non-mutable access to the charge.
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
void populateSpectraWithData_(std::vector< MzMLHandlerHelper::BinaryData > &input_data, Size &default_arr_length, const PeakFileOptions &peak_file_options, SpectrumType &spectrum)
Fill a single spectrum with data from input.
Definition: MzMLHandler.h:495
void setPolarity(IonSource::Polarity polarity)
sets the polarity
bool getSortSpectraByMZ() const
gets whether or not peaks in spectra should be sorted
bool getIntensity32Bit() const
ptrdiff_t SignedSize
Signed Size type e.g. used as pointer difference.
Definition: Types.h:128
Jet separator.
Definition: IonSource.h:61
Baseline reduction.
Definition: DataProcessing.h:66
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
Raw data (also called profile data)
Definition: SpectrumSettings.h:75
double getAccuracy() const
returns the mass accuracy i.e. how much the theoretical mass may differ from the measured mass (in pp...
flame ionization
Definition: IonSource.h:90
Binary data representation.
Definition: MzMLHandlerHelper.h:58
Int attributeAsInt_(const xercesc::Attributes &a, const char *name) const
Converts an attribute to a Int.
Definition: XMLHandler.h:374
focal plane collector
Definition: IonDetector.h:69
Little endian type.
Definition: Base64.h:79
Multi-collector.
Definition: IonDetector.h:61
void addSpectrumMetaData_(const std::vector< MzMLHandlerHelper::BinaryData > &input_data, const Size n, SpectrumType &spectrum) const
Definition: MzMLHandler.h:441
Quadrupole ion trap / Paul ion trap.
Definition: MassAnalyzer.h:57
void setMZ(double mz)
sets the target m/z
bool containsMSLevel(int level) const
returns true, if MS level level has been set
void setSourceFile(const SourceFile &source_file)
sets the source file
pyrolysis mass spectrometry
Definition: IonSource.h:116
ion-to-photon detector
Definition: IonDetector.h:70
photoionization
Definition: IonSource.h:115
Description of the software used for processing.
Definition: Software.h:49
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
bool getCompression() const
MS2+ mass spectrum, is a "mass spectrum".
Definition: InstrumentSettings.h:58
const IntegerDataArrays & getIntegerDataArrays() const
Returns a const reference to the integer meta data arrays.
Definition: MSSpectrum.h:322
static String find(const String &filename, StringList directories=StringList())
Looks up the location of the file filename.
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
std::vector< std::pair< std::string, long > > spectra_offsets
Definition: MzMLHandler.h:971
const String & getUnit() const
Return the unit associated to this DataValue.
chemi-ionization
Definition: IonSource.h:123
MzMLHandler(const MapType &exp, const String &filename, const String &version, const ProgressLogger &logger)
Constructor for a write-only handler.
Definition: MzMLHandler.h:153
Definition: ControlledVocabulary.h:73
collision quadrupole
Definition: Instrument.h:76
ChromatogramType chromatogram_
The current chromatogram.
Definition: MzMLHandler.h:909
Unknown spectrum type.
Definition: SpectrumSettings.h:73
Definition: ChromatogramSettings.h:72
void writeContainerData(std::ostream &os, const PeakFileOptions &pf_options_, const ContainerT &container, String array_type)
Definition: MzMLHandler.h:270
Faraday cup.
Definition: IonDetector.h:58
void setName(const String &name)
Sets the name.
Definition: MSChromatogram.h:223
Selected reaction monitoring scan Synonyms: 'Multiple reaction monitoring scan', 'SRM scan', 'MRM scan'.
Definition: InstrumentSettings.h:60
void populateChromatogramsWithData()
Populate all chromatograms on the stack with data from input.
Definition: MzMLHandler.h:387
Surface-induced dissociation.
Definition: Precursor.h:69
bool obsolete
Flag that indicates of the term is obsolete.
Definition: ControlledVocabulary.h:84
Configuration class for MSNumpress.
Definition: MSNumpressCoder.h:65
Blackbody infrared radiative dissociation.
Definition: Precursor.h:70
Inductively coupled plasma.
Definition: IonSource.h:71
static String writeXMLEscape(const String &to_escape)
Escapes a string and returns the escaped string.
Definition: XMLHandler.h:169
Int getOrder() const
returns the position of this part in the whole Instrument.
Map< String, SourceFile > source_files_
The source files: id => SourceFile.
Definition: MzMLHandler.h:921
Definition: ControlledVocabulary.h:65
autodetachment
Definition: IonSource.h:120
const ProgressLogger & logger_
Progress logger.
Definition: MzMLHandler.h:979
Map< String, Software > software_
The software list: id => Software.
Definition: MzMLHandler.h:925
double getActivationEnergy() const
returns the activation energy (in electronvolt)
#define LOG_ERROR
Macro to be used if non-fatal error are reported (processing continues)
Definition: LogStream.h:447
void writeHeader_(std::ostream &os, const MapType &exp, std::vector< std::vector< DataProcessing > > &dps, Internal::MzMLValidator &validator)
Definition: MzMLHandler.h:4003
SpectrumType getType() const
returns the spectrum type
adiabatic ionization
Definition: IonSource.h:118
const std::vector< DataProcessing > & getDataProcessing() const
returns a const reference to the description of the applied processing
const String & getIdentifier() const
return the identifier/index/number of the acquisition
double toDouble() const
Conversion to double.
Class to hold strings, numeric values, lists of strings and lists of numeric values.
Definition: DataValue.h:57
secondary ion MS
Definition: IonSource.h:92
atmospheric pressure chemical ionization
Definition: IonSource.h:99
double getIsolationWindowUpperOffset() const
Returns the upper offset from the target m/z.
Definition: ControlledVocabulary.h:70
Time-of-flight.
Definition: MassAnalyzer.h:60
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
Unknown.
Definition: MassAnalyzer.h:55
double getTOFTotalPathLength() const
returns the path length for a TOF mass analyzer (in meter)
magnetic deflection
Definition: Instrument.h:74
const std::set< ActivationMethod > & getActivationMethods() const
returns a const reference to the activation methods
double getMZ() const
returns the target m/z
virtual void endElement(const XMLCh *const , const XMLCh *const , const XMLCh *const qname)
Parsing method for closing tags.
Definition: MzMLHandler.h:1499
Surface enhanced laser desorption ionization.
Definition: IonSource.h:104
String unit_accession
Definition: SemanticValidator.h:79
Cyclotron.
Definition: MassAnalyzer.h:67
MSExperiment< Peak1D > MapType
Definition: PeakPickerIterative.cpp:87
Representation of a controlled vocabulary.
Definition: ControlledVocabulary.h:54
double getMagneticFieldStrength() const
returns the strength of the magnetic field (in T)
Size default_array_length
Definition: MzMLHandler.h:943
Size default_array_length_
The default number of peaks in the current spectrum.
Definition: MzMLHandler.h:913
Data necessary to generate a single chromatogram.
Definition: MzMLHandler.h:958
Pulse counting.
Definition: IonDetector.h:85
Definition: ControlledVocabulary.h:71
point collector
Definition: IonDetector.h:71
negative ion chemical ionization
Definition: IonSource.h:113
Definition: ChromatogramSettings.h:76
void encodeIntegers(std::vector< FromType > &in, ByteOrder to_byte_order, String &out, bool zlib_compression=false)
Encodes a vector of integer point numbers to a Base64 string.
Definition: Base64.h:558
void setIsolationWindowLowerOffset(double bound)
sets the lower offset from the target m/z
SpectrumType spectrum
Definition: MzMLHandler.h:944
void load(const String &filename, CVMappings &cv_mappings, bool strip_namespaces=false)
loads CvMappings from the given file
Definition: ChromatogramSettings.h:71
XML handler for MzMLFile.
Definition: MzMLHandler.h:108
Electron transfer dissociation.
Definition: Precursor.h:77
void loadFromOBO(const String &name, const String &filename)
Loads the CV from an OBO file.
void writeSourceFile_(std::ostream &os, const String &id, const SourceFile &software, Internal::MzMLValidator &validator)
Helper method that writes a source file.
Definition: MzMLHandler.h:3644
Definition: ChromatogramSettings.h:75
Int toInt() const
Conversion to int.
Infusion.
Definition: IonSource.h:69
spark ionization
Definition: IonSource.h:128
Surface enhanced neat desorption.
Definition: IonSource.h:105
bool has_unit_accession
Definition: SemanticValidator.h:80
const Precursor & getPrecursor() const
returns a const reference to the precursors
Collision-induced dissociation.
Definition: Precursor.h:66
delayed extraction
Definition: Instrument.h:75
const std::vector< ScanWindow > & getScanWindows() const
returns a const reference to the m/z scan windows
const SourceFile & getSourceFile() const
returns a const reference to the source file
Representation of a parsed CV term.
Definition: SemanticValidator.h:73
Chromatography (liquid)
Definition: IonSource.h:57
MapType * exp_
map pointer for reading
Definition: MzMLHandler.h:897
bool skip_spectrum_
Definition: MzMLHandler.h:990
void endProgress() const
Ends the progress display.
Pulsed q dissociation.
Definition: Precursor.h:78
Map< String, std::vector< DataProcessing > > processing_
The data processing list: id => Instrument.
Definition: MzMLHandler.h:929
electron ionization
Definition: IonSource.h:84
Linear ion trap.
Definition: MassAnalyzer.h:69
Base64 decoder_
Decoder/Encoder for Base64-data in MzML.
Definition: MzMLHandler.h:976
Reservoir.
Definition: IonSource.h:63
DataType valueType() const
returns the type of value stored
Definition: DataValue.h:351
first stability region
Definition: Instrument.h:81
const DRange< 1 > & getRTRange() const
returns the RT range
Map< String, Sample > samples_
The sample list: id => Sample.
Definition: MzMLHandler.h:923
double getIsolationWindowLowerOffset() const
returns the lower offset from the target m/z
MapType::ChromatogramPeakType ChromatogramPeakType
Chromatogram peak type.
Definition: MzMLHandler.h:255
bool getSizeOnly() const
returns whether or not to load only meta data
void setActivationEnergy(double activation_energy)
sets the activation energy (in electronvolt)
Electromagnetic radiation scan Synonyms: 'EMR spectrum'.
Definition: InstrumentSettings.h:67
void writeBinaryDataArray(std::ostream &os, const PeakFileOptions &pf_options_, std::vector< DataType > data_to_encode, bool is32bit, String array_type)
Definition: MzMLHandler.h:821
fringing field
Definition: Instrument.h:82
String default_processing_
id of the default data processing (used when no processing is defined)
Definition: MzMLHandler.h:931
PeakFileOptions & getOptions()
Get the peak file options.
Definition: MzMLHandler.h:230
thermal ionization
Definition: IonSource.h:93
Storing a file.
Definition: XMLHandler.h:119
Orbitrap.
Definition: MassAnalyzer.h:68
postacceleration detector
Definition: IonDetector.h:72
Stored waveform inverse fourier transform.
Definition: MassAnalyzer.h:66
Calibration of m/z positions.
Definition: DataProcessing.h:69
Moving belt.
Definition: IonSource.h:64
resonance enhanced multiphoton ionization
Definition: IonSource.h:117
String & trim()
removes whitespaces (space, tab, line feed, carriage return) at the beginning and the end of the stri...
Interfaces::IMSDataConsumer< MapType > * consumer_
Consumer class to work on spectra.
Definition: MzMLHandler.h:982
reflectron
Definition: Instrument.h:79
void setSoftware(const Software &software)
sets the software used for processing
Definition: ControlledVocabulary.h:68
XMLCh * convert(const char *str) const
Transcode the supplied C string to XMLCh* and take ownership of the XMLCh*.
conversion dynode
Definition: IonDetector.h:67
CVMappings mapping_
Definition: MzMLHandler.h:997
A 1-dimensional raw data point or peak.
Definition: Peak1D.h:55
soft ionization
Definition: IonSource.h:127
Scan window description.
Definition: ScanWindow.h:47
double value
Definition: DataValue.h:70
plasma desorption
Definition: IonSource.h:91
double getRT() const
Definition: MSSpectrum.h:243
static void writeFooter_(std::ostream &os, const PeakFileOptions &options_, std::vector< std::pair< std::string, long > > &spectra_offsets, std::vector< std::pair< std::string, long > > &chromatograms_offsets)
Write the mzML footer the appropriate compression term given the PeakFileOptions and the NumpressConf...
Photodissociation.
Definition: Precursor.h:76
Unknown.
Definition: IonDetector.h:54
On.
Definition: MassAnalyzer.h:129
void setMSLevel(UInt ms_level)
Sets the MS level.
Definition: MSSpectrum.h:265
ReflectronState getReflectronState() const
returns the reflectron state (for TOF)
Analog-digital converter.
Definition: IonDetector.h:86
static void computeDataProperties_(std::vector< BinaryData > &data_, bool &precision_64, SignedSize &index, String index_name)
XRefType xref_type
xref value-type for the CV-term
Definition: ControlledVocabulary.h:88
void setNativeID(const String &native_id)
sets the native identifier for the spectrum, used by the acquisition software.
Meta information about the sample.
Definition: Sample.h:60
Conversion to mzML format.
Definition: DataProcessing.h:77
Definition: ControlledVocabulary.h:75
MSChromatogram< ChromatogramPeakType > ChromatogramType
Spectrum type.
Definition: MzMLHandler.h:259
neutralization reionization mass spectrometry
Definition: IonSource.h:114
full scan mass spectrum, is a "mass spectrum" Synonyms: 'full spectrum', 'Q1 spectrum', 'Q3 spectrum', 'Single-Stage Mass Spectrometry'
Definition: InstrumentSettings.h:57
void setIsolationWindowUpperOffset(double bound)
sets the upper offset from the target m/z
inductive detector
Definition: IonDetector.h:74
MSSpectrum< PeakType > SpectrumType
Spectrum type.
Definition: MzMLHandler.h:257
electrospray ionisation
Definition: IonSource.h:83
String file_
File name.
Definition: XMLHandler.h:187
std::vector< BinaryData > data_
The spectrum data (or chromatogram data)
Definition: MzMLHandler.h:911
Normalization of intensity values.
Definition: DataProcessing.h:70
Description of a ion detector (part of a MS Instrument)
Definition: IonDetector.h:47
String name
Definition: SemanticValidator.h:76
double getIsolationWindowUpperOffset() const
returns the upper offset from the target m/z
Definition: ChromatogramSettings.h:77
Information about one raw data spectrum that was combined with several other raw data spectra...
Definition: Acquisition.h:50
Low-energy collision-induced dissociation.
Definition: Precursor.h:75
Emission scan.
Definition: InstrumentSettings.h:68
String name
Text name.
Definition: ControlledVocabulary.h:80
virtual void writeTo(std::ostream &os)
Writes the contents to a stream.
Definition: MzMLHandler.h:3929
vertical ionization
Definition: IonSource.h:130
surface ionization
Definition: IonSource.h:129
Definition: VersionInfo.h:63
void populateChromatogramsWithData_(std::vector< MzMLHandlerHelper::BinaryData > &input_data, Size &default_arr_length, const PeakFileOptions &peak_file_options, ChromatogramType &inp_chromatogram)
Fill a single chromatogram with data from input.
Definition: MzMLHandler.h:671
bool exists(const String &id) const
Returns true if the term is in the CV. Returns false otherwise.
char * attributeAsString_(const xercesc::Attributes &a, const char *name) const
Converts an attribute to a String.
Definition: XMLHandler.h:366
static String getCompressionTerm_(const PeakFileOptions &opt, MSNumpressCoder::NumpressConfig np_compression, bool use_numpress=false)
Returns the appropriate compression term given the PeakFileOptions and the NumpressConfig.
Nano electrospray ionization.
Definition: IonSource.h:102
const String & getName() const
returns the name of the software
Batch (e.g. in MALDI)
Definition: IonSource.h:56
dissociative ionization
Definition: IonSource.h:124
Selected ion monitoring scan Synonyms: 'Multiple ion monitoring scan', 'SIM scan', 'MIM scan'.
Definition: InstrumentSettings.h:59
Constant neutral loss scan Synonyms: 'CNG scan'.
Definition: InstrumentSettings.h:63
void setUnit(const String &unit)
Sets the unit to the given String.
ChromatogramType getChromatogramType() const
returns the chromatogram type, e.g. a SRM chromatogram
MSNumpressCoder::NumpressConfig getNumpressConfigurationMassTime() const
Set numpress configuration options for m/z or rt dimension.
void writePrecursor_(std::ostream &os, const Precursor &precursor, Internal::MzMLValidator &validator)
Helper method that write precursor information from spectra and chromatograms.
Definition: MzMLHandler.h:3812
const Product & getProduct() const
returns a const reference to the products
Time-delayed fragmentation scan.
Definition: InstrumentSettings.h:66
field desorption
Definition: IonSource.h:89
Invalid conversion exception.
Definition: Exception.h:363
void fatalError(const xercesc::SAXParseException &exception)
Retention time alignment of different maps.
Definition: DataProcessing.h:68
bool isEmpty() const
test if the value is empty
Definition: DataValue.h:360
void setRT(double rt)
Sets the absolute retention time (is seconds)
Definition: MSSpectrum.h:249
Loading a file.
Definition: XMLHandler.h:118
const String & getComment() const
returns the comment (default: "")
MSNumpressCoder::NumpressConfig getNumpressConfigurationIntensity() const
Set numpress configuration options for intensity dimension.
Definition: MzMLHandlerHelper.h:64
bool in_spectrum_list_
Flag that indicates that we're inside a spectrum (in contrast to a chromatogram)
Definition: MzMLHandler.h:915
PeakType PeakType
Peak type.
Definition: MSSpectrum.h:105
const String & getFileType() const
returns the file type
const CVTerm & getTermByName(const String &name, const String &desc="") const
Returns a term specified by name.
Nanospray inlet.
Definition: IonSource.h:73
Invalid value exception.
Definition: Exception.h:336
daly detector
Definition: IonDetector.h:64
bool hasTermWithName(const String &name) const
Returns true if a term with the given name is in the CV. Returns false otherwise. ...
glow discharge ionization
Definition: IonSource.h:112
Conversion dynode photo multiplier.
Definition: IonDetector.h:60
bool getFillData() const
returns whether to fill the actual data into the container (spectrum/chromatogram) ...
void setSourceFile(const SourceFile &source_file)
sets the source file
StringManager sm_
Helper class for string conversion.
Definition: XMLHandler.h:193
void getCounts(Size &spectra_counts, Size &chromatogram_counts)
Get the spectra and chromatogram counts of a file.
Definition: MzMLHandler.h:238
Radial ejection linear ion trap.
Definition: MassAnalyzer.h:58
selected ion flow tube
Definition: Instrument.h:77
std::vector< ChromatogramData > chromatogram_data_
Vector of chromatogram data stored for later parallel processing.
Definition: MzMLHandler.h:966
Definition: ChromatogramSettings.h:74
Secure Hash Algorithm-1.
Definition: SourceFile.h:55
void encodeStrings(const std::vector< String > &in, String &out, bool zlib_compression=false, bool append_null_byte=true)
Encodes a vector of strings to a Base64 string.
Consecutive reaction monitoring scan Synonyms: 'CRM scan'.
Definition: InstrumentSettings.h:61
const IntegerDataArrays & getIntegerDataArrays() const
Returns a const reference to the integer meta data arrays.
Definition: MSChromatogram.h:274
void setType(SpectrumType type)
sets the spectrum type
Thermo spray.
Definition: IonSource.h:68
const StringDataArrays & getStringDataArrays() const
Returns a const reference to the string meta data arrays.
Definition: MSSpectrum.h:310
charge exchange ionization
Definition: IonSource.h:122
UInt scan_count
Counting spectra and chromatograms.
Definition: MzMLHandler.h:985
String value
Definition: SemanticValidator.h:77
void setMethodOfCombination(const String &method_of_combination)
sets the method of combination
Magnetic sector.
Definition: MassAnalyzer.h:61
Ion trap.
Definition: MassAnalyzer.h:65
Infrared multiphoton dissociation.
Definition: Precursor.h:72
Smoothing of the signal to reduce noise.
Definition: DataProcessing.h:63
const String & getVersion() const
returns the software version
IonSource::Polarity getPolarity() const
returns the polarity
bool skip_chromatogram_
Flag that indicates whether this spectrum should be skipped (due to options)
Definition: MzMLHandler.h:989
General file format conversion (if no other term applies)
Definition: DataProcessing.h:75
static VersionDetails create(const String &version)
parse String and return as proper struct
const String & getMethodOfCombination() const
returns the method of combination
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
void setDataProcessing(const std::vector< DataProcessing > &data_processing)
sets the description of the applied processing
String prefix(SizeType length) const
returns the prefix of length length
static void decodeBase64Arrays(std::vector< BinaryData > &data_, bool skipXMLCheck=false)
const String & getChecksum() const
returns the file's checksum
Absorbtion scan.
Definition: InstrumentSettings.h:69
void setDataProcessing(const std::vector< DataProcessing > &data_processing)
sets the description of the applied processing
void writeSoftware_(std::ostream &os, const String &id, const Software &software, Internal::MzMLValidator &validator)
Helper method that writes a software.
Definition: MzMLHandler.h:3615
DateTime Class.
Definition: DateTime.h:55
OPENMS_INT64_TYPE Int64
Signed integer type (64bit)
Definition: Types.h:64
Base class for all classes that want to report their progress.
Definition: ProgressLogger.h:55
UInt selected_ion_count_
Count of selected ions.
Definition: MzMLHandler.h:1001
const std::vector< Product > & getProducts() const
returns a const reference to the products
const String & getName() const
returns the name of the instrument
void startProgress(SignedSize begin, SignedSize end, const String &label) const
Initializes the progress display.
Int getFinalMSExponent() const
returns the final MS exponent
ControlledVocabulary::CVTerm getChildWithName_(const String &parent_accession, const String &name) const
Looks up a child CV term of parent_accession with the name name. If no such term is found...
Definition: MzMLHandler.h:3600
void setIdentifier(const String &identifier)
sets the index/number of the scan
Post-source decay.
Definition: Precursor.h:67
MapType::PeakType PeakType
Peak type.
Definition: MzMLHandler.h:253
void getAllChildTerms(std::set< String > &terms, const String &parent) const
Writes all child terms recursively into terms.
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
void setOptions(const PeakFileOptions &opt)
Set the peak file options.
Definition: MzMLHandler.h:222
Definition: MSNumpressCoder.h:58
field ionization
Definition: IonSource.h:111
Membrane separator.
Definition: IonSource.h:59
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 writeUserParam_(std::ostream &os, const MetaInfoInterface &meta, UInt indent, String path, Internal::MzMLValidator &validator) const
Writes user terms.
Definition: MzMLHandler.h:3521
void encodeNP(const std::vector< double > &in, String &result, bool zlib_compression, const NumpressConfig &config)
Encodes a vector of floating point numbers into a Base64 string using numpress.
Definition: MSNumpressCoder.h:106
std::vector< Int > & getPossibleChargeStates()
Mutable access to possible charge states.
static bool handleBinaryDataArrayCVParam(std::vector< BinaryData > &data_, const String &accession, const String &value, const String &name)
Peak picking (conversion from raw to peak data)
Definition: DataProcessing.h:67
void writeSpectrum_(std::ostream &os, const SpectrumType &spec, Size s, Internal::MzMLValidator &validator, bool renew_native_ids, std::vector< std::vector< DataProcessing > > &dps)
Definition: MzMLHandler.h:4913
bool has_unit_name
Definition: SemanticValidator.h:82
Precursor ion scan.
Definition: InstrumentSettings.h:64
void fillChromatogramData_()
Fills the current chromatogram with data points and meta data.
void setCharge(Int charge)
Mutable access to the charge.
void setNativeID(const String &native_id)
sets the native identifier for the spectrum, used by the acquisition software.
Size getMaxDataPoolSize() const
Get maximal size of the data pool.
MzMLHandler(MapType &exp, const String &filename, const String &version, ProgressLogger &logger)
Constructor for a read-only handler.
Definition: MzMLHandler.h:116
A 1-dimensional raw data point or peak for chromatograms.
Definition: ChromatogramPeak.h:55
Axial ejection linear ion trap.
Definition: MassAnalyzer.h:59
general spectrum type
Definition: InstrumentSettings.h:56
const DRange< 1 > & getMZRange() const
returns the MZ range
std::vector< std::pair< std::string, long > > chromatograms_offsets
Definition: MzMLHandler.h:972
void handleUserParam_(const String &parent_parent_tag, const String &parent_tag, const String &name, const String &type, const String &value)
Handles user terms.
Definition: MzMLHandler.h:3342
MzMLHandlerHelper::BinaryData BinaryData
Definition: MzMLHandler.h:261
associative ionization
Definition: IonSource.h:119
Message-Digest algorithm 5.
Definition: SourceFile.h:56
void writeProduct_(std::ostream &os, const Product &product, Internal::MzMLValidator &validator)
Helper method that write precursor information from spectra and chromatograms.
Definition: MzMLHandler.h:3916
Map< String, Instrument > instruments_
The data processing list: id => Instrument.
Definition: MzMLHandler.h:927
const FloatDataArrays & getFloatDataArrays() const
Definition: MSChromatogram.h:250
String current_id_
Id of the current list. Used for referencing param group, source file, sample, software, ...
Definition: MzMLHandler.h:917
std::vector< BinaryData > data
Definition: MzMLHandler.h:942
Definition: ChromatogramSettings.h:73
const std::vector< Precursor > & getPrecursors() const
returns a const reference to the precursors
Constant neutral gain scan Synonyms: 'CNG scan'.
Definition: InstrumentSettings.h:62
Representation of controlled vocabulary mapping rules (for PSI formats)
Definition: CVMappings.h:57
Options for loading files containing peak data.
Definition: PeakFileOptions.h:48
Sustained off-resonance irradiation.
Definition: Precursor.h:73
Map< String, std::vector< SemanticValidator::CVTerm > > ref_param_
The referencing param groups: id => array (accession, value)
Definition: MzMLHandler.h:919
const FloatDataArrays & getFloatDataArrays() const
Returns a const reference to the float meta data arrays.
Definition: MSSpectrum.h:298
Definition: ControlledVocabulary.h:66
Int getOrder() const
returns the position of this part in the whole Instrument.
const String & getNativeID() const
returns the native identifier for the spectrum, used by the acquisition software. ...
void writeChromatogram_(std::ostream &os, const ChromatogramType &chromatogram, Size c, Internal::MzMLValidator &validator)
Definition: MzMLHandler.h:5246
Electron multiplier.
Definition: IonDetector.h:55
bool skip_data
Definition: MzMLHandler.h:945
desorption/ionization on silicon
Definition: IonSource.h:132
void setPrecursor(const Precursor &precursor)
sets the precursors
void setMSDataConsumer(Interfaces::IMSDataConsumer< MapType > *consumer)
Set the IMSDataConsumer consumer which will consume the read data.
Definition: MzMLHandler.h:245
photodiode array detector
Definition: IonDetector.h:73
int Int
Signed integer type.
Definition: Types.h:96
Open split.
Definition: IonSource.h:60
Map class based on the STL map (containing several convenience functions)
Definition: Map.h:51
Description of a mass analyzer (part of a MS Instrument)
Definition: MassAnalyzer.h:48
Description of an ion source (part of a MS Instrument)
Definition: IonSource.h:47
Definition: MzMLHandlerHelper.h:64
array detector
Definition: IonDetector.h:66
const MapType * cexp_
map pointer for writing
Definition: MzMLHandler.h:899
const String & getName() const
returns the sample name (default: "")
Conversion to mzData format.
Definition: DataProcessing.h:76
Charge deconvolution.
Definition: DataProcessing.h:61
Electron capture dissociation.
Definition: Precursor.h:71
ChromatogramType chromatogram
Definition: MzMLHandler.h:962
Quadrupole.
Definition: MassAnalyzer.h:56
einzel lens
Definition: Instrument.h:80
Matrix-assisted laser desorption ionization.
Definition: IonSource.h:107
void handleCVParam_(const String &parent_parent_tag, const String &parent_tag, const String &accession, const String &name, const String &value, const String &unit_accession="")
Handles CV terms.
Definition: MzMLHandler.h:1603
bool getWriteIndex() const
Whether to write an index at the end of the file (e.g. indexedmzML file format)
liquid secondary ionization
Definition: IonSource.h:125
virtual ~MzMLHandler()
Destructor.
Definition: MzMLHandler.h:190
double getConcentration() const
returns the concentration (in g/l) (default: 0.0)
SampleState getState() const
returns the state of aggregation (default: SAMPLENULL)
UInt chromatogram_count
Definition: MzMLHandler.h:986
bool validateCV_(const ControlledVocabulary::CVTerm &c, const String &path, const Internal::MzMLValidator &validator) const
Helper method to validate if the given CV is allowed in the current location (path) ...
Definition: MzMLHandler.h:3490
Unknown.
Definition: IonSource.h:82
Direct.
Definition: IonSource.h:55
bool hasPrefix(const String &string) const
true if String begins with string, false otherwise
Parse Error exception.
Definition: Exception.h:608
virtual void characters(const XMLCh *const chars, const XMLSize_t length)
Parsing method for character data.
Definition: MzMLHandler.h:1048
Size default_array_length
Definition: MzMLHandler.h:961
const CVTerm & getTerm(const String &id) const
Returns a term specified by ID.
Definition: ControlledVocabulary.h:69
kinetic energy analyzer
Definition: Instrument.h:83
double getVolume() const
returns the volume (in ml) (default: 0.0)
laser desorption
Definition: IonSource.h:88
chemical ionisation
Definition: IonSource.h:85
static field
Definition: Instrument.h:84
Used to load CvMapping files.
Definition: CVMappingFile.h:57
bool getMetadataOnly() const
returns whether or not to load only meta data
Flow injection analysis.
Definition: IonSource.h:66
atmospheric pressure ionisation
Definition: IonSource.h:94