| 613 | } |
| 614 | |
| 615 | void OSWFile::readTransitions_(OSWData& swath_result) |
| 616 | { |
| 617 | swath_result.clear(); |
| 618 | |
| 619 | Size count = conn_.countTableRows("RUN"); |
| 620 | if (count != 1) |
| 621 | { |
| 622 | throw Exception::Precondition(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION, "Database '" + filename_ + "' contains more than one RUN. This is currently not supported!"); |
| 623 | } |
| 624 | |
| 625 | // Grab transitions first |
| 626 | // We do this separately, because the full sql query below will show transitions in duplicates, because many features might use the same XIC at different positions |
| 627 | const StringList colnames_tr = { "ID", "PRODUCT_MZ", "TYPE", "DECOY", "ANNOTATION" }; |
| 628 | enum COLIDs |
| 629 | { |
| 630 | ID, |
| 631 | PRODUCT_MZ, |
| 632 | TYPE, |
| 633 | DECOY, |
| 634 | ANNOTATION |
| 635 | }; |
| 636 | |
| 637 | // does not make the query below any faster... |
| 638 | //conn.executeStatement("ANALYZE"); |
| 639 | |
| 640 | String select_transitions = "SELECT " + ListUtils::concatenate(colnames_tr, ",") + " FROM TRANSITION ORDER BY ID;"; |
| 641 | sqlite3_stmt* stmt; |
| 642 | conn_.prepareStatement(&stmt, select_transitions); |
| 643 | Sql::SqlState rc = Sql::nextRow(stmt); |
| 644 | while (rc == Sql::SqlState::SQL_ROW) |
| 645 | { |
| 646 | OSWTransition tr(Sql::extractString(stmt, COLIDs::ANNOTATION), |
| 647 | Sql::extractInt(stmt, COLIDs::ID), |
| 648 | Sql::extractFloat(stmt, COLIDs::PRODUCT_MZ), |
| 649 | Sql::extractChar(stmt, COLIDs::TYPE), |
| 650 | Sql::extractInt(stmt, COLIDs::DECOY)); |
| 651 | swath_result.addTransition(std::move(tr)); |
| 652 | rc = Sql::nextRow(stmt); |
| 653 | } |
| 654 | sqlite3_finalize(stmt); |
| 655 | } |
| 656 | |
| 657 | } // namespace OpenMS |
nothing calls this directly
no test coverage detected