Loading...
Searching...
No Matches
molecularSimilarity.h
Go to the documentation of this file.
// ----------------------------------------------------
// $Maintainer: Marcel Schumann $
// $Authors: Marcel Schumann $
// ----------------------------------------------------
// -*- Mode: C++; tab-width: 2; -*-
// vi: set ts=2:
//
#ifndef BALL_STRUCTURE_MOLECULARSIMILARITY_H
#define BALL_STRUCTURE_MOLECULARSIMILARITY_H
#ifndef BALL_COMMON_H
#include <BALL/common.h>
#endif
#ifndef BALL_CONFIG_CONFIG_H
#include <BALL/CONFIG/config.h>
#endif
#include <BALL/STRUCTURE/smartsMatcher.h>
#include <BALL/KERNEL/system.h>
#ifdef BALL_HAS_OPENBABEL
#include <openbabel/mol.h>
#endif
namespace BALL
{
class BALL_EXPORT MolecularSimilarity
{
public:
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);
#ifdef BALL_HAS_OPENBABEL
static OpenBabel::OBMol* createOBMol(const Molecule& mol, bool ignore_hydrogen=0, bool suppress_warning=0);
static Molecule* createMolecule(OpenBabel::OBMol& obmol, bool ignore_hydrogen=0);
void generateCanSmile(const Molecule& mol, String& cansmile, OpenBabel::OBMol** output_obmol=0, bool ignore_hydrogen=0);
void matchSmarts(const String& usmile, const String& smarts, Size& no_matches, Size max_matches=0);
#endif
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:
vector<vector<Size> > fingerprints_;
vector<String> smarts_;
vector<String> smart_names_;
SmartsMatcher matcher_;
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);
};
}
#endif
BALL_EXPORT
#define BALL_EXPORT
Definition COMMON/global.h:50
system.h
BALL::Atom
Definition atom.h:90
BALL::MolecularSimilarity::smart_names_
vector< String > smart_names_
Definition molecularSimilarity.h:86
BALL::MolecularSimilarity::matcher_
SmartsMatcher matcher_
Definition molecularSimilarity.h:88
BALL::MolecularSimilarity::smarts_
vector< String > smarts_
Definition molecularSimilarity.h:85
BALL::MolecularSimilarity::generatePathFingerprint
void generatePathFingerprint(Molecule &mol, vector< bool > &fingerprint)
BALL::MolecularSimilarity::filterRedundantMolecules
void filterRedundantMolecules(const list< Molecule * > &molecules, float similarity_threshold)
BALL::MolecularSimilarity::fingerprints_
vector< vector< Size > > fingerprints_
Definition molecularSimilarity.h:84
BALL::MolecularSimilarity::generateFingerprints
void generateFingerprints(const list< Molecule * > &molecules, vector< vector< Size > > &fingerprints)
BALL::MolecularSimilarity::generatePathHash_
void generatePathHash_(vector< Size > &path, Size &hash)
BALL::MolecularSimilarity::MolecularSimilarity
MolecularSimilarity(String smarts_file)
BALL::MolecularSimilarity::generatePathFingerprint_
bool generatePathFingerprint_(const Atom *atom, std::vector< Size > &path, std::set< const Bond * > &path_bonds, std::vector< bool > &fingerprint)
BALL::MolecularSimilarity::getFunctionalGroupNames
const vector< String > & getFunctionalGroupNames()
BALL::MolecularSimilarity::generateFingerprint
void generateFingerprint(Molecule &molecule, vector< Size > &fingerprint)
BALL::MolecularSimilarity::calculateSimilarity
float calculateSimilarity(vector< bool > &fingerprint1, vector< bool > &fingerprint2)
BALL::MolecularSimilarity::filterRedundantMolecules
void filterRedundantMolecules(System &molecules, float similarity_threshold)
BALL::MolecularSimilarity::generateFingerprints
void generateFingerprints(System &molecules, vector< vector< Size > > &fingerprints)
BALL::MolecularSimilarity::calculateSimilarity
float calculateSimilarity(vector< Size > &fingerprint1, vector< Size > &fingerprint2, vector< float > *stddev)
BALL::Molecule
Definition molecule.h:31
BALL::SmartsMatcher
Definition smartsMatcher.h:45
BALL::String
Definition string.h:57
BALL::System
Definition KERNEL/system.h:40
common.h
BALL
Definition constants.h:13
BALL::Size
BALL_SIZE_TYPE Size
Definition COMMON/global.h:114
BALL::molecules
BALL_EXPORT MoleculeList molecules(const AtomContainer &fragment, bool selected_only=false)
smartsMatcher.h