Loading...
Searching...
No Matches
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< String > | smarts_
vector< String > | smart_names_
SmartsMatcher | matcher_

## Detailed Description

Definition at line 31 of file molecularSimilarity.h.

## Constructor & Destructor Documentation

## MolecularSimilarity()

BALL::MolecularSimilarity::MolecularSimilarity | ( | String | smarts_file | ) |

## Member Function Documentation

## calculateSimilarity() [1/2]

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

Calculate Tanimoto coefficient for two given binary fingerprints.

## calculateSimilarity() [2/2]

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.

## filterRedundantMolecules() [1/2]

void BALL::MolecularSimilarity::filterRedundantMolecules | ( | const list< Molecule * > & | molecules,
|  | float | similarity_threshold )

## filterRedundantMolecules() [2/2]

void BALL::MolecularSimilarity::filterRedundantMolecules | ( | System & | molecules,
|  | float | similarity_threshold )

## generateFingerprint()

void BALL::MolecularSimilarity::generateFingerprint | ( | Molecule & | molecule,
|  | vector< Size > & | fingerprint )

## generateFingerprints() [1/2]

void BALL::MolecularSimilarity::generateFingerprints | ( | const list< Molecule * > & | molecules,
|  | vector< vector< Size > > & | fingerprints )

## generateFingerprints() [2/2]

void BALL::MolecularSimilarity::generateFingerprints | ( | System & | molecules,
|  | vector< vector< Size > > & | fingerprints )

## generatePathFingerprint()

void BALL::MolecularSimilarity::generatePathFingerprint | ( | Molecule & | mol,
|  | vector< bool > & | fingerprint )

## generatePathFingerprint_()

bool BALL::MolecularSimilarity::generatePathFingerprint_ | ( | const Atom * | atom,
|  | std::vector< Size > & | path,
|  | std::set< const Bond * > & | path_bonds,
|  | std::vector< bool > & | fingerprint )

protected

## generatePathHash_()

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).

## getFunctionalGroupNames()

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

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

## Member Data Documentation

## fingerprints_

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

protected

Definition at line 84 of file molecularSimilarity.h.

## matcher_

SmartsMatcher BALL::MolecularSimilarity::matcher_

protected

Definition at line 88 of file molecularSimilarity.h.

## smart_names_

vector<String> BALL::MolecularSimilarity::smart_names_

protected

Definition at line 86 of file molecularSimilarity.h.

## smarts_

vector<String> BALL::MolecularSimilarity::smarts_

protected

Definition at line 85 of file molecularSimilarity.h.