35 #ifndef OPENMS_FORMAT_HANDLERS_MZDATAHANDLER_H 
   36 #define OPENMS_FORMAT_HANDLERS_MZDATAHANDLER_H 
   59     template <
typename MapType>
 
  103       virtual void endElement(
const XMLCh * 
const , 
const XMLCh * 
const , 
const XMLCh * 
const qname);
 
  106       virtual void startElement(
const XMLCh * 
const , 
const XMLCh * 
const , 
const XMLCh * 
const qname, 
const xercesc::Attributes & attributes);
 
  109       virtual void characters(
const XMLCh * 
const chars, 
const XMLSize_t length);
 
  112       void writeTo(std::ostream & os);
 
  145         String(
";ESI;EI;CI;FAB;TSP;LD;FD;FI;PD;SI;TI;API;ISI;CID;CAD;HN;APCI;APPI;ICP").
split(
';', 
cv_terms_[10]);
 
  147         String(
";Direct;Batch;Chromatography;ParticleBeam;MembraneSeparator;OpenSplit;JetSeparator;Septum;Reservoir;MovingBelt;MovingWire;FlowInjectionAnalysis;ElectrosprayInlet;ThermosprayInlet;Infusion;ContinuousFlowFastAtomBombardment;InductivelyCoupledPlasma").
split(
';', 
cv_terms_[11]);
 
  151         String(
";EM;Photomultiplier;FocalPlaneArray;FaradayCup;ConversionDynodeElectronMultiplier;ConversionDynodePhotomultiplier;Multi-Collector;ChannelElectronMultiplier").
split(
';', 
cv_terms_[13]);
 
  153         String(
";Quadrupole;PaulIonTrap;RadialEjectionLinearIonTrap;AxialEjectionLinearIonTrap;TOF;Sector;FourierTransform;IonStorage").
split(
';', 
cv_terms_[14]);
 
  226           os << 
String(indent, 
'\t') << 
"<cvParam cvLabel=\"psi\" accession=\"PSI:" << acc << 
"\" name=\"" << name << 
"\" value=\"" << value << 
"\"/>\n";
 
  245           os << 
String(indent, 
'\t') << 
"<cvParam cvLabel=\"psi\" accession=\"PSI:" << acc << 
"\" name=\"" << name << 
"\" value=\"" << value << 
"\"/>\n";
 
  267           warning(
STORE, 
String(
"Cannot find map '") + map + 
"' needed to write CV term '" + name + 
"' with accession '" + acc + 
"'.");
 
  273           warning(
STORE, 
String(
"Cannot find value '") + value + 
"' needed to write CV term '" + name + 
"' with accession '" + acc + 
"'.");
 
  282         std::vector<String> keys;
 
  284         for (std::vector<String>::const_iterator it = keys.begin(); it != keys.end(); ++it)
 
  288             os << 
String(indent, 
'\t') << 
"<userParam name=\"" << *it << 
"\" value=\"" << meta.
getMetaValue(*it) << 
"\"/>\n";
 
  310         os << 
"\t\t\t<" << tag;
 
  311         if (tag == 
"supDataArrayBinary" || tag == 
"supDataArray")
 
  313           os << 
" id=\"" << 
id << 
"\"";
 
  316         if (tag == 
"supDataArrayBinary" || tag == 
"supDataArray")
 
  318           os << 
"\t\t\t\t<arrayName>" << name << 
"</arrayName>\n";
 
  324         os << 
"\t\t\t\t<data precision=\"32\" endian=\"little\" length=\"" 
  327            << 
"</data>\n\t\t\t</" << tag << 
">\n";
 
  337     template <
typename MapType>
 
  344       char * transcoded_chars = sm_.convert(chars);
 
  347       const String & current_tag = open_tags_.back();
 
  351       if (open_tags_.size() > 1)
 
  352         parent_tag = *(open_tags_.end() - 2);
 
  355       if (current_tag == 
"sampleName")
 
  357         exp_->getSample().setName(sm_.convert(chars));
 
  359       else if (current_tag == 
"instrumentName")
 
  361         exp_->getInstrument().setName(sm_.convert(chars));
 
  363       else if (current_tag == 
"version")
 
  365         data_processing_.getSoftware().setVersion(sm_.convert(chars));
 
  367       else if (current_tag == 
"institution")
 
  369         exp_->getContacts().back().setInstitution(sm_.convert(chars));
 
  371       else if (current_tag == 
"contactInfo")
 
  373         exp_->getContacts().back().setContactInfo(sm_.convert(chars));
 
  375       else if (current_tag == 
"name" && parent_tag == 
"contact")
 
  377         exp_->getContacts().back().setName(sm_.convert(chars));
 
  379       else if (current_tag == 
"name" && parent_tag == 
"software")
 
  381         data_processing_.getSoftware().setName(sm_.convert(chars));
 
  383       else if (current_tag == 
"comments" && parent_tag == 
"software")
 
  385         data_processing_.getSoftware().setMetaValue(
"comment", 
String(sm_.convert(chars)));
 
  387       else if (current_tag == 
"comments" && parent_tag == 
"spectrumDesc")
 
  389         spec_.setComment(transcoded_chars);
 
  391       else if (current_tag == 
"data")
 
  394         data_to_decode_.back() += transcoded_chars;
 
  396       else if (current_tag == 
"arrayName" && parent_tag == 
"supDataArrayBinary")
 
  398         spec_.getFloatDataArrays().back().setName(transcoded_chars);
 
  400       else if (current_tag == 
"nameOfFile" && parent_tag == 
"sourceFile")
 
  402         exp_->getSourceFiles().back().setNameOfFile(sm_.convert(chars));
 
  404       else if (current_tag == 
"nameOfFile" && parent_tag == 
"supSourceFile")
 
  408       else if (current_tag == 
"pathToFile" && parent_tag == 
"sourceFile")
 
  410         exp_->getSourceFiles().back().setPathToFile(sm_.convert(chars));
 
  412       else if (current_tag == 
"pathToFile" && parent_tag == 
"supSourceFile")
 
  416       else if (current_tag == 
"fileType" && parent_tag == 
"sourceFile")
 
  418         exp_->getSourceFiles().back().setFileType(sm_.convert(chars));
 
  420       else if (current_tag == 
"fileType" && parent_tag == 
"supSourceFile")
 
  426         String trimmed_transcoded_chars = transcoded_chars;
 
  427         trimmed_transcoded_chars.
trim();
 
  428         if (trimmed_transcoded_chars != 
"")
 
  430           warning(LOAD, 
String(
"Unhandled character content in tag '") + current_tag + 
"': " + trimmed_transcoded_chars);
 
  435     template <
