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

#include <BALL/STRUCTURE/molecularSimilarity.h>

Public Member Functions

 MolecularSimilarity (String smarts_file)
 
void generateFingerprints (System &molecules, vector< vector< Size > > &fingerprints)
 
void generateFingerprints (const list< Molecule * > &molecules, vector< vector< Size > > &fingerprints)
 
void generateFingerprint (Molecule &molecule, vector< Size > &fingerprint)
 
void generatePathFingerprint (Molecule &mol, vector< bool > &fingerprint)
 
float calculateSimilarity (vector< bool > &fingerprint1, vector< bool > &fingerprint2)
 
void filterRedundantMolecules (const list< Molecule * > &molecules, float similarity_threshold)
 
void filterRedundantMolecules (System &molecules, float similarity_threshold)
 
float calculateSimilarity (vector< Size > &fingerprint1, vector< Size > &fingerprint2, vector< float > *stddev)
 
const vector< String > & getFunctionalGroupNames ()
 

Protected Member Functions

void generatePathHash_ (vector< Size > &path, Size &hash)
 
bool generatePathFingerprint_ (const Atom *atom, std::vector< Size > &path, std::set< const Bond * > &path_bonds, std::vector< bool > &fingerprint)
 

Protected Attributes

vector< vector< Size > > fingerprints_
 
vector< Stringsmarts_
 
vector< Stringsmart_names_
 
SmartsMatcher matcher_
 

Detailed Description

Definition at line 29 of file molecularSimilarity.h.

Constructor & Destructor Documentation

BALL::MolecularSimilarity::MolecularSimilarity ( String  smarts_file)

Member Function Documentation

float BALL::MolecularSimilarity::calculateSimilarity ( vector< bool > &  fingerprint1,
vector< bool > &  fingerprint2 
)

Calculate Tanimoto coefficient for two given binary fingerprints.

float BALL::MolecularSimilarity::calculateSimilarity ( vector< Size > &  fingerprint1,
vector< Size > &  fingerprint2,
vector< float > *  stddev 
)

Calculate similarity between two fingerprints.
If stddev for function-group counts are specified, then the similarity of position i in the fingerprint-vectors is defined as zero if their absolute difference is larger than the the standard deviation, else as 1-abs(difference_i/stddev_i). If no stddev for function-group counts are given, the calculated similarity-value is equal to Tanimoto.

void BALL::MolecularSimilarity::filterRedundantMolecules ( const list< Molecule * > &  molecules,
float  similarity_threshold 
)
void BALL::MolecularSimilarity::filterRedundantMolecules ( System molecules,
float  similarity_threshold 
)
void BALL::MolecularSimilarity::generateFingerprint ( Molecule molecule,
vector< Size > &  fingerprint 
)
void BALL::MolecularSimilarity::generateFingerprints ( System molecules,
vector< vector< Size > > &  fingerprints 
)
void BALL::MolecularSimilarity::generateFingerprints ( const list< Molecule * > &  molecules,
vector< vector< Size > > &  fingerprints 
)
void BALL::MolecularSimilarity::generatePathFingerprint ( Molecule mol,
vector< bool > &  fingerprint 
)
bool BALL::MolecularSimilarity::generatePathFingerprint_ ( const Atom atom,
std::vector< Size > &  path,
std::set< const Bond * > &  path_bonds,
std::vector< bool > &  fingerprint 
)
protected
void BALL::MolecularSimilarity::generatePathHash_ ( vector< Size > &  path,
Size hash 
)
protected

Generate a hash-ID for a given molecule-path.
This function was adapted from OpenBabel (finger2.cpp).

const vector<String>& BALL::MolecularSimilarity::getFunctionalGroupNames ( )

Returns the names of the functional groups that have been read from the SMARTS-file

Member Data Documentation

vector<vector<Size> > BALL::MolecularSimilarity::fingerprints_
protected

Definition at line 88 of file molecularSimilarity.h.

SmartsMatcher BALL::MolecularSimilarity::matcher_
protected

Definition at line 92 of file molecularSimilarity.h.

vector<String> BALL::MolecularSimilarity::smart_names_
protected

Definition at line 90 of file molecularSimilarity.h.

vector<String> BALL::MolecularSimilarity::smarts_
protected

Definition at line 89 of file molecularSimilarity.h.