BALL  1.4.79
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Classes | Public Member Functions | Static Public Member Functions | List of all members
BALL::MolDB Class Reference

#include <BALL/FORMAT/molDB.h>

Classes

struct  VendorInfo
 

Public Member Functions

int getVersion ()
 
 MolDB (String hostname, String user, String password, String db, int port=3306)
 
virtual ~MolDB ()
 
void getDatasetSummary (vector< String > &dataset_names, vector< Size > &no_isomers, vector< Size > &no_conformations)
 
void searchMoleculesByUCK (String uck, list< LongSize > &conformation_IDs)
 
MoleculefetchMoleculeById (LongSize conformation_id)
 
vector< Molecule * > fetchMoleculeById (vector< LongSize > &conformation_ids)
 
LongSize storeMolecule (Molecule *mol, String *conformation_hash)
 
LongSize storeMolecule (Molecule *mol)
 
void deleteIsomer (LongSize isomer_id)
 
void deleteConformation (LongSize conformation_id)
 
void storeResult (Result *result, String &target_name)
 
vector< Result * > fetchResults (list< String > &conformation_hashs, String target_name="")
 
void searchMoleculesByLogP (const double &min_logP, const double &max_logP, list< LongSize > &conformation_IDs, const list< LongSize > *conformation_IDs_to_check, bool input_isomer_IDs=0, bool output_isomer_IDs=0)
 
void searchMoleculesByMW (const double &min_MW, const double &max_MW, list< LongSize > &conformation_IDs, const list< LongSize > *conformation_IDs_to_check, bool input_isomer_IDs, bool output_isomer_IDs)
 
void fetchDatasetConformationIDs (String &target_name, list< LongSize > &conformation_IDs, const list< LongSize > *conformation_IDs_to_check=0, bool input_isomer_IDs=0, bool output_isomer_IDs=0)
 
void searchSimilarMoleculesByFingerprint (list< vector< bool > > &query_fingerprints, const float &minimal_similarity, const float &maximal_similarity, list< LongSize > &conformation_IDs, const list< LongSize > *conformation_IDs_to_check=0, bool input_isomer_IDs=0, bool output_isomer_IDs=0)
 
void fetchVendorInformation (Molecule *mol, list< VendorInfo > &vendor_info)
 
bool hasResults ()
 
void disableFunctionalGroupCounting ()
 
void setVendorPropertyNames (String vendor_name, String vendors_compound_id_tag, bool fetch_vendorname_from_prop, String vendor_version, String url)
 

Static Public Member Functions

static void createNewDatabase (String &host, String &user, String &password, String &db_name, int port=0)
 
static void buildTopology (Molecule &mol, QByteArray &data)
 
static void getTopology (Molecule &mol, QDataStream &ds)
 
static void buildCoordinates (Molecule &mol, QByteArray &data)
 
static void getCoordinates (Molecule &mol, QDataStream &ds)
 
static void buildCharges (Molecule &mol, QByteArray &data)
 
static void getCharges (Molecule &mol, QDataStream &ds)
 

Detailed Description

Molecule database class.
This class is intended to store small molecules, information about them (fingerprint, smiles, etc.) and results of docking or (re-)scoring.
Topologies and conformations are stored separately in order to prevent waste of space. IDs will be automatically assigned to new topologies and conformations.

When a given molecule is to be stored in the database (by use of MolDB::storeMolecule()), it is automatically detected (by use of hash-keys for topologies and conformations) whether its topology and conformation need to be written to the database or whether they already exists in the database. This way, waste of disk space is automatically prevented.
Furthermore, all Properties of a given molecule will also be saved and will be restored when retrieving the molecule later.

Additionally, the following things that can be used for searching molecules later will be automatically calculated and stored in the database: – molecular weight – canonical smile (if OpenEye or OpenBabel is available) – logP (if OpenEye or OpenBabel is available; needed for SMARTS matching) – binary pathway-based fingerprint – functional group counts (if OpenEye or OpenBabel is available; needed for SMARTS matching).

Information about docking or (re-)scoring can be stored by use MolDB::storeResult() and retrieved later by MolDB::fetchResults().

Definition at line 48 of file molDB.h.

Constructor & Destructor Documentation

BALL::MolDB::MolDB ( String  hostname,
String  user,
String  password,
String  db,
int  port = 3306 
)

Create MolDB instance with database connection parameters.

Parameters
hostname
username
password
dbname
virtual BALL::MolDB::~MolDB ( )
virtual

Member Function Documentation

static void BALL::MolDB::buildCharges ( Molecule mol,
QByteArray &  data 
)
static

Reconstruct molecule charges from binary data.

Parameters
targetmolecule for building charges
binarydata fetched from database
static void BALL::MolDB::buildCoordinates ( Molecule mol,
QByteArray &  data 
)
static