typename MapType>
 
  438       static const XMLCh * s_name = xercesc::XMLString::transcode(
"name");
 
  439       static const XMLCh * s_accession = xercesc::XMLString::transcode(
"accession");
 
  440       static const XMLCh * s_value = xercesc::XMLString::transcode(
"value");
 
  441       static const XMLCh * s_id = xercesc::XMLString::transcode(
"id");
 
  442       static const XMLCh * s_count = xercesc::XMLString::transcode(
"count");
 
  443       static const XMLCh * s_spectrumtype = xercesc::XMLString::transcode(
"spectrumType");
 
  444       static const XMLCh * s_methodofcombination = xercesc::XMLString::transcode(
"methodOfCombination");
 
  445       static const XMLCh * s_acqnumber = xercesc::XMLString::transcode(
"acqNumber");
 
  446       static const XMLCh * s_mslevel = xercesc::XMLString::transcode(
"msLevel");
 
  447       static const XMLCh * s_mzrangestart = xercesc::XMLString::transcode(
"mzRangeStart");
 
  448       static const XMLCh * s_mzrangestop = xercesc::XMLString::transcode(
"mzRangeStop");
 
  449       static const XMLCh * s_supdataarrayref = xercesc::XMLString::transcode(
"supDataArrayRef");
 
  450       static const XMLCh * s_precision = xercesc::XMLString::transcode(
"precision");
 
  451       static const XMLCh * s_endian = xercesc::XMLString::transcode(
"endian");
 
  452       static const XMLCh * s_length = xercesc::XMLString::transcode(
"length");
 
  453       static const XMLCh * s_comment = xercesc::XMLString::transcode(
"comment");
 
  454       static const XMLCh * s_accessionnumber = xercesc::XMLString::transcode(
"accessionNumber");
 
  456       String tag = sm_.convert(qname);
 
  457       open_tags_.push_back(tag);
 
  462       if (open_tags_.size() > 1)
 
  463         parent_tag = *(open_tags_.end() - 2);
 
  466       if (tag != 
"spectrum" && skip_spectrum_)
 
  471       if (tag == 
"sourceFile")
 
  473         exp_->getSourceFiles().push_back(
SourceFile());
 
  475       if (tag == 
"contact")
 
  477         exp_->getContacts().resize(exp_->getContacts().size() + 1);
 
  479       else if (tag == 
"source")
 
  481         exp_->getInstrument().getIonSources().resize(1);
 
  483       else if (tag == 
"detector")
 
  485         exp_->getInstrument().getIonDetectors().resize(1);
 
  487       else if (tag == 
"analyzer")
 
  489         exp_->getInstrument().getMassAnalyzers().resize(exp_->getInstrument().getMassAnalyzers().size() + 1);
 
  491       else if (tag == 
"software")
 
  494         if (attributes.getIndex(sm_.convert(
"completionTime")) != -1)
 
  496           data_processing_.setCompletionTime(asDateTime_(sm_.convert(attributes.getValue(sm_.convert(
"completionTime")))));
 
  499       else if (tag == 
"precursor")
 
  501         spec_.getPrecursors().push_back(
Precursor());
 
  503       else if (tag == 
"cvParam")
 
  505         String accession = attributeAsString_(attributes, s_accession);
 
  507         optionalAttributeAsString_(value, attributes, s_value);
 
  508         cvParam_(accession, value);
 
  510       else if (tag == 
"supDataDesc")
 
  513         if (optionalAttributeAsString_(comment, attributes, s_comment))
 
  515           meta_id_descs_.back().second.setMetaValue(
"comment", comment);
 
  518       else if (tag == 
"userParam")
 
  520         String name = attributeAsString_(attributes, s_name);
 
  522         optionalAttributeAsString_(value, attributes, s_value);
 
  524         if (parent_tag == 
"spectrumInstrument")
 
  526           spec_.getInstrumentSettings().setMetaValue(name, value);
 
  528         else if (parent_tag == 
"acquisition")
 
  530           spec_.getAcquisitionInfo().back().setMetaValue(name, value);
 
  532         else if (parent_tag == 
"ionSelection")
 
  534           spec_.getPrecursors().back().setMetaValue(name, value);
 
  536         else if (parent_tag == 
"activation")
 
  538           spec_.getPrecursors().back().setMetaValue(name, value);
 
  540         else if (parent_tag == 
"supDataDesc")
 
  542           meta_id_descs_.back().second.setMetaValue(name, value);
 
  544         else if (parent_tag == 
"detector")
 
  546           exp_->getInstrument().getIonDetectors().back().setMetaValue(name, value);
 
  548         else if (parent_tag == 
"source")
 
  550           exp_->getInstrument().getIonSources().back().setMetaValue(name, value);
 
  552         else if (parent_tag == 
"sampleDescription")
 
  554           exp_->getSample().setMetaValue(name, value);
 
  556         else if (parent_tag == 
"analyzer")
 
  558           exp_->getInstrument().getMassAnalyzers().back().setMetaValue(name, value);
 
  560         else if (parent_tag == 
"additional")
 
  562           exp_->getInstrument().setMetaValue(name, value);
 
  564         else if (parent_tag == 
"processingMethod")
 
  566           data_processing_.setMetaValue(name, value);
 
  570           warning(LOAD, 
"Invalid userParam: name=\"" + name + 
", value=\"" + value + 
"\"");
 
  573       else if (tag == 
"supDataArrayBinary")
 
  577         typename MapType::SpectrumType::FloatDataArray mda;
 
  579         String id = attributeAsString_(attributes, s_id);
 
  580         for (
Size i = 0; i < meta_id_descs_.size(); ++i)
 
  582           if (meta_id_descs_[i].first == 
id)
 
  584             mda.MetaInfoDescription::operator=(meta_id_descs_[i].second);
 
  589         spec_.getFloatDataArrays().push_back(mda);
 
  591       else if (tag == 
"spectrum")
 
  594         spec_.setNativeID(
String(
"spectrum=") + attributeAsString_(attributes, s_id));
 
  595         spec_.getDataProcessing().push_back(data_processing_);
 
  597       else if (tag == 
"spectrumList")
 
  599         if (options_.getMetadataOnly())
 
  602         UInt count = attributeAsInt_(attributes, s_count);
 
  603         exp_->reserve(count);
 
  604         logger_.startProgress(0, count, 
"loading mzData file");
 
  607       else if (tag == 
"mzData")
 
  610         exp_->setIdentifier(attributeAsString_(attributes, s_accessionnumber));
 
  612       else if (tag == 
"acqSpecification")
 
  614         String tmp_type = attributeAsString_(attributes, s_spectrumtype);
 
  615         if (tmp_type == 
"discrete")
 
  619         else if (tmp_type == 
"continuous")
 
  626           warning(LOAD, 
String(
"Invalid spectrum type '") + tmp_type + 
"'.");
 
  629         spec_.getAcquisitionInfo().setMethodOfCombination(attributeAsString_(attributes, s_methodofcombination));
 
  631       else if (tag == 
"acquisition")
 
  633         spec_.getAcquisitionInfo().insert(spec_.getAcquisitionInfo().end(), 
Acquisition());
 
  634         spec_.getAcquisitionInfo().back().setIdentifier(attributeAsString_(attributes, s_acqnumber));
 
  636       else if (tag == 
"spectrumInstrument" || tag == 
"acqInstrument")
 
  638         spec_.setMSLevel(attributeAsInt_(attributes, s_mslevel));
 
  640         optionalAttributeAsDouble_(window.
begin, attributes, s_mzrangestart);
 
  641         optionalAttributeAsDouble_(window.
end, attributes, s_mzrangestop);
 
  642         if (window.
begin != 0.0 || window.
end != 0.0)
 
  644           spec_.getInstrumentSettings().getScanWindows().push_back(window);
 
  647         if (options_.hasMSLevels() && !options_.containsMSLevel(spec_.getMSLevel()))
 
  649           skip_spectrum_ = 
true;
 
  652       else if (tag == 
"supDesc")
 
  654         meta_id_descs_.push_back(std::make_pair(attributeAsString_(attributes, s_supdataarrayref), 
MetaInfoDescription()));
 
  656       else if (tag == 
"data")
 
  659         precisions_.push_back(attributeAsString_(attributes, s_precision));
 
  660         endians_.push_back(attributeAsString_(attributes, s_endian));
 
  663         if (parent_tag == 
"mzArrayBinary")
 
  665           peak_count_ = attributeAsInt_(attributes, s_length);
 
  666           spec_.reserve(peak_count_);
 
  669       else if (tag == 
"mzArrayBinary")
 
  671         data_to_decode_.resize(data_to_decode_.size() + 1);
 
  673       else if (tag == 
"intenArrayBinary")
 
  675         data_to_decode_.resize(data_to_decode_.size() + 1);
 
  677       else if (tag == 
"arrayName" && parent_tag == 
"supDataArrayBinary")
 
  680         data_to_decode_.resize(data_to_decode_.size() + 1);
 
  685     template <
