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

MzIdentMLHandler.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, Andreas Bertsch $
00033 // --------------------------------------------------------------------------
00034 
00035 #ifndef OPENMS_FORMAT_HANDLERS_MZIDENTMLHANDLER_H
00036 #define OPENMS_FORMAT_HANDLERS_MZIDENTMLHANDLER_H
00037 
00038 #include <OpenMS/KERNEL/StandardTypes.h>
00039 
00040 #include <OpenMS/FORMAT/HANDLERS/XMLHandler.h>
00041 #include <OpenMS/FORMAT/ControlledVocabulary.h>
00042 #include <OpenMS/METADATA/IdentificationHit.h>
00043 #include <OpenMS/METADATA/Identification.h>
00044 #include <OpenMS/METADATA/ProteinHit.h>
00045 #include <OpenMS/CHEMISTRY/AASequence.h>
00046 #include <OpenMS/CONCEPT/UniqueIdGenerator.h>
00047 #include <OpenMS/METADATA/ProteinIdentification.h>
00048 #include <OpenMS/METADATA/PeptideIdentification.h>
00049 
00050 #include <vector>
00051 
00052 namespace OpenMS
00053 {
00054   class ProgressLogger;
00055 
00056   namespace Internal
00057   {
00058 
00064     class OPENMS_DLLAPI MzIdentMLHandler :
00065       public XMLHandler
00066     {
00067 public:
00070 
00071       MzIdentMLHandler(const Identification & id, const String & filename, const String & version, const ProgressLogger & logger);
00073       MzIdentMLHandler(const std::vector<ProteinIdentification> & pro_id, const std::vector<PeptideIdentification> & pep_id, const String & filename, const String & version, const ProgressLogger & logger);
00074 
00076       MzIdentMLHandler(Identification & id, const String & filename, const String & version, const ProgressLogger & logger);
00078       MzIdentMLHandler(std::vector<ProteinIdentification> & pro_id, std::vector<PeptideIdentification> & pep_id, const String & filename, const String & version, const ProgressLogger & logger);
00079 
00081       virtual ~MzIdentMLHandler();
00083 
00084 
00085       // Docu in base class
00086       virtual void endElement(const XMLCh * const /*uri*/, const XMLCh * const /*local_name*/, const XMLCh * const qname);
00087 
00088       // Docu in base class
00089       virtual void startElement(const XMLCh * const /*uri*/, const XMLCh * const /*local_name*/, const XMLCh * const qname, const xercesc::Attributes & attributes);
00090 
00091       // Docu in base class
00092       virtual void characters(const XMLCh * const chars, const XMLSize_t length);
00093 
00094       //Docu in base class
00095       virtual void writeTo(std::ostream & os);
00096 
00097 protected:
00098 
00100       const ProgressLogger & logger_;
00101 
00103       ControlledVocabulary cv_;
00105       ControlledVocabulary unimod_;
00106 
00107       //~ MSExperiment<>* ms_exp_;
00108 
00110       String tag_;
00111 
00113       Identification * id_;
00115       std::vector<ProteinIdentification> * pro_id_;
00117       std::vector<PeptideIdentification> * pep_id_;
00118 
00119       const Identification * cid_;
00120       const std::vector<ProteinIdentification> * cpro_id_;
00121       const std::vector<PeptideIdentification> * cpep_id_;
00122 
00124       SpectrumIdentification current_spectrum_id_;
00125 
00127       IdentificationHit current_id_hit_;
00128 
00130       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="" */);
00131 
00133       void handleUserParam_(const String & parent_parent_tag, const String & parent_tag, const String & name, const String & type, const String & value);
00134 
00136       void writeUserParam_(std::ostream & os, const MetaInfoInterface & meta, UInt indent) const;
00137 
00139       ControlledVocabulary::CVTerm getChildWithName_(const String & parent_accession, const String & name) const;
00140 
00142       //void writeSourceFile_(std::ostream& os, const String& id, const SourceFile& software);
00143 
00144 
00145 private:
00146       MzIdentMLHandler();
00147       MzIdentMLHandler(const MzIdentMLHandler & rhs);
00148       MzIdentMLHandler & operator=(const MzIdentMLHandler & rhs);
00149       Map<String, AASequence> pep_sequences_;
00150       AASequence actual_peptide_;
00151       Int current_mod_location_;
00152       ProteinHit actual_protein_;
00153 
00154     };
00155   }   // namespace Internal
00156 } // namespace OpenMS
00157 
00158 #endif

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