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

MSQuantifications.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_METADATA_MSQUANTIFICATIONS_H
00036 #define OPENMS_METADATA_MSQUANTIFICATIONS_H
00037 
00038 #include <OpenMS/METADATA/ExperimentalSettings.h>
00039 #include <OpenMS/CONCEPT/Exception.h>
00040 #include <OpenMS/KERNEL/ConsensusMap.h>
00041 //~ #include <OpenMS/KERNEL/ConsensusFeature.h>
00042 #include <OpenMS/KERNEL/FeatureMap.h>
00043 #include <OpenMS/KERNEL/MSExperiment.h>
00044 #include <OpenMS/METADATA/DataProcessing.h>
00045 
00046 #include <vector>
00047 #include <map>
00048 
00049 namespace OpenMS
00050 {
00051   class OPENMS_DLLAPI MSQuantifications :
00052     public ExperimentalSettings
00053   {
00054 public:
00056 
00057 
00058     typedef CVTermList ParamGroupList;         // userparams are exclusively inside the CVTermList's MetaInfoInterface
00059 
00060     enum QUANT_TYPES {MS1LABEL = 0, MS2LABEL, LABELFREE, SIZE_OF_QUANT_TYPES};       // derived from processing applied
00061     static const std::string NamesOfQuantTypes[SIZE_OF_QUANT_TYPES];
00062 
00064     //~ InputFiles: //~ searchdb abbildung version,releasedate,#entries,dbname über paramgrouplist
00065     //~ struct ParamGroupList
00066     //~ {
00067     //~ ParamGroupList()
00068     //~ {
00069     //~ }
00070 
00071     //~ ParamGroupList(const ParamGroupList& rhs)
00072     //~ : cv_params(rhs.cv_params)
00073     //~ {
00074     //~ }
00075 
00076     //~ ~ParamGroupList()
00077     //~ {
00078     //~ }
00079 
00080     //~ ParamGroupList& operator = (const ParamGroupList& rhs)
00081     //~ {
00082     //~ if (&rhs != this)
00083     //~ {
00084     //~ cv_params = rhs.cv_params;
00085     //~ user_params = rhs.user_params;
00086     //~ }
00087     //~ return *this;
00088     //~ }
00089 
00090     //~ MetaInfoInterface user_params;
00091     //~ CVTermList cv_params;
00092     //~ };
00093 
00094     struct AnalysisSummary
00095     {
00096       AnalysisSummary()
00097       {
00098       }
00099 
00100       AnalysisSummary(const AnalysisSummary & rhs) :
00101         cv_params_(rhs.cv_params_)
00102       {
00103         user_params_ = rhs.user_params_;
00104         quant_type_ = rhs.quant_type_;
00105       }
00106 
00107       virtual ~AnalysisSummary()
00108       {
00109       }
00110 
00111       AnalysisSummary & operator=(const AnalysisSummary & rhs)
00112       {
00113         if (&rhs != this)
00114         {
00115           cv_params_ = rhs.cv_params_;
00116           user_params_ = rhs.user_params_;
00117           quant_type_ = rhs.quant_type_;
00118         }
00119         return *this;
00120       }
00121 
00122       MetaInfo user_params_;
00123       CVTermList cv_params_;
00124       QUANT_TYPES quant_type_;
00125     };
00126 
00127     struct Assay
00128     {
00129       Assay()
00130       {
00131       }
00132 
00133       Assay(const Assay & rhs)
00134       {
00135         uid_ = rhs.uid_;
00136         mods_ = rhs.mods_;
00137         raw_files_ = rhs.raw_files_;
00138         feature_maps_ = rhs.feature_maps_;
00139       }
00140 
00141       virtual ~Assay()
00142       {
00143       }
00144 
00145       Assay & operator=(const Assay & rhs)
00146       {
00147         if (&rhs != this)
00148         {
00149           uid_ = rhs.uid_;
00150           mods_ = rhs.mods_;
00151           raw_files_ = rhs.raw_files_;
00152           feature_maps_ = rhs.feature_maps_;
00153         }
00154         return *this;
00155       }
00156 
00157       String uid_;
00158       std::vector<std::pair<String, DoubleReal> > mods_;
00159       std::vector<ExperimentalSettings> raw_files_;
00160       std::map<size_t, FeatureMap<> > feature_maps_;           // iTRAQ needs no FeatureMaps so ExperimentalSettings are not directly mapped to FeatureMaps
00161     };
00162 
00163     // TODO handle referencing from consensusmaps to featuremaps/rawfiles
00164     // TODO add ContactPerson or something to (Consensus)FeatureMap or DataProcessing (see below)
00165     // TODO rewrite OpenMS::DataProcessing - data not yet linked in openms core formats - below should go in analysissummary of MSQuantifications - input/output not possible to be carried along
00166     //~ if(DataProcessing::NamesOfProcessingAction[*it] == String("Quantitation"))
00167     //~ {
00168     //~ if (processing.getSoftware().getName()==String("SILACAnalyzer"))
00169     //~ {
00170     //~ experiment_type = MS1LABEL;
00171     //~ }
00172     //~ else if (processing.getSoftware().getName()==String("ITRAQAnalyzer"))
00173     //~ {
00174     //~ experiment_type = MS2LABEL;
00175     //~ }
00176     //~ else
00177     //~ {
00178     //~ experiment_type = LABELFREE;
00179     //~ }
00180     //~ }
00181     //~ QUANT_TYPES experiment_type = MS1LABEL;
00182 
00184     MSQuantifications();
00185 
00187     ~MSQuantifications();
00188 
00190     MSQuantifications(const MSQuantifications & source);
00191 
00193     MSQuantifications & operator=(const MSQuantifications & source);
00194 
00196     bool operator==(const MSQuantifications & rhs) const;
00197 
00199     bool operator!=(const MSQuantifications & rhs) const;
00200 
00212     void load(const String & filename, bool trim_lines = false, Int first_n = -1);
00213 
00214     const std::vector<DataProcessing> getDataProcessingList() const;
00215     const std::vector<Assay> & getAssays() const;
00216     std::vector<Assay> & getAssays();
00217     std::map<String, ConsensusFeature::Ratio> & getRatios();
00218     const std::vector<ConsensusMap> & getConsensusMaps() const;
00219     std::vector<ConsensusMap> & getConsensusMaps();
00220     const std::vector<FeatureMap<> > & getFeatureMaps() const;
00221     const AnalysisSummary & getAnalysisSummary() const;
00222     AnalysisSummary & getAnalysisSummary();
00223     void setDataProcessingList(std::vector<DataProcessing> & dpl);
00224     void setAnalysisSummaryQuantType(QUANT_TYPES r);
00225     void addConsensusMap(ConsensusMap & m);
00226     void assignUIDs();
00227     void registerExperiment(MSExperiment<Peak1D> & exp, std::vector<std::vector<std::pair<String, DoubleReal> > > labels);
00228 
00229 private:
00230     AnalysisSummary analysis_summary_;
00231     std::vector<MetaInfo> bibliographic_reference_;
00232     std::vector<ConsensusMap> consensus_maps_;
00233     std::vector<FeatureMap<> > feature_maps_;
00234     std::vector<Assay> assays_;
00235     std::vector<DataProcessing> data_processings_;
00236     //~ std::map<String,ConsensusFeature::Ratio > ratio_calculations_;
00237   };
00238 
00239 } // namespace OpenMS
00240 
00241 #endif // OPENMS_METADATA_MSQUANTIFICATIONS_H

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