typename MapType>
 
  688       static UInt scan_count = 0;
 
  690       static const XMLCh * s_spectrum = xercesc::XMLString::transcode(
"spectrum");
 
  691       static const XMLCh * s_mzdata = xercesc::XMLString::transcode(
"mzData");
 
  693       open_tags_.pop_back();
 
  696       if (equal_(qname, s_spectrum))
 
  701           exp_->addSpectrum(spec_);
 
  703         skip_spectrum_ = 
false;
 
  704         logger_.setProgress(++scan_count);
 
  705         decoded_list_.clear();
 
  706         decoded_double_list_.clear();
 
  707         data_to_decode_.clear();
 
  710         meta_id_descs_.clear();
 
  712       else if (equal_(qname, s_mzdata))
 
  714         logger_.endProgress();
 
  721     template <
typename MapType>
 
  724       std::vector<Real> decoded;
 
  725       std::vector<DoubleReal> decoded_double;
 
  731       for (
Size i = 0; i < data_to_decode_.size(); ++i)
 
  735         data_to_decode_[i].removeWhitespaces();
 
  737         if (precisions_[i] == 
"64")         
 
  739           if (endians_[i] == 
"big")
 
  752           decoded_double_list_.push_back(decoded_double);
 
  753           decoded_list_.push_back(std::vector<float>());
 
  757           if (endians_[i] == 
"big")
 
  768           decoded_list_.push_back(decoded);
 
  769           decoded_double_list_.push_back(std::vector<double>());
 
  776         bool mz_precision_64 = 
true;
 
  777         if (precisions_[0] == 
"32")
 
  779           mz_precision_64 = 
false;
 
  781         bool int_precision_64 = 
true;
 
  782         if (precisions_[1] == 
"32")
 
  784           int_precision_64 = 
false;
 
  788         for (
Size i = 0; i < spec_.getFloatDataArrays().size(); ++i)
 
  790           spec_.getFloatDataArrays()[i].reserve(peak_count_);
 
  794         for (
Size n = 0; n < peak_count_; ++n)
 
  796           DoubleReal mz = mz_precision_64 ? decoded_double_list_[0][n] : decoded_list_[0][n];
 
  797           DoubleReal intensity = int_precision_64 ? decoded_double_list_[1][n] : decoded_list_[1][n];
 
  798           if ((!options_.hasMZRange() || options_.getMZRange().encloses(
DPosition<1>(mz)))
 
  799              && (!options_.hasIntensityRange() || options_.getIntensityRange().encloses(
DPosition<1>(intensity))))
 
  802             tmp.setIntensity(intensity);
 
  804             spec_.push_back(tmp);
 
  806             for (
Size i = 0; i < spec_.getFloatDataArrays().size(); ++i)
 
  808               spec_.getFloatDataArrays()[i].push_back(precisions_[2 + i] == 
"64" ? decoded_double_list_[2 + i][n] : decoded_list_[2 + i][n]);
 
  815     template <
typename MapType>
 
  818       logger_.startProgress(0, cexp_->size(), 
"storing mzData file");
 
  820       os << 
"<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n" 
  821          << 
"<mzData version=\"1.05\" accessionNumber=\"" << cexp_->getIdentifier() << 
"\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://psidev.sourceforge.net/ms/xml/mzdata/mzdata.xsd\">\n";
 
  825       const Sample & sm = cexp_->getSample();
 
  826       os << 
"\t<description>\n" 
  828          << 
"\t\t\t<sampleName>" 
  830          << 
"</sampleName>\n";
 
  834         os << 
"\t\t\t<sampleDescription>\n";
 
  835         writeCVS_(os, sm.
getNumber(), 
"1000001", 
"SampleNumber");
 
  836         writeCVS_(os, sm.
getState(), 0, 
"1000003", 
"SampleState");
 
  837         writeCVS_(os, sm.
getMass(), 
"1000004", 
"SampleMass");
 
  838         writeCVS_(os, sm.
getVolume(), 
"1000005", 
"SampleVolume");
 
  840         writeUserParam_(os, cexp_->getSample());
 
  841         os << 
"\t\t\t</sampleDescription>\n";
 
  844       if (cexp_->getSourceFiles().size() >= 1)
 
  846         os << 
"\t\t\t<sourceFile>\n" 
  847            << 
"\t\t\t\t<nameOfFile>" << cexp_->getSourceFiles()[0].getNameOfFile() << 
"</nameOfFile>\n" 
  848            << 
"\t\t\t\t<pathToFile>" << cexp_->getSourceFiles()[0].getPathToFile() << 
"</pathToFile>\n";
 
  849         if (cexp_->getSourceFiles()[0].getFileType() != 
"")
 
  850           os << 
"\t\t\t\t<fileType>" << cexp_->getSourceFiles()[0].getFileType() << 
"</fileType>\n";
 
  851         os << 
"\t\t\t</sourceFile>\n";
 
  853       if (cexp_->getSourceFiles().size() > 1)
 
  855         warning(STORE, 
"The MzData format can store only one source file. Only the first one is stored!");
 
  858       for (
Size i = 0; i < cexp_->getContacts().size(); ++i)
 
  860         os << 
"\t\t\t<contact>\n" 
  861            << 
"\t\t\t\t<name>" << cexp_->getContacts()[i].getFirstName() << 
" " << cexp_->getContacts()[i].getLastName() << 
"</name>\n" 
  862            << 
"\t\t\t\t<institution>" << cexp_->getContacts()[i].getInstitution() << 
"</institution>\n";
 
  863         if (cexp_->getContacts()[i].getContactInfo() != 
"")
 
  864           os << 
"\t\t\t\t<contactInfo>" << cexp_->getContacts()[i].getContactInfo() << 
"</contactInfo>\n";
 
  865         os << 
"\t\t\t</contact>\n";
 
  868       if (cexp_->getContacts().empty())
 
  870         os << 
"\t\t\t<contact>\n" 
  871            << 
"\t\t\t\t<name></name>\n" 
  872            << 
"\t\t\t\t<institution></institution>\n";
 
  873         os << 
"\t\t\t</contact>\n";
 
  876       os << 
"\t\t</admin>\n";
 
  877       const Instrument & inst = cexp_->getInstrument();
 
  878       os << 
"\t\t<instrument>\n" 
  879          << 
"\t\t\t<instrumentName>" << inst.
getName() << 
"</instrumentName>\n" 
  880          << 
"\t\t\t<source>\n";
 
  883         writeCVS_(os, inst.
getIonSources()[0].getInletType(), 11, 
"1000007", 
"InletType");
 
  884         writeCVS_(os, inst.
getIonSources()[0].getIonizationMethod(), 10, 
"1000008", 
"IonizationType");
 
  885         writeCVS_(os, inst.
getIonSources()[0].getPolarity(), 1, 
"1000009", 
"IonizationMode");
 
  890         warning(STORE, 
"The MzData format can store only one ion source. Only the first one is stored!");
 
  892       os << 
"\t\t\t</source>\n";
 
  897         os << 
"\t\t\t<analyzerList count=\"1\">\n" 
  898            << 
"\t\t\t\t<analyzer>\n" 
  899            << 
"\t\t\t\t</analyzer>\n";
 
  903         os << 
"\t\t\t<analyzerList count=\"" << inst.
getMassAnalyzers().size() << 
"\">\n";
 
  906           os << 
"\t\t\t\t<analyzer>\n";
 
  908           writeCVS_(os, ana.
getType(), 14, 
"1000010", 
"AnalyzerType", 5);
 
  909           writeCVS_(os, ana.
getResolution(), 
"1000011", 
"MassResolution", 5);
 
  912           writeCVS_(os, ana.
getAccuracy(), 
"1000014", 
"Accuracy", 5);
 
  913           writeCVS_(os, ana.
getScanRate(), 
"1000015", 
"ScanRate", 5);
 
  914           writeCVS_(os, ana.
getScanTime(), 
"1000016", 
"ScanTime", 5);
 
  916           writeCVS_(os, ana.
getScanLaw(), 6, 
"1000019", 
"ScanLaw", 5);
 
  922           writeUserParam_(os, ana, 5);
 
  923           os << 
