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

Method loadFeatureAndSubordinates_

src/openms/source/FORMAT/OMSFileLoad.cpp:928–966  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

926
927
928 Feature OMSFileLoad::loadFeatureAndSubordinates_(
929 SQLite::Statement& query_feat, SQLite::Statement& query_meta,
930 SQLite::Statement& query_match, SQLite::Statement& query_hull)
931 {
932 int id = query_feat.getColumn("id").getInt();
933 Feature feature(makeBaseFeature_(id, query_feat, query_meta, query_match));
934 // Feature-specific attributes:
935 feature.setQuality(0, query_feat.getColumn("rt_quality").getDouble());
936 feature.setQuality(1, query_feat.getColumn("mz_quality").getDouble());
937 // convex hulls:
938 if (!isEmpty_(query_hull))
939 {
940 query_hull.bind(":id", id);
941 while (query_hull.executeStep())
942 {
943 Size hull_index = query_hull.getColumn("hull_index").getUInt();
944 // first row should have max. hull index (sorted descending):
945 if (feature.getConvexHulls().size() <= hull_index)
946 {
947 feature.getConvexHulls().resize(hull_index + 1);
948 }
949 ConvexHull2D::PointType point(query_hull.getColumn("point_x").getDouble(),
950 query_hull.getColumn("point_y").getDouble());
951 // @TODO: this may be inefficient (see implementation of "addPoint"):
952 feature.getConvexHulls()[hull_index].addPoint(point);
953 }
954 query_hull.reset(); // get ready for new executeStep()
955 }
956 // subordinates:
957 string from = (version_number_ < 5) ? "FEAT_Feature" : "FEAT_BaseFeature JOIN FEAT_Feature ON id = feature_id";
958 SQLite::Statement query_sub(*db_, "SELECT * FROM " + from + " WHERE subordinate_of = " + String(id) + " ORDER BY id ASC");
959 while (query_sub.executeStep())
960 {
961 Feature sub = loadFeatureAndSubordinates_(query_sub, query_meta,
962 query_match, query_hull);
963 feature.getSubordinates().push_back(sub);
964 }
965 return feature;
966 }
967
968
969 void OMSFileLoad::loadFeatures_(FeatureMap& features)

Callers

nothing calls this directly

Calls 8

getConvexHullsMethod · 0.80
addPointMethod · 0.80
StringClass · 0.50
setQualityMethod · 0.45
sizeMethod · 0.45
resizeMethod · 0.45
resetMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected