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

Method getDistribution

src/openms_gui/source/VISUAL/VISITORS/LayerStatistics.cpp:113–138  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

111 }
112
113 Math::Histogram<> LayerStatisticsPeakMap::getDistribution(const RangeStatsType& which, const UInt number_of_bins) const
114 {
115 auto mm = getMinMax(overview_range_data_, which, "PeakMap"); // may throw if unknown statistic
116 Math::Histogram<> result(mm.min, mm.max, (mm.max - mm.min) / number_of_bins);
117
118 if (which == RangeStatsType{ RangeStatsSource::CORE, "intensity" })
119 {
120 for (const auto& spec : *pm_)
121 {
122 for (const auto& peak : spec)
123 {
124 result.inc(peak.getIntensity());
125 }
126 }
127 }
128 else if (which.src == RangeStatsSource::ARRAYINFO)
129 {
130 for (const auto& spec : *pm_)
131 {
132 std::visit(overload {[&](const RangeStatsInt& /*int_range*/) { updateHistFromDataArray(spec.getIntegerDataArrays(), which.name, result); },
133 [&](const RangeStatsDouble& /*double_range*/) { updateHistFromDataArray(spec.getFloatDataArrays(), which.name, result); }}
134 , overview_range_data_.at(which));
135 }
136 }
137 return result;
138 }
139
140 LayerStatisticsFeatureMap::LayerStatisticsFeatureMap(const FeatureMap& fm) : fm_(&fm)
141 {

Callers 1

addRangeRowFunction · 0.45

Calls 10

getMinMaxFunction · 0.85
updateHistFromDataArrayFunction · 0.85
addMetaDistributionValueFunction · 0.85
incMethod · 0.80
atMethod · 0.80
getOverallQualityMethod · 0.80
getIntensityMethod · 0.45
getChargeMethod · 0.45
getQualityMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected