Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages

MzQuantMLHandler.h

Go to the documentation of this file.
00001 // --------------------------------------------------------------------------
00002 //                   OpenMS -- Open-Source Mass Spectrometry
00003 // --------------------------------------------------------------------------
00004 // Copyright The OpenMS Team -- Eberhard Karls University Tuebingen,
00005 // ETH Zurich, and Freie Universitaet Berlin 2002-2012.
00006 //
00007 // This software is released under a three-clause BSD license:
00008 //  * Redistributions of source code must retain the above copyright
00009 //    notice, this list of conditions and the following disclaimer.
00010 //  * Redistributions in binary form must reproduce the above copyright
00011 //    notice, this list of conditions and the following disclaimer in the
00012 //    documentation and/or other materials provided with the distribution.
00013 //  * Neither the name of any author or any participating institution
00014 //    may be used to endorse or promote products derived from this software
00015 //    without specific prior written permission.
00016 // For a full list of authors, refer to the file AUTHORS.
00017 // --------------------------------------------------------------------------
00018 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00019 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00020 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00021 // ARE DISCLAIMED. IN NO EVENT SHALL ANY OF THE AUTHORS OR THE CONTRIBUTING
00022 // INSTITUTIONS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00023 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00024 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
00025 // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
00026 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
00027 // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
00028 // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00029 //
00030 // --------------------------------------------------------------------------
00031 // $Maintainer: Mathias Walzer $
00032 // $Authors: Mathias Walzer $
00033 // --------------------------------------------------------------------------
00034 
00035 #ifndef OPENMS_FORMAT_HANDLERS_MZQUANTMLHANDLER_H
00036 #define OPENMS_FORMAT_HANDLERS_MZQUANTMLHANDLER_H
00037 
00038 #include <OpenMS/FORMAT/HANDLERS/XMLHandler.h>
00039 #include <OpenMS/FORMAT/ControlledVocabulary.h>
00040 #include <OpenMS/CONCEPT/UniqueIdGenerator.h>
00041 #include <OpenMS/METADATA/MSQuantifications.h>
00042 
00043 namespace OpenMS
00044 {
00045   class ProgressLogger;
00046 
00047   namespace Internal
00048   {
00049 
00055     class OPENMS_DLLAPI MzQuantMLHandler :
00056       public XMLHandler
00057     {
00058 public:
00061 
00062       MzQuantMLHandler(const MSQuantifications & msq, const String & filename, const String & version, const ProgressLogger & logger);
00063 
00065       MzQuantMLHandler(MSQuantifications & msq, const String & filename, const String & version, const ProgressLogger & logger);
00066 
00068       virtual ~MzQuantMLHandler();
00070 
00071 
00072       // Docu in base class
00073       virtual void endElement(const XMLCh * const /*uri*/, const XMLCh * const /*local_name*/, const XMLCh * const qname);
00074 
00075       // Docu in base class
00076       virtual void startElement(const XMLCh * const /*uri*/, const XMLCh * const /*local_name*/, const XMLCh * const qname, const xercesc::Attributes & attributes);
00077 
00078       // Docu in base class
00079       virtual void characters(const XMLCh * const chars, const XMLSize_t length);
00080 
00081       //Docu in base class
00082       virtual void writeTo(std::ostream & os);
00083 
00084 protected:
00085 
00087       const ProgressLogger & logger_;
00088 
00090       ControlledVocabulary cv_;
00091 
00092       String tag_;
00093 
00094       MSQuantifications * msq_;
00095 
00096       const MSQuantifications * cmsq_;
00097 
00099       void handleCVParam_(const String & parent_parent_tag, const String & parent_tag, const String & accession, const String & name, const String & value, const xercesc::Attributes & attributes, const String & cv_ref, const String & unit_accession = "");
00100 
00102       void handleUserParam_(const String & parent_parent_tag, const String & parent_tag, const String & name, const String & type, const String & value);
00103 
00105       //~ TODO rewirte writeCVParams_ in baseclass to be more convenient
00106       //~ void MzQuantMLHandler::writeCVParams_(std::ostream& os, const Map< String, std::vector < CVTerm > > & , UInt indent);
00107       void writeCVParams_(String & s, const Map<String, std::vector<CVTerm> > &, UInt indent);
00108 
00110       void writeUserParams_(std::ostream & os, const MetaInfoInterface & meta, UInt indent);
00111       void writeUserParams_(String & s, const MetaInfoInterface & meta, UInt indent);
00112 
00114       ControlledVocabulary::CVTerm getChildWithName_(const String & parent_accession, const String & name) const;
00115 
00116 
00118       void writeFeature_(std::ostream & os, const String & identifier_prefix, UInt64 identifier, UInt indentation_level);
00119 
00121       //void writeSourceFile_(std::ostream& os, const String& id, const SourceFile& software);
00122 
00123 
00124 private:
00125       MzQuantMLHandler();
00126       MzQuantMLHandler(const MzQuantMLHandler & rhs);
00127       MzQuantMLHandler & operator=(const MzQuantMLHandler & rhs);
00128 
00129       std::map<String, std::vector<ExperimentalSettings> > current_files_;           // 1.rawfilesgroup_ref 2.inputfiles for each assay as experimentalsettings
00130       String current_id_;
00131       String current_cf_id_;
00132       Size current_count_;
00133 
00134       std::vector<MetaInfo> up_stack_;
00135       std::vector<CVTerm> cvp_stack_;
00136       MSQuantifications::Assay current_assay_;
00137 
00138       std::multimap<String, String> cm_cf_ids_;
00139       std::map<String, String> f_cf_ids_;
00140       std::map<String, ConsensusFeature> cf_cf_obj_;
00141       std::map<String, FeatureHandle> f_f_obj_;
00142       std::map<String, ConsensusFeature::Ratio> r_rtemp_;
00143       std::map<String, String> numden_r_ids_;
00144       std::map<String, ConsensusFeature::Ratio> r_r_obj_;
00145 
00146       //~ Software current_sw_;
00147       std::map<String, Software> current_sws_;
00148       std::map<int, DataProcessing> current_orderedps_;
00149       std::pair<int, DataProcessing> current_dp_;
00150       std::set<DataProcessing::ProcessingAction> current_pas_;
00151 
00152       std::vector<String> current_col_types_;
00153       std::vector<DoubleReal> current_dm_values_;
00154       std::vector<DoubleReal> current_row_;
00155 
00156     };
00157   }   // namespace Internal
00158 } // namespace OpenMS
00159 
00160 #endif

OpenMS / TOPP release 1.10.0 Documentation generated on Thu Mar 7 2013 09:42:42 using doxygen 1.7.1