| 429 | |
| 430 | |
| 431 | void OMSFileStore::storeDBSearchParams_(const IdentificationData& id_data) |
| 432 | { |
| 433 | if (id_data.getDBSearchParams().empty()) return; |
| 434 | |
| 435 | if (!db_->tableExists("ID_MoleculeType")) createTableMoleculeType_(); |
| 436 | |
| 437 | createTable_( |
| 438 | "ID_DBSearchParam", |
| 439 | "id INTEGER PRIMARY KEY NOT NULL, " \ |
| 440 | "molecule_type_id INTEGER NOT NULL, " \ |
| 441 | "mass_type_average NUMERIC NOT NULL CHECK (mass_type_average in (0, 1)) DEFAULT 0, " \ |
| 442 | "database TEXT, " \ |
| 443 | "database_version TEXT, " \ |
| 444 | "taxonomy TEXT, " \ |
| 445 | "charges TEXT, " \ |
| 446 | "fixed_mods TEXT, " \ |
| 447 | "variable_mods TEXT, " \ |
| 448 | "precursor_mass_tolerance REAL, " \ |
| 449 | "fragment_mass_tolerance REAL, " \ |
| 450 | "precursor_tolerance_ppm NUMERIC NOT NULL CHECK (precursor_tolerance_ppm in (0, 1)) DEFAULT 0, " \ |
| 451 | "fragment_tolerance_ppm NUMERIC NOT NULL CHECK (fragment_tolerance_ppm in (0, 1)) DEFAULT 0, " \ |
| 452 | "digestion_enzyme TEXT, " \ |
| 453 | "enzyme_term_specificity TEXT, " // new in version 2! |
| 454 | "missed_cleavages NUMERIC, " \ |
| 455 | "min_length NUMERIC, " \ |
| 456 | "max_length NUMERIC, " \ |
| 457 | "FOREIGN KEY (molecule_type_id) REFERENCES ID_MoleculeType (id)"); |
| 458 | |
| 459 | SQLite::Statement query(*db_, "INSERT INTO ID_DBSearchParam VALUES (" \ |
| 460 | ":id, " \ |
| 461 | ":molecule_type_id, " \ |
| 462 | ":mass_type_average, " \ |
| 463 | ":database, " \ |
| 464 | ":database_version, " \ |
| 465 | ":taxonomy, " \ |
| 466 | ":charges, " \ |
| 467 | ":fixed_mods, " \ |
| 468 | ":variable_mods, " \ |
| 469 | ":precursor_mass_tolerance, " \ |
| 470 | ":fragment_mass_tolerance, " \ |
| 471 | ":precursor_tolerance_ppm, " \ |
| 472 | ":fragment_tolerance_ppm, " \ |
| 473 | ":digestion_enzyme, " \ |
| 474 | ":enzyme_term_specificity, " \ |
| 475 | ":missed_cleavages, " \ |
| 476 | ":min_length, " \ |
| 477 | ":max_length)"); |
| 478 | Key id = 1; |
| 479 | for (const ID::DBSearchParam& param : id_data.getDBSearchParams()) |
| 480 | { |
| 481 | query.bind(":id", id); |
| 482 | query.bind(":molecule_type_id", int(param.molecule_type) + 1); |
| 483 | query.bind(":mass_type_average", int(param.mass_type)); |
| 484 | query.bind(":database", param.database); |
| 485 | query.bind(":database_version", param.database_version); |
| 486 | query.bind(":taxonomy", param.taxonomy); |
| 487 | String charges = ListUtils::concatenate(param.charges, ","); |
| 488 | query.bind(":charges", charges); |
nothing calls this directly
no test coverage detected