MCPcopy Create free account
hub / github.com/OpenMS/OpenMS / calculateVariance_

Method calculateVariance_

src/openms/source/QC/FragmentMassError.cpp:155–168  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

153 }
154
155 void FragmentMassError::calculateVariance_(FragmentMassError::Statistics& result, const PeptideIdentification& pep_id, const UInt num_ppm)
156 {
157 if (pep_id.getHits().empty())
158 {
159 OPENMS_LOG_WARN << "There is a Peptideidentification(RT: " << pep_id.getRT() << ", MZ: " << pep_id.getMZ() << ") without PeptideHits. "
160 << "\n";
161 return;
162 }
163 for (const auto& ppm : (pep_id.getHits()[0].getMetaValue("fragment_mass_error_ppm")).toDoubleList())
164 {
165 double tmp = ppm - result.average_ppm;
166 result.variance_ppm += (tmp * tmp / num_ppm);
167 }
168 }
169
170 void FragmentMassError::compute(FeatureMap& fmap, const MSExperiment& exp, const QCBase::SpectraMap& map_to_spectrum, ToleranceUnit tolerance_unit, double tolerance)
171 {

Callers

nothing calls this directly

Calls 5

toDoubleListMethod · 0.80
getMetaValueMethod · 0.80
emptyMethod · 0.45
getRTMethod · 0.45
getMZMethod · 0.45

Tested by

no test coverage detected