A class for accessing and storing data in a SQL database. More...
#include <OpenMS/FORMAT/DB/DBAdapter.h>
Public Member Functions | |
DBAdapter (DBConnection &db_con) | |
Constructor. More... | |
~DBAdapter () | |
Destructor. More... | |
template<class ExperimentType > | |
void | storeExperiment (ExperimentType &exp) |
Stores a MSExperiment. More... | |
template<class ExperimentType > | |
void | loadExperiment (UID id, ExperimentType &exp) |
Reads a MSExperiment. More... | |
template<class SpectrumType > | |
void | loadSpectrum (UID id, SpectrumType &spec) |
Reads a MSSpectrum. More... | |
PeakFileOptions & | getOptions () |
Mutable access to the options for loading/storing. More... | |
const PeakFileOptions & | getOptions () const |
Non-mutable access to the options for loading/storing. More... | |
bool | checkDBVersion (bool warning) |
Returns true if the DB is up-to-date (Checks the version in ADMIN_Version table). More... | |
void | createDB () |
Deletes all tables in the database and creates a new OpenMS database. More... | |
Private Member Functions | |
DBAdapter () | |
Not implemented. More... | |
UID | storeMetaInfo_ (const String &parent_table, UID parent_id, const MetaInfoInterface &info) |
Stores, updates or deletes MetaInfo data. More... | |
UID | storeMetaInfo_ (const String &parent_table, UID parent_id, const Peak1D &peak) |
Overload for Peak1D that does nothing. More... | |
UID | storeMetaInfo_ (const String &parent_table, UID parent_id, const RichPeak1D &peak) |
Overloaded method for RichPeak1D, which is both a MetaInfoInterface and a Peak1D. More... | |
UID | storeMetaInfo_ (const String &parent_table, UID parent_id, const Precursor &peak) |
Overloaded method for RichPeak1D, which is both a MetaInfoInterface (via CVTermList) and a and a Peak1D. More... | |
void | loadMetaInfo_ (UID id, MetaInfoInterface &info) |
Loads MetaInfo data from database. More... | |
void | loadMetaInfo_ (UID id, Peak1D &peak) |
Overloaded method for Peak1D, which does nothing. More... | |
void | loadMetaInfo_ (UID id, RichPeak1D &peak) |
Overloaded method for RichPeak1D, which is both a MetaInfoInterface and a Peak1D. More... | |
void | loadMetaInfo_ (UID id, Precursor &peak) |
Overloaded method for Precursor, which is both a MetaInfoInterface (via CVTermList) and a Peak1D. More... | |
void | deleteMetaInfo_ (const String &parent_table, const String &condition) |
Conditionally deletes MetaInfo data from database. More... | |
UID | storeFile_ (const String &parent_table, UID parent_id, const SourceFile &file) |
Stores, updates or deletes file information. More... | |
void | loadFile_ (UID id, SourceFile &file) |
Loads file information. More... | |
UID | storeSample_ (const Sample &sample, UID exp_id, UID parent_id) |
Stores, updates or deletes sample information. More... | |
void | loadSample_ (UID id, Sample &sample) |
Loads sample information. More... | |
Private Attributes | |
DBConnection & | db_con_ |
Reference to the DB connection handed over in the constructor. More... | |
PeakFileOptions | options_ |
A class for accessing and storing data in a SQL database.
It can be used to create objects from the DB or store them in the DB.
Add DataProcessing to MetaInfoDescription (Hiwi, Mathias)
Check if test is really complete (Hiwi, Mathias)
Check that all values are quoted (Hiwi, Mathias)
Implement StringDataArray and IntegerDataArray of spectrum (Hiwi, Mathias)
DBAdapter | ( | DBConnection & | db_con | ) |
Constructor.
~DBAdapter | ( | ) |
Destructor.
|
private |
Not implemented.
bool checkDBVersion | ( | bool | warning | ) |
Returns true if the DB is up-to-date (Checks the version in ADMIN_Version table).
warning | if this is set, a warning is issued to stderr if the db is not up-to-date. |
Referenced by DBAdapter::loadExperiment(), DBAdapter::loadSpectrum(), and DBAdapter::storeExperiment().
void createDB | ( | ) |
Deletes all tables in the database and creates a new OpenMS database.
Conditionally deletes MetaInfo data from database.
Referenced by DBAdapter::storeExperiment().
PeakFileOptions& getOptions | ( | ) |
Mutable access to the options for loading/storing.
Referenced by TOPPViewBase::metadataDatabaseDialog().
const PeakFileOptions& getOptions | ( | ) | const |
Non-mutable access to the options for loading/storing.
void loadExperiment | ( | UID | id, |
ExperimentType & | exp | ||
) |
Reads a MSExperiment.
References DBAdapter::checkDBVersion(), ProteinIdentification::SearchParameters::db, DBAdapter::db_con_, DBConnection::executeQuery(), PeakFileOptions::getMetadataOnly(), PeakFileOptions::getMSLevels(), PeakFileOptions::getRTRange(), ProteinIdentification::getSearchParameters(), PeakFileOptions::hasMSLevels(), PeakFileOptions::hasRTRange(), DBAdapter::loadMetaInfo_(), DBAdapter::loadSample_(), DBAdapter::loadSpectrum(), DIntervalBase< D >::maxPosition(), DIntervalBase< D >::minPosition(), DBAdapter::options_, DateTime::set(), ProteinHit::setAccession(), MassAnalyzer::setAccuracy(), IonDetector::setAcquisitionMode(), IonDetector::setADCSamplingFrequency(), ContactPerson::setContactInfo(), ProteinIdentification::setDateTime(), ContactPerson::setEmail(), MassAnalyzer::setFinalMSExponent(), ContactPerson::setFirstName(), ProteinIdentification::setHigherScoreBetter(), ProteinIdentification::setHits(), IonSource::setInletType(), ContactPerson::setInstitution(), IonSource::setIonizationMethod(), MassAnalyzer::setIsolationWidth(), ContactPerson::setLastName(), MassAnalyzer::setMagneticFieldStrength(), Software::setName(), IonDetector::setOrder(), IonSource::setOrder(), MassAnalyzer::setOrder(), IonSource::setPolarity(), ProteinHit::setRank(), MassAnalyzer::setReflectronState(), IonDetector::setResolution(), MassAnalyzer::setResolution(), MassAnalyzer::setResolutionMethod(), MassAnalyzer::setResolutionType(), MassAnalyzer::setScanDirection(), MassAnalyzer::setScanLaw(), MassAnalyzer::setScanRate(), MassAnalyzer::setScanTime(), ProteinHit::setScore(), ProteinIdentification::setScoreType(), ProteinIdentification::setSearchEngine(), ProteinIdentification::setSearchEngineVersion(), ProteinIdentification::setSearchParameters(), ProteinHit::setSequence(), ProteinIdentification::setSignificanceThreshold(), MassAnalyzer::setTOFTotalPathLength(), IonDetector::setType(), MassAnalyzer::setType(), Software::setVersion(), String::toInt(), and String::toQString().
Referenced by TOPPViewBase::addDataDB(), and TOPPViewBase::metadataDatabaseDialog().
|
private |
Loads file information.
Referenced by DBAdapter::loadSpectrum().
|
private |
Loads MetaInfo data from database.
Referenced by DBAdapter::loadExperiment(), and DBAdapter::loadSpectrum().
Overloaded method for Peak1D, which does nothing.
|
private |
Overloaded method for RichPeak1D, which is both a MetaInfoInterface and a Peak1D.
Overloaded method for Precursor, which is both a MetaInfoInterface (via CVTermList) and a Peak1D.
Loads sample information.
Referenced by DBAdapter::loadExperiment().
void loadSpectrum | ( | UID | id, |
SpectrumType & | spec | ||
) |
Reads a MSSpectrum.
References ScanWindow::begin, DBAdapter::checkDBVersion(), DBAdapter::db_con_, ScanWindow::end, DBConnection::executeQuery(), PeakFileOptions::getIntensityRange(), PeakFileOptions::getMZRange(), DataProcessing::getProcessingActions(), PeakFileOptions::hasIntensityRange(), PeakFileOptions::hasMZRange(), DBAdapter::loadFile_(), DBAdapter::loadMetaInfo_(), DIntervalBase< D >::maxPosition(), DIntervalBase< D >::minPosition(), DBAdapter::options_, DateTime::set(), PeptideHit::setAAAfter(), PeptideHit::setAABefore(), PeptideHit::setCharge(), DataProcessing::setCompletionTime(), PeptideIdentification::setHigherScoreBetter(), PeptideIdentification::setHits(), Acquisition::setIdentifier(), Software::setName(), InstrumentSettings::setPolarity(), Peak2D::setPosition(), InstrumentSettings::setScanMode(), PeptideHit::setScore(), PeptideIdentification::setScoreType(), PeptideHit::setSequence(), PeptideIdentification::setSignificanceThreshold(), DataProcessing::setSoftware(), Software::setVersion(), and InstrumentSettings::setZoomScan().
Referenced by DBAdapter::loadExperiment().
void storeExperiment | ( | ExperimentType & | exp | ) |
Stores a MSExperiment.
References DBAdapter::checkDBVersion(), DBAdapter::db_con_, DBAdapter::deleteMetaInfo_(), DBConnection::executeQuery(), DBConnection::getAutoId(), HPLC::getColumn(), HPLC::getComment(), Instrument::getCustomizations(), Gradient::getEluents(), HPLC::getFlux(), HPLC::getInstrument(), Instrument::getIonOptics(), AcquisitionInfo::getMethodOfCombination(), Instrument::getModel(), Software::getName(), Gradient::getPercentages(), InstrumentSettings::getPolarity(), HPLC::getPressure(), InstrumentSettings::getScanMode(), InstrumentSettings::getScanWindows(), Instrument::getSoftware(), HPLC::getTemperature(), Gradient::getTimepoints(), Instrument::getVendor(), Software::getVersion(), InstrumentSettings::getZoomScan(), DBAdapter::storeFile_(), DBAdapter::storeMetaInfo_(), and DBAdapter::storeSample_().
|
private |
Stores, updates or deletes file information.
Referenced by DBAdapter::storeExperiment().
|
private |
Stores, updates or deletes MetaInfo data.
Referenced by DBAdapter::storeExperiment().
Overload for Peak1D that does nothing.
|
private |
Overloaded method for RichPeak1D, which is both a MetaInfoInterface and a Peak1D.
Overloaded method for RichPeak1D, which is both a MetaInfoInterface (via CVTermList) and a and a Peak1D.
Stores, updates or deletes sample information.
Referenced by DBAdapter::storeExperiment().
|
private |
Reference to the DB connection handed over in the constructor.
Referenced by DBAdapter::loadExperiment(), DBAdapter::loadSpectrum(), and DBAdapter::storeExperiment().
|
private |
Referenced by DBAdapter::loadExperiment(), and DBAdapter::loadSpectrum().
OpenMS / TOPP release 1.11.1 | Documentation generated on Thu Nov 14 2013 11:19:30 using doxygen 1.8.5 |