73 double lm = intercept + rt_coef * diff_rt * diff_rt +
75 return 1.0 / (1.0 + exp(-lm));
87 return (rt - min_rt) / (max_rt - min_rt) * 100;
119 double feature_rt,
DoubleList& feature_intensities,
120 const std::set<String>& transition_ids = std::set<String>());
130 n_decoys_ = n_decoys;
131 n_transitions_ = n_transitions;
132 rt_trafo_ = rt_trafo;
137 glm_.intercept = intercept;
138 glm_.rt_coef = rt_coef;
139 glm_.int_coef = int_coef;
161 "There need to be at least 2 assays in the library for ConfidenceScoring.");
164 if (n_assays - 1 < n_decoys_)
167 <<
") is higher than the number of unrelated assays in the "
168 <<
"library (" << n_assays - 1 <<
"). "
169 <<
"Using all unrelated assays as decoys." << std::endl;
171 if (n_assays - 1 <= n_decoys_) n_decoys_ = 0;
173 decoy_index_.resize(n_assays);
174 for (
Size i = 0; i < n_assays; ++i) decoy_index_[i] = boost::numeric_cast<Int>(i);
181 transition_map_[ref].push_back(boost::numeric_cast<Int>(i));
185 rt_norm_.min_rt = std::numeric_limits<double>::infinity();
186 rt_norm_.max_rt = -std::numeric_limits<double>::infinity();
187 for (std::vector<TargetedExperiment::Peptide>::const_iterator it =
191 double current_rt = getAssayRT_(*it);
192 if (current_rt == -1.0)
continue;
193 rt_norm_.min_rt = std::min(rt_norm_.min_rt, current_rt);
194 rt_norm_.max_rt = std::max(rt_norm_.max_rt, current_rt);
199 startProgress(0, features.
size(),
"scoring features");
202 feat_it != features.
end(); ++feat_it)
205 <<
" (ID '" << feat_it->getUniqueId() <<
"')"<< std::endl;
206 scoreFeature_(*feat_it);
207 setProgress(feat_it - features.
begin());
#define OPENMS_LOG_DEBUG
Macro for general debugging information.
Definition: LogStream.h:480
#define OPENMS_LOG_WARN
Macro if a warning, a piece of information which should be read by the user, should be logged.
Definition: LogStream.h:470
Definition: ConfidenceScoring.h:54
double scoreAssay_(const TargetedExperiment::Peptide &assay, double feature_rt, DoubleList &feature_intensities, const std::set< String > &transition_ids=std::set< String >())
void scoreMap(FeatureMap &features)
Score a feature map -> make sure the class is properly initialized.
Definition: ConfidenceScoring.h:154
void chooseDecoys_()
Randomize the list of decoy indexes.
std::map< String, IntList > transition_map_
assay (ID) -> transitions (indexes)
Definition: ConfidenceScoring.h:97
TargetedExperiment library_
assay library
Definition: ConfidenceScoring.h:91
Math::RandomShuffler shuffler_
random shuffler for container
Definition: ConfidenceScoring.h:104
IntList decoy_index_
indexes of assays to use as decoys
Definition: ConfidenceScoring.h:93
Size n_decoys_
number of decoys to use (per feature/true assay)
Definition: ConfidenceScoring.h:95
double getAssayRT_(const TargetedExperiment::Peptide &assay)
Get the retention time of an assay.
~ConfidenceScoring() override
Definition: ConfidenceScoring.h:60
TransformationDescription rt_trafo_
RT transformation to map measured RTs to assay RTs.
Definition: ConfidenceScoring.h:102
double manhattanDist_(DoubleList x, DoubleList y)
Manhattan distance.
ConfidenceScoring(bool test_mode_=false)
Constructor.
void scoreFeature_(Feature &feature)
Score a feature.
void initializeGlm(double intercept, double rt_coef, double int_coef)
Definition: ConfidenceScoring.h:135
Size n_transitions_
number of transitions to consider
Definition: ConfidenceScoring.h:99
void initialize(const TargetedExperiment &library, const Size n_decoys, const Size n_transitions, const TransformationDescription &rt_trafo)
Definition: ConfidenceScoring.h:127
A method or algorithm argument contains illegal values.
Definition: Exception.h:650
size_t size() const noexcept
Definition: ExposedVector.h:147
iterator begin() noexcept
Definition: ExposedVector.h:123
iterator end() noexcept
Definition: ExposedVector.h:127
A container for features.
Definition: FeatureMap.h:106
iterator Iterator
Definition: FeatureMap.h:113
An LC-MS feature.
Definition: Feature.h:72
Definition: MathFunctions.h:408
Base class for all classes that want to report their progress.
Definition: ProgressLogger.h:53
A more convenient string class.
Definition: String.h:60
Represents a peptide (amino acid sequence)
Definition: TargetedExperimentHelper.h:360
A description of a targeted experiment containing precursor and production ions.
Definition: TargetedExperiment.h:65
const std::vector< Peptide > & getPeptides() const
const std::vector< ReactionMonitoringTransition > & getTransitions() const
returns the transition list
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:127
std::vector< Int > IntList
Vector of signed integers.
Definition: ListUtils.h:55
std::vector< double > DoubleList
Vector of double precision real types.
Definition: ListUtils.h:62
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:48
Binomial GLM.
Definition: ConfidenceScoring.h:66
double rt_coef
Definition: ConfidenceScoring.h:68
double int_coef
Definition: ConfidenceScoring.h:69
double operator()(double diff_rt, double dist_int) const
Definition: ConfidenceScoring.h:71
double intercept
Definition: ConfidenceScoring.h:67
Helper for RT normalization (range 0-100)
Definition: ConfidenceScoring.h:81
double min_rt
Definition: ConfidenceScoring.h:82
double max_rt
Definition: ConfidenceScoring.h:83
double operator()(double rt) const
Definition: ConfidenceScoring.h:85