"\t\t\t\t</analyzer>\n";
 
  926       os << 
"\t\t\t</analyzerList>\n";
 
  928       os << 
"\t\t\t<detector>\n";
 
  931         writeCVS_(os, inst.
getIonDetectors()[0].getType(), 13, 
"1000026", 
"DetectorType");
 
  932         writeCVS_(os, inst.
getIonDetectors()[0].getAcquisitionMode(), 9, 
"1000027", 
"DetectorAcquisitionMode");
 
  933         writeCVS_(os, inst.
getIonDetectors()[0].getResolution(), 
"1000028", 
"DetectorResolution");
 
  934         writeCVS_(os, inst.
getIonDetectors()[0].getADCSamplingFrequency(), 
"1000029", 
"SamplingFrequency");
 
  939         warning(STORE, 
"The MzData format can store only one ion detector. Only the first one is stored!");
 
  941       os << 
"\t\t\t</detector>\n";
 
  944         os << 
"\t\t\t<additional>\n";
 
  945         writeCVS_(os, inst.
getVendor(), 
"1000030", 
"Vendor");
 
  946         writeCVS_(os, inst.
getModel(), 
"1000031", 
"Model");
 
  948         writeUserParam_(os, inst);
 
  949         os << 
"\t\t\t</additional>\n";
 
  951       os << 
"\t\t</instrument>\n";
 
  954       if (cexp_->size() == 0 || (*cexp_)[0].getDataProcessing().empty())
 
  956         os << 
"\t\t<dataProcessing>\n" 
  957            << 
"\t\t\t<software>\n" 
  958            << 
"\t\t\t\t<name></name>\n" 
  959            << 
"\t\t\t\t<version></version>\n" 
  960            << 
"\t\t\t</software>\n" 
  961            << 
"\t\t</dataProcessing>\n";
 
  965         const DataProcessing & data_processing = (*cexp_)[0].getDataProcessing()[0];
 
  966         os << 
"\t\t<dataProcessing>\n" 
  967            << 
"\t\t\t<software";
 
  970           os << 
" completionTime=\"" << data_processing.
getCompletionTime().
get().substitute(
' ', 
'T') << 
"\"";
 
  975         os << 
"\t\t\t</software>\n" 
  976            << 
"\t\t\t<processingMethod>\n";
 
  979           os << 
"\t\t\t\t<cvParam cvLabel=\"psi\" name=\"Deisotoping\" accession=\"PSI:1000033\" />\n";
 
  983           os << 
"\t\t\t\t<cvParam cvLabel=\"psi\" name=\"ChargeDeconvolution\" accession=\"PSI:1000034\" />\n";
 
  987           os << 
"\t\t\t\t<cvParam cvLabel=\"psi\" name=\"Centroid Mass Spectrum\" accession=\"PSI:1000127\"/>\n";
 
  989         writeUserParam_(os, data_processing);
 
  990         os << 
"\t\t\t</processingMethod>\n" 
  991            << 
"\t\t</dataProcessing>\n";
 
  993       os << 
"\t</description>\n";
 
  997       if (cexp_->size() != 0)
 
 1001         bool all_numbers = 
true;
 
 1002         bool all_empty = 
true;
 
 1003         bool all_prefixed_numbers = 
true;
 
 1004         for (
Size s = 0; s < cexp_->size(); s++)
 
 1006           String native_id = (*cexp_)[s].getNativeID();
 
 1009             all_prefixed_numbers = 
false;
 
 1013             native_id = native_id.
substr(9);
 
 1021             all_numbers = 
false;
 
 1022             all_prefixed_numbers = 
false;
 
 1023             if (native_id != 
"")
 
 1030         if (!all_numbers && !all_empty)
 
 1032           warning(STORE, 
"Not all spectrum native IDs are numbers or correctly prefixed with 'spectrum='. The spectra are renumbered and the native IDs are lost!");
 
 1037         os << 
"\t<spectrumList count=\"" << cexp_->size() << 
"\">\n";
 
 1038         for (
Size s = 0; s < cexp_->size(); ++s)
 
 1040           logger_.setProgress(s);
 
 1043           Size spectrum_id = s + 1;
 
 1044           if (all_prefixed_numbers)
 
 1048           else if (all_numbers)
 
 1052           os << 
"\t\t<spectrum id=\"" << spectrum_id << 
"\">\n" 
 1053              << 
"\t\t\t<spectrumDesc>\n" 
 1054              << 
"\t\t\t\t<spectrumSettings>\n";
 
 1058             os << 
"\t\t\t\t\t<acqSpecification spectrumType=\"";
 
 1069               warning(STORE, 
"Spectrum type is unknown, assuming 'discrete'");
 
 1088                 warning(STORE, 
String(
"Could not convert acquisition identifier '") + ac.
getIdentifier() + 
"' to an integer. Using '0' instead!");
 
 1091               os << 
"\t\t\t\t\t\t<acquisition acqNumber=\"" << acq_number << 
"\">\n";
 
 1092               writeUserParam_(os, ac, 7);
 
 1093               os << 
"\t\t\t\t\t\t</acquisition>\n";
 
 1095             os << 
"\t\t\t\t\t</acqSpecification>\n";
 
 1099           os << 
"\t\t\t\t\t<spectrumInstrument msLevel=\"" << spec.
getMSLevel() << 
"\"";
 
 1108             warning(STORE, 
"The MzData format can store only one scan window for each scan. Only the first one is stored!");
 
 1124               os << 
"\t\t\t\t\t\t<cvParam cvLabel=\"psi\" accession=\"PSI:1000036\" name=\"ScanMode\" value=\"Zoom\"/>\n";
 
 1128               os << 
"\t\t\t\t\t\t<cvParam cvLabel=\"psi\" accession=\"PSI:1000036\" name=\"ScanMode\" value=\"MassScan\"/>\n";
 
 1133             os << 
"\t\t\t\t\t\t<cvParam cvLabel=\"psi\" accession=\"PSI:1000036\" name=\"ScanMode\" value=\"SelectedIonDetection\"/>\n";
 
 1137             os << 
"\t\t\t\t\t\t<cvParam cvLabel=\"psi\" accession=\"PSI:1000036\" name=\"ScanMode\" value=\"SelectedReactionMonitoring\"/>\n";
 
 1141             os << 
"\t\t\t\t\t\t<cvParam cvLabel=\"psi\" accession=\"PSI:1000036\" name=\"ScanMode\" value=\"ConsecutiveReactionMonitoring\"/>\n";
 
 1145             os << 
"\t\t\t\t\t\t<cvParam cvLabel=\"psi\" accession=\"PSI:1000036\" name=\"ScanMode\" value=\"ConstantNeutralGainScan\"/>\n";
 
 1149             os << 
"\t\t\t\t\t\t<cvParam cvLabel=\"psi\" accession=\"PSI:1000036\" name=\"ScanMode\" value=\"ConstantNeutralLossScan\"/>\n";
 
 1153             os << 
"\t\t\t\t\t\t<cvParam cvLabel=\"psi\" accession=\"PSI:1000036\" name=\"ScanMode\" value=\"PrecursorIonScan\"/>\n";
 
 1157             os << 
"\t\t\t\t\t\t<cvParam cvLabel=\"psi\" accession=\"PSI:1000036\" name=\"ScanMode\" value=\"PhotodiodeArrayDetector\"/>\n";
 
 1161             os << 
"\t\t\t\t\t\t<cvParam cvLabel=\"psi\" accession=\"PSI:1000036\" name=\"ScanMode\" value=\"EnhancedMultiplyChargedScan\"/>\n";
 
 1165             os << 
