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

ItraqQuantifier.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: Chris Bielow $
00032 // $Authors: Chris Bielow $
00033 // --------------------------------------------------------------------------
00034 
00035 #ifndef OPENMS_ANALYSIS_QUANTITATION_ITRAQQUANTIFIER_H
00036 #define OPENMS_ANALYSIS_QUANTITATION_ITRAQQUANTIFIER_H
00037 
00038 #include <vector>
00039 
00040 #include <OpenMS/ANALYSIS/QUANTITATION/ItraqConstants.h>
00041 #include <OpenMS/KERNEL/ConsensusMap.h>
00042 #include <OpenMS/METADATA/ProteinIdentification.h>
00043 #include <OpenMS/METADATA/PeptideIdentification.h>
00044 
00045 
00046 namespace OpenMS
00047 {
00048 
00057   class OPENMS_DLLAPI ItraqQuantifier :
00058     public DefaultParamHandler,
00059     public ItraqConstants
00060   {
00061 
00062 public:
00063 
00064     typedef ItraqConstants::ChannelInfo ChannelInfo;
00065     typedef ItraqConstants::ChannelMapType ChannelMapType;
00066     typedef ItraqConstants::IsotopeMatrices IsotopeMatrices;
00067 
00069     ItraqQuantifier();
00070 
00072     explicit ItraqQuantifier(Int itraq_type);
00073 
00075     ItraqQuantifier(Int itraq_type, const Param & param);
00076 
00078     ItraqQuantifier(const ItraqQuantifier & cp);
00079 
00081     ItraqQuantifier & operator=(const ItraqQuantifier & rhs);
00082 
00092     void run(const ConsensusMap & consensus_map_in,
00093              ConsensusMap & consensus_map_out
00094              );
00095 
00099     struct ItraqQuantifierStats
00100     {
00101       ItraqQuantifierStats() :
00102         channel_count(0),
00103         iso_number_ms2_negative(0),
00104         iso_number_reporter_negative(0),
00105         iso_number_reporter_different(0),
00106         iso_solution_different_intensity(0),
00107         iso_total_intensity_negative(0),
00108         number_ms2_total(0),
00109         number_ms2_empty(0),
00110         empty_channels()
00111       {
00112       }
00113 
00114       Size channel_count;  //< 4plex, 6plex, or 8 plex?!
00115       Size iso_number_ms2_negative; //< number of MS2 spectra where one or more channels had negative solution
00116       Size iso_number_reporter_negative;  //< number of channels where naive solution was negative
00117       Size iso_number_reporter_different; //< number of channels >0 where naive solution was different; happens when naive solution is negative in other channels
00118       DoubleReal iso_solution_different_intensity; //< absolute intensity difference between both solutions (for channels > 0)
00119       DoubleReal iso_total_intensity_negative; //< only for spectra where naive solution is negative
00120       Size number_ms2_total; //< total number of MS2 spectra
00121       Size number_ms2_empty; //< number of empty MS2 (no reporters at all)
00122       std::map<Size, Size> empty_channels; //< Channel_ID -> Missing; indicating the number of empty channels from all MS2 scans, i.e., numbers are between number_ms2_empty and number_ms2_total
00123     };
00124 
00125     ItraqQuantifierStats getStats() const;
00126 
00127 protected:
00128 
00129     void setDefaultParams_();
00130 
00131     void updateMembers_();
00132 
00133 private:
00134 
00136     void initIsotopeCorrections_();
00137 
00138     void reconstructChannelInfo_(const ConsensusMap & consensus_map);
00139 
00145     bool isIdentityCorrectionMatrix_(const Matrix<double>& channel_frequency) const;
00146     
00148     Int itraq_type_;
00149 
00152     ChannelMapType channel_map_;
00153 
00155     IsotopeMatrices isotope_corrections_;
00156 
00158     ItraqQuantifierStats stats_;
00159 
00160   };   // !class
00161 
00162   OPENMS_DLLAPI std::ostream & operator<<(std::ostream & os, const ItraqQuantifier::ItraqQuantifierStats & stats);
00163 
00164 } // !namespace
00165 
00166 #endif // OPENMS_ANALYSIS_QUANTITATION_ITRAQQUANTIFIER_H

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