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

Method readMinimal

src/openms/source/FORMAT/OSWFile.cpp:255–286  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

253 }
254
255 void OSWFile::readMinimal(OSWData& swath_result)
256 {
257 readMeta_(swath_result);
258
259 readTransitions_(swath_result);
260
261 String select_sql = "select PROTEIN.ID as prot_id, PROTEIN_ACCESSION as prot_accession from PROTEIN order by prot_id";
262 sqlite3_stmt* stmt;
263 conn_.prepareStatement(&stmt, select_sql);
264 enum CBIG
265 { // indices of respective columns in the query above
266 I_PROTID,
267 I_ACCESSION,
268 SIZE_OF_CBIG
269 };
270 Sql::SqlState rc = Sql::nextRow(stmt);
271 if (sqlite3_column_count(stmt) != SIZE_OF_CBIG)
272 {
273 throw Exception::SqlOperationFailed(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION, "Query was changed! Please report this bug!");
274 }
275 String accession;
276 // protein loop
277 while (rc == Sql::SqlState::SQL_ROW)
278 {
279 int id = Sql::extractInt(stmt, I_PROTID);
280 accession = Sql::extractString(stmt, I_ACCESSION);
281 swath_result.addProtein(OSWProtein(std::move(accession), id, {}));
282 rc = Sql::nextRow(stmt, rc); // next row
283 }
284
285 sqlite3_finalize(stmt);
286 }
287
288
289 /**

Callers 2

annotateWorker_Method · 0.80
OSWFile_test.cppFile · 0.80

Calls 6

nextRowFunction · 0.85
extractIntFunction · 0.85
extractStringFunction · 0.85
OSWProteinFunction · 0.85
prepareStatementMethod · 0.80
addProteinMethod · 0.45

Tested by

no test coverage detected