Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 #ifndef OPENMS_ANALYSIS_OPENSWATH_OPENSWATHHELPER_H
00036 #define OPENMS_ANALYSIS_OPENSWATH_OPENSWATHHELPER_H
00037
00038 #include <OpenMS/KERNEL/MSExperiment.h>
00039 #include <OpenMS/ANALYSIS/TARGETED/TargetedExperiment.h>
00040 #include <OpenMS/ANALYSIS/OPENSWATH/OPENSWATHALGO/DATAACCESS/TransitionExperiment.h>
00041
00042 namespace OpenMS
00043 {
00047 class OPENMS_DLLAPI OpenSwathHelper
00048 {
00049
00050 public:
00051
00053 static void selectSwathTransitions(const OpenMS::TargetedExperiment& targeted_exp,
00054 OpenMS::TargetedExperiment& transition_exp_used, double min_upper_edge_dist,
00055 double lower, double upper);
00056
00058 static void checkSwathMap(const OpenMS::MSExperiment<Peak1D>& swath_map,
00059 double& lower, double& upper);
00060
00062 static void selectSwathTransitions(const OpenSwath::LightTargetedExperiment& targeted_exp,
00063 OpenSwath::LightTargetedExperiment& transition_exp_used, double min_upper_edge_dist,
00064 double lower, double upper);
00065
00066 template <class TargetedExperimentT>
00067 static bool checkSwathMapAndSelectTransitions(const OpenMS::MSExperiment<Peak1D>& exp,
00068 const TargetedExperimentT& targeted_exp, TargetedExperimentT& transition_exp_used, double min_upper_edge_dist)
00069 {
00070 if (exp.size() == 0 || exp[0].getPrecursors().size() == 0)
00071 {
00072 std::cerr << "WARNING: File " << exp.getLoadedFilePath()
00073 << " does not have any experiments or any precursors. Is it a SWATH map? "
00074 << "I will move to the next map."
00075 << std::endl;
00076 return false;
00077 }
00078 double upper, lower;
00079 OpenSwathHelper::checkSwathMap(exp, lower, upper);
00080 OpenSwathHelper::selectSwathTransitions(targeted_exp, transition_exp_used, min_upper_edge_dist, lower, upper);
00081 if (transition_exp_used.getTransitions().size() == 0)
00082 {
00083 std::cerr << "WARNING: For File " << exp.getLoadedFilePath()
00084 << " no transition were within the precursor window of " << lower << " to " << upper
00085 << "I will move to the next map."
00086 << std::endl;
00087 return false;
00088 }
00089 return true;
00090
00091 }
00092
00093 };
00094 }
00095 #endif