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

Method convert

src/openms/source/KERNEL/ConversionHelper.cpp:13–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11namespace OpenMS
12{
13 void MapConversion::convert(UInt64 const input_map_index,
14 PeakMap& input_map,
15 ConsensusMap& output_map,
16 Size n)
17 {
18 output_map.clear(true);
19
20 // see @todo above
21 output_map.setUniqueId();
22
23 input_map.updateRanges(1);
24 if (n > input_map.getSize())
25 {
26 n = input_map.getSize();
27 }
28 output_map.reserve(n);
29 std::vector<Peak2D> tmp;
30 tmp.reserve(input_map.getSize());
31
32 // TODO Avoid tripling the memory consumption by this call
33 input_map.get2DData(tmp);
34
35 std::partial_sort(tmp.begin(),
36 tmp.begin() + n,
37 tmp.end(),
38 [](auto &left, auto &right) {Peak2D::IntensityLess cmp; return cmp(right, left);});
39
40 for (Size element_index = 0; element_index < n; ++element_index)
41 {
42 output_map.push_back(ConsensusFeature(input_map_index,
43 tmp[element_index],
44 element_index));
45 }
46
47 output_map.getColumnHeaders()[input_map_index].size = n;
48 output_map.updateRanges();
49 }
50
51 void MapConversion::convert(ConsensusMap const& input_map,
52 const bool keep_uids,

Callers 15

startElementMethod · 0.45
endElementMethod · 0.45
startElementMethod · 0.45
endElementMethod · 0.45
CompressedInputSourceMethod · 0.45
makeStreamMethod · 0.45
parseFunction · 0.45
parse_Method · 0.45
parseBuffer_Method · 0.45
startElementMethod · 0.45
endElementMethod · 0.45
charactersMethod · 0.45

Calls 14

setUniqueIdMethod · 0.80
getUniqueIdMethod · 0.80
ConsensusFeatureFunction · 0.50
clearMethod · 0.45
updateRangesMethod · 0.45
getSizeMethod · 0.45
reserveMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
push_backMethod · 0.45
resizeMethod · 0.45
sizeMethod · 0.45

Tested by 3

domParseString_Method · 0.36
test_MapConversionFunction · 0.36