35 #ifndef OPENMS_FORMAT_DB_DBADAPTER_H
36 #define OPENMS_FORMAT_DB_DBADAPTER_H
44 #include <QtSql/QSqlQuery>
45 #include <QtCore/QVariant>
46 #include <QtCore/QDate>
79 template <
class ExperimentType>
80 void storeExperiment(ExperimentType & exp);
83 template <
class ExperimentType>
84 void loadExperiment(
UID id, ExperimentType & exp);
86 template <
class SpectrumType>
88 void loadSpectrum(
UID id, SpectrumType & spec);
101 bool checkDBVersion(
bool warning);
129 void loadMetaInfo_(
UID id,
Peak1D & peak);
139 void deleteMetaInfo_(
const String & parent_table,
const String & condition);
165 void loadSample_(
UID id,
Sample & sample);
173 template <
class ExperimentType>
176 std::stringstream query;
179 bool new_entry(
false);
182 UID acquisition_info_id(0);
198 new_entry = (exp.getPersistenceId() == 0);
201 query <<
"INSERT INTO META_MSExperiment SET ";
206 query <<
"UPDATE META_MSExperiment SET ";
207 end =
" WHERE id='" +
String(exp.getPersistenceId()) +
"'";
211 query <<
"Date='" << exp.getDateTime().get() <<
"'";
213 query <<
",Description='" << exp.getComment() <<
"'";
215 query <<
",FractionIdentifier='" << exp.getFractionIdentifier() <<
"'";
230 std::vector<ProteinIdentification> & pi = exp.getProteinIdentifications();
235 query <<
"DELETE FROM ID_ProteinIdentification WHERE fid_MSExperiment='" << exp.getPersistenceId() <<
"'";
238 for (std::vector<ProteinIdentification>::const_iterator pi_it = pi.begin(); pi_it != pi.end(); pi_it++)
241 query <<
"INSERT INTO ID_ProteinIdentification SET ";
242 query <<
"fid_MSExperiment='" << exp.getPersistenceId() <<
"'";
243 query <<
",SearchEngine='" << pi_it->getSearchEngine() <<
"'";
244 query <<
",SearchEngineVersion='" << pi_it->getSearchEngineVersion() <<
"'";
245 query <<
",Date='" << pi_it->getDateTime().get() <<
"'";
246 query <<
",ScoreType='" << pi_it->getScoreType() <<
"'";
247 query <<
",HigherScoreBetter='" << pi_it->isHigherScoreBetter() <<
"'";
248 query <<
",SignificanceThreshold='" << pi_it->getSignificanceThreshold() <<
"'";
258 for (std::vector<ProteinHit>::const_iterator ph_it = pi_it->getHits().begin(); ph_it != pi_it->getHits().end(); ph_it++)
261 query <<
"INSERT INTO ID_ProteinHit SET ";
262 query <<
"fid_ProteinIdentification='" << parent_id <<
"'";
263 query <<
",Score='" << ph_it->getScore() <<
"'";
264 query <<
",Accession='" << ph_it->getAccession() <<
"'";
265 query <<
",Sequence='" << ph_it->getSequence() <<
"'";
266 query <<
",Rank='" << ph_it->getRank() <<
"'";
276 query <<
"DELETE FROM ID_SearchParameters WHERE fid_ProteinIdentification='" << parent_id <<
"'";
280 query <<
"INSERT INTO ID_SearchParameters SET ";
281 query <<
"fid_ProteinIdentification='" << parent_id <<
"'";
282 query <<
",DB='" << pi_it->getSearchParameters().db <<
"'";
283 query <<
",DBVersion='" << pi_it->getSearchParameters().db_version <<
"'";
284 query <<
",Taxonomy='" << pi_it->getSearchParameters().taxonomy <<
"'";
285 query <<
",Charges='" << pi_it->getSearchParameters().charges <<
"'";
286 query <<
",MassType='" << (1u + pi_it->getSearchParameters().mass_type) <<
"'";
287 query <<
",Enzyme='" << (1u + pi_it->getSearchParameters().enzyme) <<
"'";
288 query <<
",MissedCleavages='" << pi_it->getSearchParameters().missed_cleavages <<
"'";
289 query <<
",PeakMassTolerance='" << pi_it->getSearchParameters().peak_mass_tolerance <<
"'";
290 query <<
",PrecursorTolerance='" << pi_it->getSearchParameters().precursor_tolerance <<
"'";
295 storeMetaInfo_(
"ID_SearchParameters", meta_id, pi_it->getSearchParameters());
299 query <<
"DELETE FROM ID_FixedModifications WHERE fid_SearchParameters='" << meta_id <<
"'";
302 for (std::vector<String>::const_iterator mod_it = pi_it->getSearchParameters().fixed_modifications.begin(); mod_it != pi_it->getSearchParameters().fixed_modifications.end(); mod_it++)
306 query <<
"INSERT INTO ID_FixedModifications SET ";
307 query <<
"fid_SearchParameters='" << meta_id <<
"'";
308 query <<
",name='" << *mod_it <<
"'";
312 for (std::vector<String>::const_iterator mod_it = pi_it->getSearchParameters().variable_modifications.begin(); mod_it != pi_it->getSearchParameters().variable_modifications.end(); mod_it++)
315 query <<
"INSERT INTO ID_VariableModifications SET ";
316 query <<
"fid_SearchParameters='" << meta_id <<
"'";
317 query <<
",name='" << *mod_it <<
"'";
331 query <<
"DELETE FROM META_Sample WHERE fid_MSExperiment='" << exp.getPersistenceId() <<
"'";
332 storeSample_(exp.getSample(), exp.getPersistenceId(), 0);
338 const std::vector<ContactPerson> & contacts = exp.getContacts();
342 query <<
"DELETE FROM META_ContactPerson WHERE fid_MSExperiment='" << exp.getPersistenceId() <<
"'";
345 for (std::vector<ContactPerson>::const_iterator contact_it = contacts.begin(); contact_it != contacts.end(); contact_it++)
348 query <<
"INSERT INTO META_ContactPerson SET ";
349 query <<
"fid_MSExperiment='" << exp.getPersistenceId() <<
"'";
350 query <<
",PreName='" << contact_it->getFirstName() <<
"'";
351 query <<
",LastName='" << contact_it->getLastName() <<
"'";
352 query <<
",Affiliation='" << contact_it->getInstitution() <<
"'";
353 query <<
",Email='" << contact_it->getEmail() <<
"'";
354 query <<
",Comment='" << contact_it->getContactInfo() <<
"'";
366 const HPLC & hplc = exp.getHPLC();
371 query <<
"INSERT INTO META_HPLC SET ";
372 query <<
"fid_MSExperiment='" << exp.getPersistenceId() <<
"',";
377 query <<
"SELECT id FROM META_HPLC WHERE fid_MSExperiment='" << exp.getPersistenceId() <<
"'";
379 parent_id = result.value(0).toInt();
382 query <<
"UPDATE META_HPLC SET ";
383 end =
" WHERE fid_MSExperiment='" +
String(exp.getPersistenceId()) +
"'";
387 query <<
",ColumnName='" << hplc.
getColumn() <<
"'";
388 query <<
",Description='" << hplc.
getComment() <<
"'";
389 query <<
",Flux=" << hplc.
getFlux();
405 const Gradient & gradient = exp.getHPLC().getGradient();
406 const std::vector<String> & eluents = gradient.
getEluents();
408 const std::vector<std::vector<UInt> > & percentages = gradient.
getPercentages();
409 std::stringstream query_eluents, query_time, query_percentages;
410 UID eluents_id(0), time_id(0);
414 query <<
"DELETE FROM META_GradientEluent WHERE fid_HPLC=" << parent_id;
417 query <<
"DELETE FROM META_GradientTime WHERE fid_HPLC=" << parent_id;
420 if (!eluents.empty())
422 query_eluents.str(
"");
423 query_eluents <<
"INSERT INTO META_GradientEluent (fid_HPLC, Name) VALUES ";
424 for (std::vector<String>::const_iterator eluents_it = eluents.begin(); eluents_it != eluents.end(); eluents_it++)
426 query_eluents <<
"(";
427 query_eluents << parent_id;
428 query_eluents <<
",'" << *eluents_it <<
"'";
429 query_eluents <<
"),";
439 query_time <<
"INSERT INTO META_GradientTime (fid_HPLC, Time) VALUES ";
440 for (std::vector<Int>::const_iterator time_it = time.begin(); time_it != time.end(); time_it++)
443 query_time << parent_id;
444 query_time <<
"," << *time_it;
452 if (!percentages.empty() && !eluents.empty() && !time.empty())
454 query_percentages.str(
"");
455 query_percentages <<
"INSERT INTO META_GradientPercentage (fid_GradientEluent, fid_GradientTime, Percentage) VALUES ";
458 for (std::vector<std::vector<UInt> >::const_iterator percent_outer_it = percentages.begin(); percent_outer_it != percentages.end(); percent_outer_it++)
462 for (std::vector<UInt>::const_iterator percent_inner_it = (*percent_outer_it).begin(); percent_inner_it != (*percent_outer_it).end(); percent_inner_it++)
464 query_percentages <<
"(";
465 query_percentages << eluents_id + i;
466 query_percentages <<
"," << time_id + j;
467 query_percentages <<
"," << *percent_inner_it;
468 query_percentages <<
"),";
481 const Instrument & instrument = exp.getInstrument();
486 query <<
"INSERT INTO META_MSInstrument SET ";
487 query <<
"fid_MSExperiment='" << exp.getPersistenceId() <<
"',";
492 query <<
"SELECT id FROM META_MSInstrument WHERE fid_MSExperiment='" << exp.getPersistenceId() <<
"'";
494 parent_id = result.value(0).toInt();
497 query <<
"UPDATE META_MSInstrument SET ";
498 end =
" WHERE fid_MSExperiment='" +
String(exp.getPersistenceId()) +
"'";
501 query <<
"Model='" << instrument.
getModel() <<
"'";
502 query <<
",Vendor='" << instrument.
getVendor() <<
"'";
504 query <<
",IonOpticsType='" << (1u + instrument.
getIonOptics()) <<
"'";
516 deleteMetaInfo_(
"META_Software",
"SoftwareApplicator='META_MSInstrument' AND fid_SoftwareApplicator=" +
String(parent_id));
518 query <<
"DELETE FROM META_Software WHERE fid_SoftwareApplicator='" << parent_id <<
"' AND SoftwareApplicator='META_MSInstrument'";
521 query <<
"INSERT INTO META_Software SET ";
522 query <<
"fid_SoftwareApplicator='" << parent_id <<
"'";
523 query <<
",SoftwareApplicator='META_MSInstrument'";
534 const std::vector<IonDetector> & detectors = exp.getInstrument().getIonDetectors();
538 query <<
"DELETE FROM META_IonDetector WHERE fid_MSInstrument='" << parent_id <<
"'";
541 for (std::vector<IonDetector>::const_iterator detectors_it = detectors.begin(); detectors_it != detectors.end(); detectors_it++)
544 query <<
"INSERT INTO META_IonDetector SET ";
545 query <<
"fid_MSInstrument='" << parent_id <<
"'";
546 query <<
",AcquisitionMode=" << (1u + detectors_it->getAcquisitionMode());
547 query <<
",Type=" << (1u + detectors_it->getType());
548 query <<
",Resolution=" << detectors_it->getResolution();
549 query <<
",ADCSamplingFrequency=" << detectors_it->getADCSamplingFrequency();
550 query <<
",InstrumentOrder=" << (detectors_it->getOrder());
560 const std::vector<IonSource> & sources = exp.getInstrument().getIonSources();
564 query <<
"DELETE FROM META_IonSource WHERE fid_MSInstrument='" << parent_id <<
"'";
567 for (std::vector<IonSource>::const_iterator sources_it = sources.begin(); sources_it != sources.end(); sources_it++)
570 query <<
"INSERT INTO META_IonSource SET ";
571 query <<
"fid_MSInstrument='" << parent_id <<
"'";
572 query <<
",InletType=" << (1u + sources_it->getInletType());
573 query <<
",IonizationMethod=" << (1u + sources_it->getIonizationMethod());
574 query <<
",IonizationMode=" << (1u + sources_it->getPolarity());
575 query <<
",InstrumentOrder=" << (sources_it->getOrder());
585 const std::vector<MassAnalyzer> & analyzers = exp.getInstrument().getMassAnalyzers();
589 query <<
"DELETE FROM META_MassAnalyzer WHERE fid_MSInstrument='" << parent_id <<
"'";
592 for (std::vector<MassAnalyzer>::const_iterator analyzer_it = analyzers.begin(); analyzer_it != analyzers.end(); analyzer_it++)
595 query <<
"INSERT INTO META_MassAnalyzer SET ";
596 query <<
"fid_MSInstrument='" << parent_id <<
"'";
597 query <<
",Accuracy=" << analyzer_it->getAccuracy();
598 query <<
",FinalMSExponent=" << analyzer_it->getFinalMSExponent();
599 query <<
",IsolationWidth=" << analyzer_it->getIsolationWidth();
600 query <<
",MagneticFieldStrength=" << analyzer_it->getMagneticFieldStrength();
601 query <<
",ReflectronState=" << (1u + analyzer_it->getReflectronState());
602 query <<
",Resolution=" << analyzer_it->getResolution();
603 query <<
",ResolutionMethod=" << (1u + analyzer_it->getResolutionMethod());
604 query <<
",ResolutionType=" << (1u + analyzer_it->getResolutionType());
605 query <<
",ScanDirection=" << (1u + analyzer_it->getScanDirection());
606 query <<
",ScanLaw=" << (1u + analyzer_it->getScanLaw());
607 query <<
",ScanRate=" << analyzer_it->getScanRate();
608 query <<
",ScanTime=" << analyzer_it->getScanTime();
609 query <<
",TOFPathLength=" << analyzer_it->getTOFTotalPathLength();
610 query <<
",Type=" << (1u + analyzer_it->getType());
611 query <<
",InstrumentOrder=" << analyzer_it->getOrder();
620 for (
typename ExperimentType::Iterator exp_it = exp.begin(); exp_it != exp.end(); ++exp_it)
623 new_entry = (exp_it->getPersistenceId() == 0);
626 query <<
"INSERT INTO DATA_Spectrum SET ";
631 query <<
"UPDATE DATA_Spectrum SET ";
632 end =
" WHERE id='" +
String(exp_it->getPersistenceId()) +
"'";
635 query <<
"fid_MSExperiment='" << exp.getPersistenceId() <<
"'";
637 query <<
",Type=" << (1u + exp_it->getType());
639 query <<
",RetentionTime='" << exp_it->getRT() <<
"'";
641 query <<
",MSLevel='" << exp_it->getMSLevel() <<
"'";
643 query <<
",Description='" << exp_it->getComment() <<
"'";
645 query <<
",NativeID='" << exp_it->getNativeID() <<
"'";
657 storeFile_(
"DATA_Spectrum", exp_it->getPersistenceId(), exp_it->getSourceFile());
658 meta_id =
storeMetaInfo_(
"DATA_Spectrum", exp_it->getPersistenceId(), *exp_it);
665 std::vector<PeptideIdentification> & pei = exp_it->getPeptideIdentifications();
670 query <<
"DELETE FROM ID_PeptideIdentification WHERE fid_Spectrum='";
671 query << exp_it->getPersistenceId() <<
"'";
674 for (std::vector<PeptideIdentification>::const_iterator pei_it = pei.begin(); pei_it != pei.end(); pei_it++)
677 query <<
"INSERT INTO ID_PeptideIdentification SET ";
678 query <<
"fid_Spectrum='" << exp_it->getPersistenceId() <<
"'";
679 query <<
",SignificanceThreshold='" << pei_it->getSignificanceThreshold() <<
"'";
680 query <<
",ScoreType='" << pei_it->getScoreType() <<
"'";
681 query <<
",HigherScoreBetter='" << pei_it->isHigherScoreBetter() <<
"'";
690 for (std::vector<PeptideHit>::const_iterator peh_it = pei_it->getHits().begin(); peh_it != pei_it->getHits().end(); peh_it++)
693 query <<
"INSERT INTO ID_PeptideHit SET ";
694 query <<
"fid_Identification='" << parent_id <<
"'";
695 query <<
",Score='" << peh_it->getScore() <<
"'";
696 query <<
",charge='" << peh_it->getCharge() <<
"'";
697 query <<
",Sequence='" << peh_it->getSequence() <<
"'";
698 query <<
",AABefore='" << peh_it->getAABefore() <<
"'";
699 query <<
",AAAfter='" << peh_it->getAAAfter() <<
"'";
715 query <<
"DELETE FROM DATA_Precursor WHERE fid_Spectrum='";
716 query << exp_it->getPersistenceId() <<
"'";
720 for (
Size precs_it = 0; precs_it < exp_it->getPrecursors().size(); precs_it++)
723 query <<
"INSERT INTO DATA_Precursor SET ";
724 query <<
"fid_Spectrum='" +
String(exp_it->getPersistenceId()) +
"'";
726 query <<
",Intensity='" << exp_it->getPrecursors()[precs_it].getIntensity() <<
"'";
728 query <<
",WindowMz='" << exp_it->getPrecursors()[precs_it].getMZ() <<
"'";
730 query <<
",Charge='" << exp_it->getPrecursors()[precs_it].getCharge() <<
"'";
732 query <<
",ActivationEnergy='" << exp_it->getPrecursors()[precs_it].getActivationEnergy() <<
"'";
734 query <<
",WindowLow='" << exp_it->getPrecursors()[precs_it].getIsolationWindowLowerOffset() <<
"'";
736 query <<
",WindowUp='" << exp_it->getPrecursors()[precs_it].getIsolationWindowUpperOffset() <<
"'";
740 storeMetaInfo_(
"DATA_Precursor", parent_id, exp_it->getPrecursors()[precs_it]);
743 for (
Size pcs_it = 0; pcs_it < exp_it->getPrecursors()[precs_it].getPossibleChargeStates().size(); ++pcs_it)
746 query <<
"INSERT INTO DATA_PrecursorPCS SET ";
747 query <<
"fid_Precursor='" +
String(parent_id) +
"'";
749 query <<
",PossibleChargeStates='" << (exp_it->getPrecursors()[precs_it].getPossibleChargeStates()[pcs_it]) <<
"'";
753 for (std::set<Precursor::ActivationMethod>::iterator am_it = exp_it->getPrecursors()[precs_it].getActivationMethods().begin(); am_it != exp_it->getPrecursors()[precs_it].getActivationMethods().end(); ++am_it)
756 query <<
"INSERT INTO DATA_PrecursorAM SET ";
757 query <<
"fid_Precursor='" +
String(parent_id) +
"'";
759 query <<
",ActivationMethods=" << (1u + *(am_it));
772 query <<
"DELETE FROM DATA_Products WHERE fid_Spectrum='";
773 query << exp_it->getPersistenceId() <<
"'";
776 for (
Size precs_it = 0; precs_it < exp_it->getProducts().size(); precs_it++)
779 query <<
"INSERT INTO DATA_Products SET ";
780 query <<
"fid_Spectrum='" +
String(exp_it->getPersistenceId()) +
"'";
782 query <<
",WindowMz='" << exp_it->getProducts()[precs_it].getMZ() <<
"'";
784 query <<
",WindowLow='" << exp_it->getProducts()[precs_it].getIsolationWindowLowerOffset() <<
"'";
786 query <<
",WindowUp='" << exp_it->getProducts()[precs_it].getIsolationWindowUpperOffset() <<
"'";
790 storeMetaInfo_(
"DATA_Products", parent_id, exp_it->getProducts()[precs_it]);
799 if (exp_it->size() != 0)
801 query <<
"INSERT INTO DATA_Peak (fid_Spectrum,Intensity,mz) VALUES ";
802 tmp =
"(" +
String(exp_it->getPersistenceId()) +
",'";
803 for (
typename ExperimentType::SpectrumType::Iterator spec_it = exp_it->begin(); spec_it != exp_it->end(); ++spec_it)
808 query << spec_it->getIntensity() <<
"','";
810 query << spec_it->getPosition() <<
"'),";
818 for (
typename ExperimentType::SpectrumType::Iterator spec_it = exp_it->begin(); spec_it != exp_it->end(); ++spec_it)
828 const typename ExperimentType::SpectrumType::FloatDataArrays & meta_data_arrays = exp_it->getFloatDataArrays();
830 for (
typename ExperimentType::SpectrumType::FloatDataArrays::const_iterator mdarrays_it = meta_data_arrays.begin(); mdarrays_it != meta_data_arrays.end(); ++mdarrays_it)
836 query <<
"SELECT id FROM META_MetaInfoDescription WHERE fid_Spectrum=";
837 query << exp_it->getPersistenceId();
838 query <<
" AND Name='" << mdarrays_it->getName() <<
"'";
843 if (result.size() > 0)
845 parent_id = result.value(0).toInt();
847 query <<
"UPDATE META_MetaInfoDescription SET ";
848 query <<
"Name='" + mdarrays_it->getName() +
"' ";
849 end =
" WHERE fid_Spectrum=" +
String(exp_it->getPersistenceId());
850 end +=
" AND Name='" + mdarrays_it->getName() +
"'";
855 query <<
"INSERT INTO META_MetaInfoDescription SET ";
856 query <<
"fid_Spectrum=" << exp_it->getPersistenceId() <<
", ";
857 query <<
"Name='" << mdarrays_it->getName() <<
"'";
869 storeMetaInfo_(
"META_MetaInfoDescription", parent_id, *mdarrays_it);
873 query <<
"DELETE FROM DATA_PeakMetaData WHERE fid_MetaInfoDescription=";
878 query <<
"SELECT id FROM DATA_Peak WHERE fid_Spectrum=" << exp_it->getPersistenceId();
882 query <<
"INSERT INTO DATA_PeakMetaData (fid_Peak,fid_MetaInfoDescription,Value) VALUES ";
883 for (
typename ExperimentType::SpectrumType::FloatDataArray::const_iterator meta_array_it = mdarrays_it->begin(); meta_array_it != mdarrays_it->end(); meta_array_it++)
885 if (result.isValid())
887 query <<
"(" << result.value(0).toInt() <<
"," << parent_id <<
"," << *meta_array_it <<
"),";
910 query <<
"INSERT INTO META_InstrumentSettings SET fid_Spectrum=" << exp_it->getPersistenceId() <<
",";
915 query <<
"SELECT id FROM META_InstrumentSettings WHERE fid_Spectrum='" << exp_it->getPersistenceId() <<
"'";
917 parent_id = result.value(0).toInt();
920 query <<
"UPDATE META_InstrumentSettings SET ";
921 end =
" WHERE fid_Spectrum='" +
String(exp_it->getPersistenceId()) +
"'";
924 query <<
"Polarity=" << (1u + settings.
getPolarity()) <<
",";
925 query <<
"ScanMode=" << (1u + settings.
getScanMode()) <<
",";
933 storeMetaInfo_(
"META_InstrumentSettings", parent_id, exp_it->getInstrumentSettings());
945 query <<
"DELETE FROM META_ScanWindows WHERE fid_Spectrum='";
946 query << exp_it->getPersistenceId() <<
"'";
949 for (
Size wins_it = 0; wins_it < wins.size(); wins_it++)
952 query <<
"INSERT INTO META_ScanWindows SET ";
953 query <<
"fid_Spectrum='" +
String(exp_it->getPersistenceId()) +
"'";
954 query <<
",MZRangeBegin=" << settings.
getScanWindows()[wins_it].begin;
955 query <<
",MZRangeEnd=" << settings.
getScanWindows()[wins_it].end;
971 query <<
"INSERT INTO META_AcquisitionInfo SET fid_Spectrum='" << exp_it->getPersistenceId() <<
"',";
976 query <<
"SELECT id FROM META_AcquisitionInfo WHERE fid_Spectrum='" << exp_it->getPersistenceId() <<
"'";
978 acquisition_info_id = result.value(0).toInt();
981 query <<
"UPDATE META_AcquisitionInfo SET ";
982 end =
" WHERE fid_Spectrum='" +
String(exp_it->getPersistenceId()) +
"'";
1000 query <<
"DELETE FROM META_Acquisition WHERE fid_AcquisitionInfo='" << parent_id <<
"'";
1003 for (std::vector<Acquisition>::const_iterator info_it = info.begin(); info_it != info.end(); info_it++)
1006 query <<
"INSERT INTO META_Acquisition SET fid_AcquisitionInfo='" << acquisition_info_id <<
"',";
1007 query <<
"Number='" << info_it->getIdentifier() <<
"'";
1019 const std::vector<DataProcessing> & processings = exp_it->getDataProcessing();
1023 query <<
"DELETE FROM META_DataProcessing WHERE fid_Spectrum='" << exp_it->getPersistenceId() <<
"'";
1026 for (std::vector<DataProcessing>::const_iterator processings_it = processings.begin(); processings_it != processings.end(); processings_it++)
1029 query <<
"INSERT INTO META_DataProcessing SET ";
1030 query <<
"fid_Spectrum='" << exp_it->getPersistenceId() <<
"'";
1031 query <<
",CompletionTime='" << processings_it->getCompletionTime().get() <<
"'";
1036 storeMetaInfo_(
"META_DataProcessing", dataprocessing_id, *processings_it);
1038 deleteMetaInfo_(
"META_Software",
"SoftwareApplicator='META_DataProcessing' AND fid_SoftwareApplicator=" +
String(dataprocessing_id));
1040 query <<
"DELETE FROM META_Software WHERE fid_SoftwareApplicator='" << dataprocessing_id <<
"' AND SoftwareApplicator='META_DataProcessing'";
1043 query <<
"INSERT INTO META_Software SET ";
1044 query <<
"fid_SoftwareApplicator='" << dataprocessing_id <<
"'";
1045 query <<
",SoftwareApplicator='META_DataProcessing'";
1046 query <<
",Name='" << processings_it->getSoftware().getName() <<
"'";
1047 query <<
",Version='" << processings_it->getSoftware().getVersion() <<
"'";
1051 storeMetaInfo_(
"META_Software", software_id, processings_it->getSoftware());
1056 for (std::set<DataProcessing::ProcessingAction>::const_iterator acts_it = processings_it->getProcessingActions().begin(); acts_it != processings_it->getProcessingActions().end(); acts_it++)
1059 query <<
"INSERT INTO META_ProcessingActions SET ";
1060 query <<
"ProcessingActionType='" << (1u + (*acts_it)) <<
"'";
1061 query <<
",fid_DataProcessing='" << dataprocessing_id <<
"'";
1069 template <
class ExperimentType>
1078 std::stringstream query;
1080 QSqlQuery result, sub_result;
1087 query <<
"SELECT Date,fid_MetaInfo,Description,FractionIdentifier FROM META_MSExperiment WHERE id='" <<
id <<
"'";
1094 d.
set(result.value(0).toDateTime().toString(Qt::ISODate));
1101 exp.setComment(result.value(2).toString());
1102 exp.setFractionIdentifier(result.value(3).toString());
1105 std::vector<ProteinIdentification> pi_vec;
1106 std::vector<ProteinHit> ph_vec;
1111 query <<
"SELECT id, SearchEngine, SearchEngineVersion, Date, ScoreType, HigherScoreBetter, SignificanceThreshold, fid_MetaInfo, fid_File FROM ID_ProteinIdentification WHERE fid_MSExperiment='"<<
id <<
"'";
1113 while (result.next())
1115 parent_id = result.value(0).toInt();
1129 query <<
"SELECT id,DB,DBVersion,Taxonomy,Charges,MassType-1,Enzyme-1,MissedCleavages,PeakMassTolerance,PrecursorTolerance,fid_MetaInfo FROM ID_SearchParameters WHERE fid_ProteinIdentification='" << parent_id <<
"'";
1132 UID sub_id = sub_result.value(0).toInt();
1134 params.
db = sub_result.value(1).toString();
1135 params.db_version = sub_result.value(2).toString();
1136 params.taxonomy = sub_result.value(3).toString();
1137 params.charges = sub_result.value(4).toString();
1140 params.missed_cleavages = sub_result.value(7).
toInt();
1141 params.peak_mass_tolerance = sub_result.value(8).toDouble();
1142 params.precursor_tolerance = sub_result.value(9).toDouble();
1147 query <<
"SELECT name FROM ID_VariableModifications WHERE fid_SearchParameters='" << sub_id <<
"'";
1149 while (sub_result.next())
1151 params.variable_modifications.push_back(sub_result.value(0).toString());
1154 query <<
"SELECT name FROM ID_FixedModifications WHERE fid_SearchParameters='" << sub_id <<
"'";
1156 while (sub_result.next())
1158 params.fixed_modifications.push_back(sub_result.value(0).toString());
1164 query <<
"SELECT Score, Accession, Sequence, Rank, fid_MetaInfo FROM ID_ProteinHit WHERE fid_ProteinIdentification='" << parent_id <<
"'";
1166 while (sub_result.next())
1168 ph.
setScore(sub_result.value(0).toDouble());
1171 ph.
setRank(sub_result.value(3).toInt());
1175 ph_vec.push_back(ph);
1180 pi_vec.push_back(pi);
1183 exp.setProteinIdentifications(pi_vec);
1189 query <<
"SELECT id FROM META_Sample WHERE fid_MSExperiment='" <<
id <<
"' AND fid_Sample IS NULL";
1192 exp.setSample(sample);
1197 query <<
"SELECT PreName,LastName,Affiliation,Email,Comment,fid_MetaInfo FROM META_ContactPerson WHERE fid_MSExperiment='" <<
id <<
"'";
1199 while (result.next())
1204 contact.
setEmail(result.value(3).toString());
1207 exp.getContacts().push_back(contact);
1212 query <<
"SELECT id,InstrumentName,ColumnName,Description,Flux,Pressure,Temperature FROM META_HPLC WHERE fid_MSExperiment='" <<
id <<
"'";
1214 parent_id = result.value(0).toInt();
1215 exp.getHPLC().setInstrument(result.value(1).toString());
1216 exp.getHPLC().setColumn(result.value(2).toString());
1217 exp.getHPLC().setComment(result.value(3).toString());
1218 exp.getHPLC().setFlux(result.value(4).toInt());
1219 exp.getHPLC().setPressure(result.value(5).toInt());
1220 exp.getHPLC().setTemperature(result.value(6).toInt());
1228 bool timepoints_done =
false;
1247 query <<
"SELECT Name,Time,Percentage FROM META_GradientEluent, META_GradientTime, META_GradientPercentage WHERE META_GradientEluent.fid_HPLC=" << parent_id <<
" AND fid_GradientEluent=META_GradientEluent.id AND fid_GradientTime=META_GradientTime.id";
1249 if (result.isValid())
1251 last_name = result.value(0).toString();
1252 exp.getHPLC().getGradient().addEluent(last_name);
1255 while (result.isValid())
1257 if (result.value(0).toString() != last_name.
toQString())
1259 exp.getHPLC().getGradient().addEluent(result.value(0).toString());
1260 timepoints_done =
true;
1263 if (timepoints_done ==
false)
1265 exp.getHPLC().getGradient().addTimepoint(result.value(1).toInt());
1268 exp.getHPLC().getGradient().setPercentage(result.value(0).toString(), result.value(1).toInt(), result.value(2).toInt());
1270 last_name = result.value(0).toString();
1279 query <<
"SELECT id,Model,Vendor,Description,IonOpticsType-1,fid_MetaInfo FROM META_MSInstrument WHERE fid_MSExperiment='" <<
id <<
"'";
1282 parent_id = result.value(0).toInt();
1283 exp.getInstrument().setModel(result.value(1).toString());
1284 exp.getInstrument().setVendor(result.value(2).toString());
1285 exp.getInstrument().setCustomizations(result.value(3).toString());
1287 loadMetaInfo_(result.value(5).toInt(), exp.getInstrument());
1290 query <<
"SELECT Name,Version,fid_MetaInfo, id FROM META_Software WHERE fid_SoftwareApplicator='" << result.value(0).toInt() <<
"' AND SoftwareApplicator = 'META_MSInstrument'";
1292 if (result.isValid())
1295 sw.
setName(result.value(0).toString());
1299 exp.getInstrument().setSoftware(sw);
1305 std::vector<IonDetector> detectors;
1307 query <<
"SELECT AcquisitionMode-1,Type-1,Resolution,ADCSamplingFrequency,InstrumentOrder,fid_MetaInfo FROM META_IonDetector WHERE fid_MSInstrument='" << parent_id <<
"'";
1309 while (result.next())
1316 detector.
setOrder(result.value(4).toInt());
1319 detectors.push_back(detector);
1321 exp.getInstrument().setIonDetectors(detectors);
1326 std::vector<IonSource> sources;
1328 query <<
"SELECT InletType-1,IonizationMethod-1,IonizationMode-1,InstrumentOrder,fid_MetaInfo FROM META_IonSource WHERE fid_MSInstrument='" << parent_id <<
"'";
1330 while (result.next())
1336 source.
setOrder(result.value(3).toInt());
1339 sources.push_back(source);
1341 exp.getInstrument().setIonSources(sources);
1346 std::vector<MassAnalyzer> analyzers;
1348 query <<
"SELECT Accuracy,FinalMSExponent,IsolationWidth,MagneticFieldStrength,ReflectronState-1,Resolution,ResolutionMethod-1,ResolutionType-1,ScanDirection-1,ScanLaw-1,ScanRate,ScanTime,TOFPathLength,Type-1,InstrumentOrder,fid_MetaInfo FROM META_MassAnalyzer WHERE fid_MSInstrument='" << parent_id <<
"'";
1350 while (result.next())
1363 analyzer.
setScanRate(result.value(10).toDouble());
1364 analyzer.
setScanTime(result.value(11).toDouble());
1367 analyzer.
setOrder(result.value(14).toInt());
1370 analyzers.push_back(analyzer);
1372 exp.getInstrument().setMassAnalyzers(analyzers);
1375 exp.setPersistenceId(
id);
1387 query <<
"SELECT id FROM DATA_Spectrum WHERE fid_MSExperiment=" << id;
1396 for (std::vector<int>::const_iterator it = levels.begin(); it != levels.end(); it++)
1398 query <<
"MSLevel=" << *it;
1399 if (it + 1 != levels.end())
1406 query <<
" ORDER BY id ASC";
1409 exp.resize(result.size());
1411 while (result.next())
1419 template <
class SpectrumType>
1429 spec = SpectrumType();
1431 std::stringstream query;
1432 QSqlQuery result, sub_result;
1436 query <<
"SELECT Type-1,NativeID, RetentionTime,MSLevel,Description,fid_MetaInfo,fid_File FROM DATA_Spectrum WHERE id='" <<
id <<
"'";
1441 spec.setNativeID(result.value(1).toString());
1442 spec.setRT(result.value(2).toDouble());
1443 spec.setMSLevel(result.value(3).toInt());
1444 spec.setComment(result.value(4).toString());
1446 loadFile_(result.value(6).toInt(), spec.getSourceFile());
1452 query <<
"SELECT Polarity-1, ScanMode-1, ZoomScan, fid_MetaInfo FROM META_InstrumentSettings WHERE fid_Spectrum=" << id;
1458 spec.setInstrumentSettings(settings);
1459 loadMetaInfo_(result.value(3).toInt(), spec.getInstrumentSettings());
1465 query <<
"SELECT MZRangeBegin,MZRangeEnd,fid_MetaInfo FROM META_ScanWindows WHERE fid_Spectrum=" << id;
1467 while (result.next())
1470 window.
begin = result.value(0).toDouble();
1471 window.
end = result.value(1).toDouble();
1473 spec.getInstrumentSettings().getScanWindows().push_back(window);
1481 std::vector<PeptideIdentification> pei_vec;
1482 std::vector<PeptideHit> peh_vec;
1487 query <<
"SELECT id, SignificanceThreshold, ScoreType, HigherScoreBetter, fid_MetaInfo, fid_File FROM ID_PeptideIdentification WHERE fid_Spectrum='" <<
id <<
"'";
1490 while (result.next())
1492 parent_id = result.value(0).toInt();
1502 query <<
"SELECT Score, Sequence, Charge, AABefore, AAAfter, fid_MetaInfo FROM ID_PeptideHit WHERE fid_Identification='" << parent_id <<
"'";
1505 while (sub_result.next())
1507 peh.
setScore(sub_result.value(0).toDouble());
1509 peh.
setCharge(sub_result.value(2).toInt());
1510 peh.
setAABefore(sub_result.value(3).toString().toStdString()[0]);
1511 peh.
setAAAfter(sub_result.value(4).toString().toStdString()[0]);
1515 peh_vec.push_back(peh);
1520 pei_vec.push_back(pei);
1523 spec.setPeptideIdentifications(pei_vec);
1530 query <<
"SELECT id, MethodOfCombination FROM META_AcquisitionInfo WHERE fid_Spectrum=" << id;
1533 spec.getAcquisitionInfo().setMethodOfCombination(result.value(1).toString());
1534 parent_id = result.value(0).toInt();
1540 query <<
"SELECT Number,fid_MetaInfo FROM META_Acquisition WHERE fid_AcquisitionInfo='" << parent_id <<
"' ORDER BY id ASC";
1543 while (result.next())
1548 spec.getAcquisitionInfo().push_back(acquisition);
1555 query <<
"SELECT CompletionTime,fid_MetaInfo, id FROM META_DataProcessing WHERE fid_Spectrum='" <<
id <<
"'";
1558 while (result.next())
1565 d.
set(result.value(0).toDateTime().toString(Qt::ISODate));
1576 query <<
"SELECT ProcessingActionType-1 FROM META_ProcessingActions WHERE fid_DataProcessing='" << result.value(2).toInt() <<
"'";
1578 while (sub_result.next())
1584 query <<
"SELECT Name,Version,fid_MetaInfo, id FROM META_Software WHERE fid_SoftwareApplicator='" << result.value(2).toInt() <<
"' AND SoftwareApplicator = 'META_DataProcessing'";
1586 if (sub_result.isValid())
1589 sw.
setName(sub_result.value(0).toString());
1590 sw.
setVersion(sub_result.value(1).toString());
1596 spec.getDataProcessing().push_back(processings);
1604 query <<
"SELECT Name, fid_MetaInfo FROM META_MetaInfoDescription WHERE fid_Spectrum=" << id;
1607 while (result.next())
1609 typename SpectrumType::FloatDataArray meta_array;
1610 meta_array.setName(result.value(0).toString());
1613 spec.getFloatDataArrays().push_back(meta_array);
1619 if (spec.getMSLevel() > 1)
1622 query <<
"SELECT WindowMz,Intensity,Charge,ActivationEnergy,WindowLow,WindowUp,fid_MetaInfo,id FROM DATA_Precursor WHERE fid_Spectrum='" <<
id <<
"' HAVING Intensity IS NOT NULL";
1624 spec.getPrecursors().resize(result.size());
1626 while (result.next())
1628 spec.getPrecursors()[res].setMZ(result.value(0).toDouble());
1629 spec.getPrecursors()[res].setIntensity(result.value(1).toDouble());
1630 spec.getPrecursors()[res].setCharge(result.value(2).toInt());
1631 spec.getPrecursors()[res].setActivationEnergy(result.value(3).toDouble());
1632 spec.getPrecursors()[res].setIsolationWindowLowerOffset(result.value(4).toDouble());
1633 spec.getPrecursors()[res].setIsolationWindowUpperOffset(result.value(5).toDouble());
1634 loadMetaInfo_(result.value(6).toInt(), spec.getPrecursors()[res]);
1636 UID prec_id = result.value(7).toInt();
1638 query <<
"SELECT PossibleChargeStates FROM DATA_PrecursorPCS WHERE fid_Precursor='" << prec_id <<
"' HAVING PossibleChargeStates IS NOT NULL";
1640 while (subresult.next())
1642 spec.getPrecursors()[res].getPossibleChargeStates().push_back(subresult.value(0).toInt());
1646 query <<
"SELECT ActivationMethods-1 FROM DATA_PrecursorAM WHERE fid_Precursor='" << prec_id <<
"'";
1648 std::set<Precursor::ActivationMethod> tmp_set;
1649 while (subresult.next())
1653 spec.getPrecursors()[res].setActivationMethods(tmp_set);
1662 query <<
"SELECT WindowMz,WindowLow,WindowUp,fid_MetaInfo FROM DATA_Products WHERE fid_Spectrum='" <<
id <<
"'";
1664 spec.getProducts().resize(result.size());
1666 while (result.next())
1668 spec.getProducts()[res].setMZ(result.value(0).toDouble());
1669 spec.getProducts()[res].setIsolationWindowLowerOffset(result.value(1).toDouble());
1670 spec.getProducts()[res].setIsolationWindowUpperOffset(result.value(2).toDouble());
1671 loadMetaInfo_(result.value(3).toInt(), spec.getProducts()[res]);
1680 query <<
"SELECT mz,Intensity,fid_MetaInfo,id FROM DATA_Peak WHERE fid_Spectrum='" <<
id <<
"' ";
1689 query <<
" ORDER BY mz ASC";
1692 while (result.next())
1696 p.setIntensity(result.value(1).toDouble());
1699 for (
typename SpectrumType::FloatDataArrays::iterator mdarrays_it = spec.getFloatDataArrays().begin(); mdarrays_it != spec.getFloatDataArrays().end(); mdarrays_it++)
1702 query <<
"SELECT id FROM META_MetaInfoDescription WHERE Name='";
1703 query << mdarrays_it->getName() <<
"' AND fid_Spectrum=" << id;
1706 query <<
"SELECT Value FROM DATA_PeakMetaData WHERE fid_Peak=";
1707 query << result.value(3).toInt() <<
" AND fid_MetaInfoDescription=" << sub_result.value(0).toInt();
1709 mdarrays_it->push_back(sub_result.value(0).toDouble());
1714 spec.setPersistenceId(
id);
Representation of a protein identification run.
Definition: ProteinIdentification.h:61
Descripton of the applied preprocessing steps.
Definition: DataProcessing.h:51
const String & getCustomizations() const
returns a description of customizations
void setSearchEngine(const String &search_engine)
Sets the search engine type.
PeakFileOptions options_
Definition: DBAdapter.h:167
Description of a MS instrument.
Definition: Instrument.h:64
String db
The used database.
Definition: ProteinIdentification.h:118
bool hasMZRange() const
returns true if an MZ range has been set
void loadSpectrum(UID id, SpectrumType &spec)
Reads a MSSpectrum.
Definition: DBAdapter.h:1420
const Software & getSoftware() const
returns a const reference to the instrument software
QSqlQuery executeQuery(const String &query, bool first=false)
Executes a query and returns the result.
void setAcquisitionMode(AcquisitionMode acquisition_mode)
sets the acquisition mode
Description of the settings a MS Instrument was run with.
Definition: InstrumentSettings.h:48
const String & getInstrument() const
returns a const reference to the instument name
A more convenient string class.
Definition: String.h:56
Precursor meta information.
Definition: Precursor.h:56
void setScore(DoubleReal score)
sets the score of the peptide hit
void setHits(const std::vector< ProteinHit > &hits)
Sets the protein hits.
void setScore(const DoubleReal score)
sets the score of the protein hit
void loadMetaInfo_(UID id, MetaInfoInterface &info)
Loads MetaInfo data from database.
void setZoomScan(bool zoom_scan)
sets if this scan is a zoom (enhanced resolution) scan
bool hasIntensityRange() const
returns true if an intensity range has been set
AcquisitionMode
Acquisition mode.
Definition: IonDetector.h:82
void set(UInt month, UInt day, UInt year, UInt hour, UInt minute, UInt second)
sets data from six integers
void setSequence(const String &sequence)
sets the protein sequence
const std::set< ProcessingAction > & getProcessingActions() const
returns a const reference to the applied processing actions
UID storeSample_(const Sample &sample, UID exp_id, UID parent_id)
Stores, updates or deletes sample information.
SpectrumType
Spectrum peak type.
Definition: SpectrumSettings.h:71
Description of the combination of raw data to a single spectrum.
Definition: AcquisitionInfo.h:54
const DRange< 1 > & getIntensityRange() const
returns the intensity range
void setOrder(Int order)
sets the order
void setScanRate(DoubleReal scan_rate)
sets the scan rate (in s)
bool hasMSLevels() const
returns true, if MS levels have been set
Representation of a HPLC experiment.
Definition: HPLC.h:51
DoubleReal end
End of the window.
Definition: ScanWindow.h:64
Peak2D PeakType
Definition: MassTrace.h:49
bool hasRTRange() const
returns true if an RT range has been set
void setScanMode(ScanMode scan_mode)
sets the scan mode
const std::vector< Int > & getMSLevels() const
returns the set MS levels
IonOpticsType getIonOptics() const
returns the ion optics type
void setPolarity(IonSource::Polarity polarity)
sets the polarity
void setPolarity(Polarity polarity)
sets the ionization mode
Description of a file location, used to store the origin of (meta) data.
Definition: SourceFile.h:47
void setScanDirection(ScanDirection scan_direction)
sets the direction of scanning
DoubleReal begin
Begin of the window.
Definition: ScanWindow.h:62
Description of the software used for processing.
Definition: Software.h:49
ScanDirection
direction of scanning
Definition: MassAnalyzer.h:103
void loadFile_(UID id, SourceFile &file)
Loads file information.
void setType(Type type)
sets the detector type
A 1-dimensional raw data point or peak mith meta information.
Definition: RichPeak1D.h:52
void setAABefore(char acid)
sets the amino acid before the sequence
InletType
inlet type
Definition: IonSource.h:52
void setSearchParameters(const SearchParameters &search_parameters)
Sets the search parameters.
Type
Detector type.
Definition: IonDetector.h:52
bool checkDBVersion(bool warning)
Returns true if the DB is up-to-date (Checks the version in ADMIN_Version table). ...
void loadExperiment(UID id, ExperimentType &exp)
Reads a MSExperiment.
Definition: DBAdapter.h:1070
UInt getFlux() const
returns the flux (in microliter/sec)
void setOrder(Int order)
sets the order
const std::vector< std::vector< UInt > > & getPercentages() const
returns a const reference to the percentages
Search parameters of the DB search.
Definition: ProteinIdentification.h:115
void setHigherScoreBetter(bool higher_is_better)
Sets the orientation of the score (is higher better?)
ResolutionType
Resolution type.
Definition: MassAnalyzer.h:92
String getComment() const
returns the comments
void storeExperiment(ExperimentType &exp)
Stores a MSExperiment.
Definition: DBAdapter.h:174
UID storeMetaInfo_(const String &parent_table, UID parent_id, const MetaInfoInterface &info)
Stores, updates or deletes MetaInfo data.
bool getZoomScan() const
return if this scan is a zoom (enhanced resolution) scan
ScanMode getScanMode() const
returns the scan mode
void setResolutionMethod(ResolutionMethod resolution_method)
sets the method used for determination of the resolution
void setAccuracy(DoubleReal accuracy)
sets the accuracy i.e. how much the theoretical mass may differ from the measured mass (in ppm) ...
PeakMassType
Peak mass type.
Definition: ProteinIdentification.h:91
void setSignificanceThreshold(DoubleReal value)
setting of the peptide significance threshold value
void setADCSamplingFrequency(DoubleReal ADC_sampling_frequency)
sets the analog-to-digital converter sampling frequency (in Hz)
ResolutionMethod
resolution method
Definition: MassAnalyzer.h:80
void setCompletionTime(const DateTime &completion_time)
sets the time of completition taking a DateTime object
Int toInt() const
Conversion to int.
void setHigherScoreBetter(bool value)
sets the peptide score orientation
DigestionEnzyme
Definition: ProteinIdentification.h:101
const std::vector< ScanWindow > & getScanWindows() const
returns a const reference to the m/z scan windows
void setCharge(Int charge)
sets the charge of the peptide
void setMagneticFieldStrength(DoubleReal magnetic_field_strength)
sets the strength of the magnetic field (in T)
const DRange< 1 > & getRTRange() const
returns the RT range
void loadSample_(UID id, Sample &sample)
Loads sample information.
void setResolution(DoubleReal resolution)
sets the resolution
DBConnection & db_con_
Reference to the DB connection handed over in the constructor.
Definition: DBAdapter.h:108
ProcessingAction
Definition: DataProcessing.h:58
Representation of a HPLC gradient.
Definition: Gradient.h:53
Int getTemperature() const
returns the temperature (in degree C)
UInt getAutoId()
Returns the last auto_increment ID of the SQL database.
Representation of a peptide hit.
Definition: PeptideHit.h:54
const String & getModel() const
returns the instrument model
void setSoftware(const Software &software)
sets the software used for processing
void setType(AnalyzerType type)
sets the analyzer type
A 1-dimensional raw data point or peak.
Definition: Peak1D.h:55
Scan window description.
Definition: ScanWindow.h:47
IonOpticsType
ion optics type
Definition: Instrument.h:71
const String & getVendor() const
returns the instrument vendor
void setResolution(DoubleReal resolution)
sets the resolution (in ns)
Meta information about the sample.
Definition: Sample.h:60
ReflectronState
Reflectron state.
Definition: MassAnalyzer.h:126
void setScanLaw(ScanLaw scan_law)
sets the scan law
Description of a ion detector (part of a MS Instrument)
Definition: IonDetector.h:47
void setHits(const std::vector< PeptideHit > &hits)
Sets the peptide hits.
Information about one raw data spectrum that was combined with several other raw data spectra...
Definition: Acquisition.h:50
void setPosition(const PositionType &position)
Mutable access to the position.
Definition: Peak2D.h:185
A class for connecting to a SQL database.
Definition: DBConnection.h:60
void setReflectronState(ReflectronState reflecton_state)
sets the reflectron state (for TOF)
IonizationMethod
ionization method
Definition: IonSource.h:80
const String & getName() const
returns the name of the software
const std::vector< Int > & getTimepoints() const
returns a const reference to the list of timepoints
QString toQString() const
Conversion to Qt QString.
void setScoreType(const String &type)
Sets the protein score type.
void setSequence(const AASequence &sequence)
sets the peptide sequence
void setVersion(const String &version)
sets the software version
void setTOFTotalPathLength(DoubleReal TOF_total_path_length)
sets the path length for a TOF mass analyzer (in meter)
void setScanTime(DoubleReal scan_time)
sets the scan time for a single scan (in s)
void setSearchEngineVersion(const String &search_engine_version)
Sets the search engine version.
void setAccession(const String &accession)
sets the accession of the protein
Representation of a protein hit.
Definition: ProteinHit.h:54
void setInletType(InletType inlet_type)
sets the inlet type
PositionType const & minPosition() const
Accessor to minimum position.
Definition: DIntervalBase.h:121
const String & getVersion() const
returns the software version
IonSource::Polarity getPolarity() const
returns the polarity
UID storeFile_(const String &parent_table, UID parent_id, const SourceFile &file)
Stores, updates or deletes file information.
void setAAAfter(char acid)
sets the amino acid after the sequence
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:144
const String & getMethodOfCombination() const
returns the method of combination
ScanMode
scan mode
Definition: InstrumentSettings.h:53
void setRank(UInt newrank)
sets the rank
DateTime Class.
Definition: DateTime.h:55
void setSignificanceThreshold(DoubleReal value)
Sets the protein significance threshold value.
void setScoreType(const String &type)
sets the peptide score type
void setIdentifier(const String &identifier)
sets the index/number of the scan
void setResolutionType(ResolutionType resolution_type)
sets the resolution type
const SearchParameters & getSearchParameters() const
Returns the search parameters.
A class for accessing and storing data in a SQL database.
Definition: DBAdapter.h:69
PositionType const & maxPosition() const
Accessor to maximum position.
Definition: DIntervalBase.h:127
const DRange< 1 > & getMZRange() const
returns the MZ range
UInt getPressure() const
returns the pressure (in bar)
void setName(const String &name)
sets the name of the software
ActivationMethod
Method of activation.
Definition: Precursor.h:64
void setOrder(Int order)
sets the order
Options for loading files containing peak data.
Definition: PeakFileOptions.h:47
AnalyzerType
analyzer type
Definition: MassAnalyzer.h:53
void setIonizationMethod(IonizationMethod ionization_type)
sets the ionization method
void setIsolationWidth(DoubleReal isolation_width)
sets the isolation width i.e. in which m/z range the precursor ion is selected for MS to the n (in m/...
ScanLaw
Scan law.
Definition: MassAnalyzer.h:114
int Int
Signed integer type.
Definition: Types.h:100
void setFinalMSExponent(Int final_MS_exponent)
sets the final MS exponent
Descripton of a mass analyzer (part of a MS Instrument)
Definition: MassAnalyzer.h:48
Description of a ion source (part of a MS Instrument)
Definition: IonSource.h:47
void setDateTime(const DateTime &date)
Sets the date of the protein identification run.
OPENMS_UINT64_TYPE UID
A unique object ID (as unsigned 64bit type).
Definition: Types.h:137
Polarity
Polarity of the ion source.
Definition: IonSource.h:140
const String & getColumn() const
returns a const reference to the column description
void deleteMetaInfo_(const String &parent_table, const String &condition)
Conditionally deletes MetaInfo data from database.
Parse Error exception.
Definition: Exception.h:608
Represents the peptide hits for a spectrum.
Definition: PeptideIdentification.h:63
const std::vector< String > & getEluents() const
returns a const reference to the list of eluents
bool getMetadataOnly() const
returns whether or not to load only meta data