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

Method markMS2Locations_

src/topp/ImageCreator.cpp:101–136  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

99 }
100
101 void markMS2Locations_(PeakMap& exp, QImage& image, bool transpose,
102 QColor color, Size size)
103 {
104 double xcoef = image.width(), ycoef = image.height();
105 if (transpose)
106 {
107 xcoef /= exp.getMaxRT() - exp.getMinRT();
108 ycoef /= exp.getMaxMZ() - exp.getMinMZ();
109 }
110 else
111 {
112 xcoef /= exp.getMaxMZ() - exp.getMinMZ();
113 ycoef /= exp.getMaxRT() - exp.getMinRT();
114 }
115 for (PeakMap::Iterator spec_iter = exp.begin();
116 spec_iter != exp.end(); ++spec_iter)
117 {
118 if (spec_iter->getMSLevel() == 2)
119 {
120 double mz = spec_iter->getPrecursors()[0].getMZ();
121 double rt = exp.getPrecursorSpectrum(spec_iter)->getRT();
122 int x, y;
123 if (transpose)
124 {
125 x = int(xcoef * (rt - exp.getMinRT()));
126 y = int(ycoef * (exp.getMaxMZ() - mz));
127 }
128 else
129 {
130 x = int(xcoef * (mz - exp.getMinMZ()));
131 y = int(ycoef * (exp.getMaxRT() - rt));
132 }
133 addPoint_(x, y, image, color, size); //mark MS2
134 }
135 }
136 }
137
138 void markFeatureLocations_(FeatureMap& feature_map, PeakMap& exp, QImage& image, bool transpose, QColor color)
139 {

Callers

nothing calls this directly

Calls 13

widthMethod · 0.80
heightMethod · 0.80
getMaxRTMethod · 0.80
getMinRTMethod · 0.80
getMaxMZMethod · 0.80
getMinMZMethod · 0.80
getMSLevelMethod · 0.80
getPrecursorsMethod · 0.80
getPrecursorSpectrumMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
getMZMethod · 0.45

Tested by

no test coverage detected