"\t\t\t\t\t\t<cvParam cvLabel=\"psi\" accession=\"PSI:1000036\" name=\"ScanMode\" value=\"TimeDelayedFragmentationScan\"/>\n";
 
 1169             os << 
"\t\t\t\t\t\t<cvParam cvLabel=\"psi\" accession=\"PSI:1000036\" name=\"ScanMode\" value=\"MassScan\"/>\n";
 
 1176             os << 
String(6, 
'\t') << 
"<cvParam cvLabel=\"psi\" accession=\"PSI:1000037\" name=\"Polarity\" value=\"Positive\"/>\n";
 
 1180             os << 
String(6, 
'\t') << 
"<cvParam cvLabel=\"psi\" accession=\"PSI:1000037\" name=\"Polarity\" value=\"Negative\"/>\n";
 
 1184           writeCVS_(os, spec.
getRT(), 
"1000039", 
"TimeInSeconds", 6);
 
 1186           os << 
"\t\t\t\t\t</spectrumInstrument>\n\t\t\t\t</spectrumSettings>\n";
 
 1192             if (level_id.
has(precursor_ms_level))
 
 1194               precursor_id = level_id[precursor_ms_level];
 
 1196             os << 
"\t\t\t\t<precursorList count=\"" << spec.
getPrecursors().size() << 
"\">\n";
 
 1200               os << 
"\t\t\t\t\t<precursor msLevel=\"" << precursor_ms_level << 
"\" spectrumRef=\"" << precursor_id << 
"\">\n";
 
 1201               os << 
"\t\t\t\t\t\t<ionSelection>\n";
 
 1204                 writeCVS_(os, precursor.
getMZ(), 
"1000040", 
"MassToChargeRatio", 7);
 
 1205                 writeCVS_(os, precursor.
getCharge(), 
"1000041", 
"ChargeState", 7);
 
 1206                 writeCVS_(os, precursor.
getIntensity(), 
"1000042", 
"Intensity", 7);
 
 1207                 os << 
"\t\t\t\t\t\t\t<cvParam cvLabel=\"psi\" accession=\"PSI:1000043\" name=\"IntensityUnit\" value=\"NumberOfCounts\"/>\n";
 
 1208                 writeUserParam_(os, precursor, 7);
 
 1210               os << 
"\t\t\t\t\t\t</ionSelection>\n";
 
 1211               os << 
"\t\t\t\t\t\t<activation>\n";
 
 1216                   writeCVS_(os, *(precursor.
getActivationMethods().begin()), 18, 
"1000044", 
"ActivationMethod", 7);
 
 1219                 os << 
"\t\t\t\t\t\t\t<cvParam cvLabel=\"psi\" accession=\"PSI:1000046\" name=\"EnergyUnit\" value=\"eV\"/>\n";
 
 1221               os << 
"\t\t\t\t\t\t</activation>\n";
 
 1222               os << 
"\t\t\t\t\t</precursor>\n";
 
 1224             os << 
"\t\t\t\t</precursorList>\n";
 
 1226           os << 
"\t\t\t</spectrumDesc>\n";
 
 1229           if (options_.getWriteSupplementalData())
 
 1235               os << 
"\t\t\t<supDesc supDataArrayRef=\"" << (i + 1) << 
"\">\n";
 
 1238                 os << 
"\t\t\t\t<supDataDesc>\n";
 
 1239                 writeUserParam_(os, desc, 5);
 
 1240                 os << 
"\t\t\t\t</supDataDesc>\n";
 
 1242               os << 
"\t\t\t</supDesc>\n";
 
 1247           data_to_encode_.clear();
 
 1248           for (
Size i = 0; i < spec.size(); i++)
 
 1250             data_to_encode_.push_back(spec[i].getPosition()[0]);
 
 1253           writeBinary_(os, spec.size(), 
"mzArrayBinary");
 
 1256           data_to_encode_.clear();
 
 1257           for (
Size i = 0; i < spec.size(); i++)
 
 1259             data_to_encode_.push_back(spec[i].getIntensity());
 
 1262           writeBinary_(os, spec.size(), 
"intenArrayBinary");
 
 1265           if (options_.getWriteSupplementalData())
 
 1270               const typename MapType::SpectrumType::FloatDataArray & mda = spec.
getFloatDataArrays()[i];
 
 1272               if (mda.size() != spec.size())
 
 1274                 error(LOAD, 
String(
"Length of meta data array (index:'") + i + 
"' name:'" + mda.getName() + 
"') differs from spectrum length. meta data array: " + mda.size() + 
" / spectrum: " + spec.size() + 
" .");
 
 1277               data_to_encode_.clear();
 
 1278               for (
Size j = 0; j < mda.size(); j++)
 
 1280                 data_to_encode_.push_back(mda[j]);
 
 1283               writeBinary_(os, mda.size(), 
"supDataArrayBinary", mda.getName(), i + 1);
 
 1287           os << 
"\t\t</spectrum>\n";
 
 1292         os << 
"\t<spectrumList count=\"1\">\n";
 
 1293         os << 
"\t\t<spectrum id=\"1\">\n";
 
 1294         os << 
"\t\t\t<spectrumDesc>\n";
 
 1295         os << 
"\t\t\t\t<spectrumSettings>\n";
 
 1296         os << 
"\t\t\t\t\t<spectrumInstrument msLevel=\"1\"/>\n";
 
 1297         os << 
"\t\t\t\t</spectrumSettings>\n";
 
 1298         os << 
"\t\t\t</spectrumDesc>\n";
 
 1299         os << 
"\t\t\t<mzArrayBinary>\n";
 
 1300         os << 
"\t\t\t\t<data length=\"0\" endian=\"little\" precision=\"32\"></data>\n";
 
 1301         os << 
"\t\t\t</mzArrayBinary>\n";
 
 1302         os << 
"\t\t\t<intenArrayBinary>\n";
 
 1303         os << 
"\t\t\t\t<data length=\"0\" endian=\"little\" precision=\"32\"></data>\n";
 
 1304         os << 
"\t\t\t</intenArrayBinary>\n";
 
 1305         os << 
"\t\t</spectrum>\n";
 
 1307       os << 
"\t</spectrumList>\n</mzData>\n";
 
 1309       logger_.endProgress();
 
 1312     template <
typename MapType>
 
 1319       if (open_tags_.size() > 1)
 
 1320         parent_tag = *(open_tags_.end() - 2);
 
 1322       if (parent_tag == 
"spectrumInstrument")
 
 1324         if (accession == 
"PSI:1000036")       
 
 1326           if (value == 
"Zoom")
 
 1328             spec_.getInstrumentSettings().setZoomScan(
true);
 
 1331           else if (value == 
"MassScan")
 
 1335           else if (value == 
"SelectedIonDetection")
 
 1339           else if (value == 
"SelectedReactionMonitoring")
 
 1343           else if (value == 
"ConsecutiveReactionMonitoring")
 
 1347           else if (value == 
"ConstantNeutralGainScan")
 
 1351           else if (value == 
"ConstantNeutralLossScan")
 
 1355           else if (value == 
"ProductIonScan")
 
 1358             spec_.setMSLevel(2);
 
 1360           else if (value == 
"PrecursorIonScan")
 
 1364           else if (value == 
"EnhancedResolutionScan")
 
 1366             spec_.getInstrumentSettings().setZoomScan(
true);
 
 1371             if (spec_.getMSLevel() >= 2)
 
 1378               warning(LOAD, 
String(
"Unknown scan mode '") + value + 
"'. Assuming full scan");
 
 1382         else if (accession == 
"PSI:1000038")       
 
 1384           spec_.setRT(asDouble_(value) * 60);         
 
 1385           if (options_.hasRTRange() && !options_.getRTRange().encloses(
DPosition<1>(spec_.getRT())))
 
 1387             skip_spectrum_ = 
true;
 
 1390         else if (accession == 
"PSI:1000039")       
 
 1392           spec_.setRT(asDouble_(value));
 
 1393           if (options_.hasRTRange() && !options_.getRTRange().encloses(
DPosition<1>(spec_.getRT())))
 
 1395             skip_spectrum_ = 
true;
 
 1398         else if (accession == 
"PSI:1000037")       
 
 1400           if (value == 
"Positive" || value == 
"positive" || value == 
"+")     
 
 1404           else if (value == 
"Negative" || value == 
"negative" || value == 
"-")     
 
 1410             warning(LOAD, 
String(
"Invalid scan polarity (PSI:1000037) detected: \"") + value + 
"\". Valid are 'Positive' or 'Negative'.");
 
 1415           error = 
"SpectrumDescription.SpectrumSettings.SpectrumInstrument";
 
 1418       else if (parent_tag == 
"ionSelection")
 
 1420         if (accession == 
"PSI:1000040")       
 
 1422           spec_.getPrecursors().back().setMZ(asDouble_(value));
 
 1424         else if (accession == 
"PSI:1000041")       
 
 1426           if (spec_.getPrecursors().back().getCharge() != 0)
 
 1428             warning(LOAD, 
String(
"Multiple precursor charges detected, expected only one! Ignoring this charge settings! accession=\"") + accession + 
"\", value=\"" + value + 
"\"");
 
 1429             spec_.getPrecursors().back().setCharge(0);
 
 1433             spec_.getPrecursors().back().setCharge(asInt_(value));
 
 1436         else if (accession == 
"PSI:1000042")       
 
 1438           spec_.getPrecursors().back().setIntensity(asDouble_(value));
 
 1440         else if (accession == 
"PSI:1000043")       
 
 1446           error = 
"PrecursorList.Precursor.IonSelection.UserParam";
 
 1449       else if (parent_tag == 
"activation")
 
 1451         if (accession == 
"PSI:1000044")       
 
 1453           spec_.getPrecursors().back().getActivationMethods().insert((
Precursor::ActivationMethod)cvStringToEnum_(18, value, 
"activation method"));
 
 1455         else if (accession == 
"PSI:1000045")       
 
 1457           spec_.getPrecursors().back().setActivationEnergy(asDouble_(value));
 
 1459         else if (accession == 
"PSI:1000046")       
 
 1465           error = 
"PrecursorList.Precursor.Activation.UserParam";
 
 1468       else if (parent_tag == 
"supDataDesc")
 
 1471         error = 
"supDataDesc.UserParam";
 
 1473       else if (parent_tag == 
"acquisition")
 
 1476         error = 
"spectrumDesc.spectrumSettings.acquisitionSpecification.acquisition.UserParam";
 
 1478       else if (parent_tag == 
"detector")
 
 1480         if (accession == 
"PSI:1000026")
 
 1482           exp_->getInstrument().getIonDetectors().back().setType((
IonDetector::Type)cvStringToEnum_(13, value, 
"detector type"));
 
 1484         else if (accession == 
"PSI:1000028")
 
 1486           exp_->getInstrument().getIonDetectors().back().setResolution(asDouble_(value));
 
 1488         else if (accession == 
"PSI:1000029")
 
 1490           exp_->getInstrument().getIonDetectors().back().setADCSamplingFrequency(asDouble_(value));
 
 1492         else if (accession == 
"PSI:1000027")
 
 1494           exp_->getInstrument().getIonDetectors().back().setAcquisitionMode((
IonDetector::AcquisitionMode)cvStringToEnum_(9, value, 
"acquisition mode"));
 
 1498           error = 
"Description.Instrument.Detector.UserParam";
 
 1501       else if (parent_tag == 
"source")
 
 1503         if (accession == 
"PSI:1000008")
 
 1505           exp_->getInstrument().getIonSources().back().setIonizationMethod((
IonSource::IonizationMethod)cvStringToEnum_(10, value, 
"ion source"));
 
 1507         else if (accession == 
"PSI:1000007")
 
 1509           exp_->getInstrument().getIonSources().back().setInletType((
IonSource::InletType)cvStringToEnum_(11, value, 
"inlet type"));
 
 1511         else if (accession == 
"PSI:1000009")
 
 1513           exp_->getInstrument().getIonSources().back().setPolarity((
IonSource::Polarity)cvStringToEnum_(1, value, 
"polarity"));
 
 1517           error = 
"Description.Instrument.Source.UserParam";
 
 1520       else if (parent_tag == 
"sampleDescription")
 
 1522         if (accession == 
"PSI:1000001")
 
 1524           exp_->getSample().setNumber(value);
 
 1526         else if (accession == 
"PSI:1000003")
 
 1528           exp_->getSample().setState((
Sample::SampleState)cvStringToEnum_(0, value, 
"sample state"));
 
 1530         else if (accession == 
"PSI:1000004")
 
 1532           exp_->getSample().setMass(asDouble_(value));
 
 1534         else if (accession == 
"PSI:1000005")
 
 1536           exp_->getSample().setVolume(asDouble_(value));
 
 1538         else if (accession == 
"PSI:1000006")
 
 1540           exp_->getSample().setConcentration(asDouble_(value));
 
 1544           error = 
"Description.Admin.SampleDescription.UserParam";
 
 1547       else if (parent_tag == 
"analyzer")
 
 1549         if (accession == 
"PSI:1000010")
 
 1551           exp_->getInstrument().getMassAnalyzers().back().setType((
MassAnalyzer::AnalyzerType)cvStringToEnum_(14, value, 
"analyzer type"));
 
 1553         else if (accession == 
"PSI:1000011")
 
 1555           exp_->getInstrument().getMassAnalyzers().back().setResolution(asDouble_(value));
 
 1557         else if (accession == 
"PSI:1000012")
 
 1559           exp_->getInstrument().getMassAnalyzers().back().setResolutionMethod((
MassAnalyzer::ResolutionMethod)cvStringToEnum_(2, value, 
"resolution method"));
 
 1561         else if (accession == 
"PSI:1000013")
 
 1563           exp_->getInstrument().getMassAnalyzers().back().setResolutionType((
MassAnalyzer::ResolutionType)cvStringToEnum_(3, value, 
"resolution type"));
 
 1565         else if (accession == 
"PSI:1000014")
 
 1567           exp_->getInstrument().getMassAnalyzers().back().setAccuracy(asDouble_(value));
 
 1569         else if (accession == 
"PSI:1000015")
 
 1571           exp_->getInstrument().getMassAnalyzers().back().setScanRate(asDouble_(value));
 
 1573         else if (accession == 
"PSI:1000016")
 
 1575           exp_->getInstrument().getMassAnalyzers().back().setScanTime(asDouble_(value));
 
 1577         else if (accession == 
"PSI:1000018")
 
 1579           exp_->getInstrument().getMassAnalyzers().back().setScanDirection((
MassAnalyzer::ScanDirection)cvStringToEnum_(5, value, 
"scan direction"));
 
 1581         else if (accession == 
"PSI:1000019")
 
 1583           exp_->getInstrument().getMassAnalyzers().back().setScanLaw((
MassAnalyzer::ScanLaw)cvStringToEnum_(6, value, 
"scan law"));
 
 1585         else if (accession == 
"PSI:1000020")
 
 1589         else if (accession == 
"PSI:1000021")
 
 1591           exp_->getInstrument().getMassAnalyzers().back().setReflectronState((
MassAnalyzer::ReflectronState)cvStringToEnum_(8, value, 
"reflectron state"));
 
 1593         else if (accession == 
"PSI:1000022")
 
 1595           exp_->getInstrument().getMassAnalyzers().back().setTOFTotalPathLength(asDouble_(value));
 
 1597         else if (accession == 
"PSI:1000023")
 
 1599           exp_->getInstrument().getMassAnalyzers().back().setIsolationWidth(asDouble_(value));
 
 1601         else if (accession == 
"PSI:1000024")
 
 1603           exp_->getInstrument().getMassAnalyzers().back().setFinalMSExponent(asInt_(value));
 
 1605         else if (accession == 
"PSI:1000025")
 
 1607           exp_->getInstrument().getMassAnalyzers().back().setMagneticFieldStrength(asDouble_(value));
 
 1609         else if (accession == 
"PSI:1000017")
 
 1615           error = 