Reconstruct molecule conformation from binary data.

Parameters
targetmolecule for building conformation
binarydata fetched from database
static void BALL::MolDB::buildTopology ( Molecule mol,
QByteArray &  data 
)
static

Reconstruct molecule topology from binary data.

Parameters
targetmolecule for building topology
binarydata fetched from database
static void BALL::MolDB::createNewDatabase ( String host,
String user,
String password,
String db_name,
int  port = 0 
)
static
void BALL::MolDB::deleteConformation ( LongSize  conformation_id)
void BALL::MolDB::deleteIsomer ( LongSize  isomer_id)
void BALL::MolDB::disableFunctionalGroupCounting ( )

Disable creation/filling of table 'functional_groups' during molecule import.

void BALL::MolDB::fetchDatasetConformationIDs ( String target_name,
list< LongSize > &  conformation_IDs,
const list< LongSize > *  conformation_IDs_to_check = 0,
bool  input_isomer_IDs = 0,
bool  output_isomer_IDs = 0 
)

Fetch all conformation-IDs for a given target.

Molecule* BALL::MolDB::fetchMoleculeById ( LongSize  conformation_id)
vector<Molecule*> BALL::MolDB::fetchMoleculeById ( vector< LongSize > &  conformation_ids)
vector<Result*> BALL::MolDB::fetchResults ( list< String > &  conformation_hashs,
String  target_name = "" 
)
void BALL::MolDB::fetchVendorInformation ( Molecule mol,
list< VendorInfo > &  vendor_info 
)

Search for vendors for the given compound.

Parameters
molinput compound
vendor_infovendor-information found for this compound will be stored here.
static void BALL::MolDB::getCharges ( Molecule mol,
QDataStream &  ds 
)
static

Encode the molecule charge data into binary data.

Parameters
sourcemolecule for extracting charges
binarydata stream to output data
static void BALL::MolDB::getCoordinates ( Molecule mol,
QDataStream &  ds 
)
static

Encode the molecule conformation into binary data.

Parameters
sourcemolecule for extracting conformation
binarydata stream to output data
void BALL::MolDB::getDatasetSummary ( vector< String > &  dataset_names,
vector< Size > &  no_isomers,
vector< Size > &  no_conformations 
)

Get a summary of all datasets currently stored in the data base.

Parameters
dataset_namesthe name of each dataset will be stored here
no_isomersthe number of distinct isomers of each of the datasets
no_conformationsthe number of distinct conformations of each of the datasets
static void BALL::MolDB::getTopology ( Molecule mol,
QDataStream &  ds 
)
static

Encode the molecule topology into binary data.

Parameters
sourcemolecule for extracting topology
binarydata stream to output data
int BALL::MolDB::getVersion ( )

Get version number of MolDB.

bool BALL::MolDB::hasResults ( )

Find out whether this database has a 'results' table or not. If it has such a table, the results of Docking/Scoring have been saved here.

void BALL::MolDB::searchMoleculesByLogP ( const double min_logP,
const double max_logP,
list< LongSize > &  conformation_IDs,
const list< LongSize > *  conformation_IDs_to_check,
bool  input_isomer_IDs = 0,
bool  output_isomer_IDs = 0 
)

Filter database according to specified logP thresholds.

void BALL::MolDB::searchMoleculesByMW ( const double min_MW,
const double max_MW,
list< LongSize > &  conformation_IDs,
const list< LongSize > *  conformation_IDs_to_check,
bool  input_isomer_IDs,
bool  output_isomer_IDs 
)

Filter database according to specified molecular weight thresholds.

void BALL::MolDB::searchMoleculesByUCK ( String  uck,
list< LongSize > &  conformation_IDs 
)
void BALL::MolDB::searchSimilarMoleculesByFingerprint ( list< vector< bool > > &  query_fingerprints,
const float minimal_similarity,
const float maximal_similarity,
list< LongSize > &  conformation_IDs,
const list< LongSize > *  conformation_IDs_to_check = 0,
bool  input_isomer_IDs = 0,
bool  output_isomer_IDs = 0 
)

Fetch all conformation-IDs for those molecules that have a tanimoto coefficient larger or equal than the given cutoff to at least one of the query fingerprints.

void BALL::MolDB::setVendorPropertyNames ( String  vendor_name,
String  vendors_compound_id_tag,
bool  fetch_vendorname_from_prop,
String  vendor_version,
String  url 
)
LongSize BALL::MolDB::storeMolecule ( Molecule mol,
String conformation_hash 
)
LongSize BALL::MolDB::storeMolecule ( Molecule mol)
inline

Definition at line 91 of file molDB.h.

void BALL::MolDB::storeResult ( Result result,
String target_name 
)