"AnalyzerList.Analyzer.UserParam";
 
 1618       else if (parent_tag == 
"additional")
 
 1620         if (accession == 
"PSI:1000030")
 
 1622           exp_->getInstrument().setVendor(value);
 
 1624         else if (accession == 
"PSI:1000031")
 
 1626           exp_->getInstrument().setModel(value);
 
 1628         else if (accession == 
"PSI:1000032")
 
 1630           exp_->getInstrument().setCustomizations(value);
 
 1634           error = 
"Description.Instrument.Additional";
 
 1637       else if (parent_tag == 
"processingMethod")
 
 1639         if (accession == 
"PSI:1000033")
 
 1643         else if (accession == 
"PSI:1000034")
 
 1647         else if (accession == 
"PSI:1000127")
 
 1651         else if (accession == 
"PSI:1000035")
 
 1657           error = 
"DataProcessing.DataProcessing.UserParam";
 
 1662         warning(LOAD, 
String(
"Unexpected cvParam: accession=\"") + accession + 
"\" value=\"" + value + 
"\" in tag " + parent_tag);
 
 1667         warning(LOAD, 
String(
"Invalid cvParam: accession=\"") + accession + 
"\" value=\"" + value + 
"\" in " + error);
 
Deisotoping. 
Definition: DataProcessing.h:62
Descripton of the applied preprocessing steps. 
Definition: DataProcessing.h:51
const String & getCustomizations() const 
returns a description of customizations 
std::vector< std::vector< Real > > decoded_list_
Definition: MzDataHandler.h:191
Big endian type. 
Definition: Base64.h:78
Description of a MS instrument. 
Definition: Instrument.h:64
DoubleReal getScanTime() const 
returns the scan time for a single scan (in s) 
XML handler for MzDataFile. 
Definition: MzDataHandler.h:60
Description of the settings a MS Instrument was run with. 
Definition: InstrumentSettings.h:48
DoubleReal getVolume() const 
returns the volume (in ml) (default: 0.0) 
A more convenient string class. 
Definition: String.h:56
Precursor meta information. 
Definition: Precursor.h:56
Class to encode and decode Base64. 
Definition: Base64.h:64
const ProgressLogger & logger_
Progress logger. 
Definition: MzDataHandler.h:204
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:94
void warning(const xercesc::SAXParseException &exception)
const std::vector< IonSource > & getIonSources() const 
returns a const reference to the ion source list 
UInt getMSLevel() const 
Returns the MS level. 
Definition: MSSpectrum.h:231
void setOptions(const PeakFileOptions &options)
Sets the options. 
Definition: MzDataHandler.h:115
void writeCVS_(std::ostream &os, UInt value, UInt map, const String &acc, const String &name, UInt indent=4)
write cvParam element to stream 
Definition: MzDataHandler.h:262
DoubleReal getAccuracy() const 
returns the mass accuracy i.e. how much the theoretical mass may differ from the measured mass (in pp...
IntensityType getIntensity() const 
Definition: Peak1D.h:103
ScanDirection getScanDirection() const 
returns the direction of scanning 
AcquisitionMode
Acquisition mode. 
Definition: IonDetector.h:82
Peak data (also called centroided data or stick data) 
Definition: SpectrumSettings.h:74
bool skip_spectrum_
Flag that indicates whether this spectrum should be skipped (due to options) 
Definition: MzDataHandler.h:201
std::vector< std::pair< String, MetaInfoDescription > > meta_id_descs_
An array of pairs MetaInfodescriptions and their ids. 
Definition: MzDataHandler.h:186
bool has(const Key &key) const 
Test whether the map contains the given key. 
Definition: Map.h:87
const std::set< ProcessingAction > & getProcessingActions() const 
returns a const reference to the applied processing actions 
std::vector< String > data_to_decode_
encoded data which is read and has to be decoded 
Definition: MzDataHandler.h:188
virtual void characters(const XMLCh *const chars, const XMLSize_t length)
Parsing method for character data. 
Definition: MzDataHandler.h:338
Negative polarity. 
Definition: IonSource.h:144
DataProcessing data_processing_
Definition: MzDataHandler.h:331
const std::vector< MassAnalyzer > & getMassAnalyzers() const 
returns a const reference to the mass analyer list 
DoubleReal getActivationEnergy() const 
returns the activation energy (in electronvolt) 
DoubleReal end
End of the window. 
Definition: ScanWindow.h:64
Peak2D PeakType
Definition: MassTrace.h:49
const AcquisitionInfo & getAcquisitionInfo() const 
returns a const reference to the acquisition info 
void writeBinary_(std::ostream &os, Size size, const String &tag, const String &name="", SignedSize id=-1)
write binary data to stream (first one) 
Definition: MzDataHandler.h:308
Enhanced multiply charged scan. 
Definition: InstrumentSettings.h:65
CoordinateType getMZ() const 
Non-mutable access to m/z. 
Definition: Peak1D.h:108
Positive polarity. 
Definition: IonSource.h:143
AnalyzerType getType() const 
returns the analyzer type 
Int getCharge() const 
Non-mutable access to the charge. 
Base class for XML handlers. 
Definition: XMLHandler.h:89
Base64 decoder_
Decoder/Encoder for Base64-data in MzData. 
Definition: MzDataHandler.h:198
ptrdiff_t SignedSize
Signed Size type e.g. used as pointer difference. 
Definition: Types.h:151
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
void writeCVS_(std::ostream &os, const String &value, const String &acc, const String &name, UInt indent=4) const 
write cvParam containing strings to stream 
Definition: MzDataHandler.h:241
Raw data (also called profile data) 
Definition: SpectrumSettings.h:75
DoubleReal getMagneticFieldStrength() const 
returns the strength of the magnetic field (in T) 
XMLHandler()
Not implemented. 
Little endian type. 
Definition: Base64.h:79
DoubleReal begin
Begin of the window. 
Definition: ScanWindow.h:62
ScanDirection
direction of scanning 
Definition: MassAnalyzer.h:103
MS2+ mass spectrum, is a "mass spectrum". 
Definition: InstrumentSettings.h:58
void init_()
Definition: MzDataHandler.h:121
PeakFileOptions options_
Options that can be set for loading/storing. 
Definition: MzDataHandler.h:177
DoubleReal getTOFTotalPathLength() const 
returns the path length for a TOF mass analyzer (in meter) 
InletType
inlet type 
Definition: IonSource.h:52
Type
Detector type. 
Definition: IonDetector.h:52
Unknown spectrum type. 
Definition: SpectrumSettings.h:73
Selected reaction monitoring scan   Synonyms: 'Multiple reaction monitoring scan', 'SRM scan', 'MRM scan'. 
Definition: InstrumentSettings.h:60
ResolutionType
Resolution type. 
Definition: MassAnalyzer.h:92
SpectrumType getType() const 
returns the spectrum type 
const String & getIdentifier() const 
return the identifier/index/number of the acquisition 
bool getZoomScan() const 
return if this scan is a zoom (enhanced resolution) scan 
ScanMode getScanMode() const 
returns the scan mode 
const std::set< ActivationMethod > & getActivationMethods() const 
returns a const reference to the activation methods 
void writeUserParam_(std::ostream &os, const MetaInfoInterface &meta, UInt indent=4)
Writing the MetaInfo as UserParam to the file. 
Definition: MzDataHandler.h:280
ScanLaw getScanLaw() const 
returns the scan law 
DoubleReal getScanRate() const 
returns the scan rate (in s) 
void get(UInt &month, UInt &day, UInt &year, UInt &hour, UInt &minute, UInt &second) const 
Fills the arguments with the date and the time. 
ResolutionMethod
resolution method 
Definition: MassAnalyzer.h:80
DoubleReal getConcentration() const 
returns the concentration (in g/l) (default: 0.0) 
virtual void startElement(const XMLCh *const , const XMLCh *const , const XMLCh *const qname, const xercesc::Attributes &attributes)
Parsing method for opening tags. 
Definition: MzDataHandler.h:436
Int toInt() const 
Conversion to int. 
DoubleReal getIsolationWidth() const 
returns the isolation width i.e. in which m/z range the precursor ion is selected for MS to the n (in...
const std::vector< ScanWindow > & getScanWindows() const 
returns a const reference to the m/z scan windows 
std::vector< String > precisions_
Definition: MzDataHandler.h:193
ResolutionMethod getResolutionMethod() const 
returns the method used for determination of the resolution 
void fillData_()
fills the current spectrum with peaks and meta data 
Definition: MzDataHandler.h:722
void writeCVS_(std::ostream &os, DoubleReal value, const String &acc, const String &name, UInt indent=4) const 
write cvParam containing strings to stream 
Definition: MzDataHandler.h:222
MapType * exp_
map pointer for reading 
Definition: MzDataHandler.h:172
Storing a file. 
Definition: XMLHandler.h:109
MSSpectrum< PeakType > SpectrumType
Spectrum type. 
Definition: MzDataHandler.h:169
const String & getModel() const 
returns the instrument model 
String & trim()
removes whitespaces (space, tab, line feed, carriage return) at the beginning and the end of the stri...
Scan window description. 
Definition: ScanWindow.h:47
const String & getVendor() const 
returns the instrument vendor 
ReflectronState getReflectronState() const 
returns the reflectron state (for TOF) 
std::vector< Real > data_to_encode_
floating point numbers which have to be encoded and written 
Definition: MzDataHandler.h:190
MzDataHandler(const MapType &exp, const String &filename, const String &version, const ProgressLogger &logger)
Constructor for a read-only handler. 
Definition: MzDataHandler.h:81
MapType::PeakType PeakType
Peak type. 
Definition: MzDataHandler.h:167
Meta information about the sample. 
Definition: Sample.h:60
ReflectronState
Reflectron state. 
Definition: MassAnalyzer.h:126
full scan mass spectrum, is a "mass spectrum"   Synonyms: 'full spectrum', 'Q1 spectrum', 'Q3 spectrum', 'Single-Stage Mass Spectrometry' 
Definition: InstrumentSettings.h:57
Information about one raw data spectrum that was combined with several other raw data spectra...
Definition: Acquisition.h:50
const MapType * cexp_
map pointer for writing 
Definition: MzDataHandler.h:174
const Software & getSoftware() const 
returns a const reference to the software used for processing 
virtual ~MzDataHandler()
Destructor. 
Definition: MzDataHandler.h:95
IonizationMethod
ionization method 
Definition: IonSource.h:80
const String & getName() const 
returns the name of the software 
std::vector< std::vector< DoubleReal > > decoded_double_list_
Definition: MzDataHandler.h:192
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
Time-delayed fragmentation scan. 
Definition: InstrumentSettings.h:66
Invalid conversion exception. 
Definition: Exception.h:363
DoubleReal getResolution() const 
returns the resolution 
MzDataHandler(MapType &exp, const String &filename, const String &version, ProgressLogger &logger)
Constructor for a write-only handler. 
Definition: MzDataHandler.h:67
Consecutive reaction monitoring scan   Synonyms: 'CRM scan'. 
Definition: InstrumentSettings.h:61
std::vector< String > endians_
Definition: MzDataHandler.h:194
UInt peak_count_
The number of peaks in the current spectrum. 
Definition: MzDataHandler.h:182
SampleState
state of aggregation of the sample 
Definition: Sample.h:65
const String & getVersion() const 
returns the software version 
const DateTime & getCompletionTime() const 
returns the time of completition of the processing 
IonSource::Polarity getPolarity() const 
returns the polarity 
SpectrumType spec_
The current spectrum. 
Definition: MzDataHandler.h:184
size_t Size
Size type e.g. used as variable which can hold result of size() 
Definition: Types.h:144
const String & getMethodOfCombination() const 
returns the method of combination 
Unknown scan method. 
Definition: InstrumentSettings.h:55
Absorbtion scan. 
Definition: InstrumentSettings.h:69
DateTime Class. 
Definition: DateTime.h:55
Base class for all classes that want to report their progess. 
Definition: ProgressLogger.h:56
const String & getName() const 
returns the name of the instrument 
Int getFinalMSExponent() const 
returns the final MS exponent 
String substr(size_t pos=0, size_t n=npos) const 
Wrapper for the STL substr() method. Returns a String object with its contents initialized to a subst...
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:195
const InstrumentSettings & getInstrumentSettings() const 
returns a const reference to the instrument settings of the current spectrum 
Peak picking (conversion from raw to peak data) 
Definition: DataProcessing.h:67
Precursor ion scan. 
Definition: InstrumentSettings.h:64
DoubleReal getMass() const 
returns the mass (in gram) (default: 0.0) 
general spectrum type 
Definition: InstrumentSettings.h:56
DoubleReal getRT() const 
Definition: MSSpectrum.h:215
const std::vector< Precursor > & getPrecursors() const 
returns a const reference to the precursors 
Constant neutral gain scan   Synonyms: 'CNG scan'. 
Definition: InstrumentSettings.h:62
ActivationMethod
Method of activation. 
Definition: Precursor.h:64
Options for loading files containing peak data. 
Definition: PeakFileOptions.h:47
std::vector< std::vector< String > > cv_terms_
Array of CV term lists (one sublist denotes one term and it's children) 
Definition: XMLHandler.h:192
AnalyzerType
analyzer type 
Definition: MassAnalyzer.h:53
const FloatDataArrays & getFloatDataArrays() const 
Returns a const reference to the float meta data arrays. 
Definition: MSSpectrum.h:270
static const std::string NamesOfScanMode[SIZE_OF_SCANMODE]
Names of scan modes. 
Definition: InstrumentSettings.h:74
const String & getNativeID() const 
returns the native identifier for the spectrum, used by the acquisition software. ...
ScanLaw
Scan law. 
Definition: MassAnalyzer.h:114
int Int
Signed integer type. 
Definition: Types.h:100
virtual void endElement(const XMLCh *const , const XMLCh *const , const XMLCh *const qname)
Parsing method for closing tags. 
Definition: MzDataHandler.h:686
Map class based on the STL map (containing serveral convenience functions) 
Definition: Map.h:50
Descripton of a mass analyzer (part of a MS Instrument) 
Definition: MassAnalyzer.h:48
bool split(const char splitter, std::vector< String > &substrings, bool quote_protect=false) const 
Splits a string into substrings using splitter as delimiter. 
const String & getName() const 
retuns the sample name (default: "") 
Charge deconvolution. 
Definition: DataProcessing.h:61
void cvParam_(const String &name, const String &value)
read attributes of MzData's cvParamType 
Definition: MzDataHandler.h:1313
ResolutionType getResolutionType() const 
returns the resolution type 
Polarity
Polarity of the ion source. 
Definition: IonSource.h:140
SampleState getState() const 
returns the state of aggregation (default: SAMPLENULL) 
void writeTo(std::ostream &os)
Writes the contents to a stream. 
Definition: MzDataHandler.h:816
bool hasPrefix(const String &string) const 
true if String begins with string, false otherwise