RDKit
Open-source cheminformatics and machine learning.
RDKit::SmartsMatcher Class Reference

#include <FilterMatchers.h>

Inheritance diagram for RDKit::SmartsMatcher:
RDKit::FilterMatcherBase

Public Member Functions

 SmartsMatcher (const std::string &name=SMARTS_MATCH_NAME_DEFAULT)
 Construct a SmartsMatcher. More...
 
 SmartsMatcher (const ROMol &pattern, unsigned int minCount=1, unsigned int maxCount=UINT_MAX)
 Construct a SmartsMatcher from a query molecule. More...
 
 SmartsMatcher (const std::string &name, const ROMol &pattern, unsigned int minCount=1, unsigned int maxCount=UINT_MAX)
 Construct a SmartsMatcher. More...
 
 SmartsMatcher (const std::string &name, const std::string &smarts, unsigned int minCount=1, unsigned int maxCount=UINT_MAX)
 Construct a SmartsMatcher from a smarts pattern. More...
 
 SmartsMatcher (const std::string &name, ROMOL_SPTR onPattern, unsigned int minCount=1, unsigned int maxCount=UINT_MAX)
 Construct a SmartsMatcher from a shared_ptr. More...
 
 SmartsMatcher (const SmartsMatcher &rhs)
 
bool isValid () const
 Returns True if the Smarts pattern is valid. More...
 
const ROMOL_SPTRgetPattern () const
 Return the shared_ptr to the underlying query molecule. More...
 
void setPattern (const std::string &smarts)
 Set the smarts pattern for the matcher. More...
 
void setPattern (const ROMol &mol)
 Set the query molecule for the matcher. More...
 
void setPattern (const ROMOL_SPTR &pat)
 Set the shared query molecule for the matcher. More...
 
unsigned int getMinCount () const
 Get the minimum match count for the pattern to be true. More...
 
void setMinCount (unsigned int val)
 Set the minimum match count for the pattern to be true. More...
 
unsigned int getMaxCount () const
 Get the maximum match count for the pattern to be true. More...
 
void setMaxCount (unsigned int val)
 Set the maximum match count for the pattern to be true. More...
 
virtual bool getMatches (const ROMol &mol, std::vector< FilterMatch > &matchVect) const
 getMatches More...
 
virtual bool hasMatch (const ROMol &mol) const
 hasMatches More...
 
virtual boost::shared_ptr< FilterMatcherBasecopy () const
 copy More...
 
- Public Member Functions inherited from RDKit::FilterMatcherBase
 FilterMatcherBase (const std::string &name=DEFAULT_FILTERMATCHERBASE_NAME)
 
 FilterMatcherBase (const FilterMatcherBase &rhs)
 
virtual ~FilterMatcherBase ()
 
virtual std::string getName () const
 
virtual boost::shared_ptr< FilterMatcherBaseClone () const
 Clone - deprecated. More...
 

Detailed Description

Definition at line 229 of file FilterMatchers.h.

Constructor & Destructor Documentation

RDKit::SmartsMatcher::SmartsMatcher ( const std::string &  name = SMARTS_MATCH_NAME_DEFAULT)
inline

Construct a SmartsMatcher.

Definition at line 236 of file FilterMatchers.h.

RDKit::SmartsMatcher::SmartsMatcher ( const ROMol pattern,
unsigned int  minCount = 1,
unsigned int  maxCount = UINT_MAX 
)

Construct a SmartsMatcher from a query molecule.

RDKit::SmartsMatcher::SmartsMatcher ( const std::string &  name,
const ROMol pattern,
unsigned int  minCount = 1,
unsigned int  maxCount = UINT_MAX 
)

Construct a SmartsMatcher.

RDKit::SmartsMatcher::SmartsMatcher ( const std::string &  name,
const std::string &  smarts,
unsigned int  minCount = 1,
unsigned int  maxCount = UINT_MAX 
)

Construct a SmartsMatcher from a smarts pattern.

RDKit::SmartsMatcher::SmartsMatcher ( const std::string &  name,
ROMOL_SPTR  onPattern,
unsigned int  minCount = 1,
unsigned int  maxCount = UINT_MAX 
)

Construct a SmartsMatcher from a shared_ptr.

RDKit::SmartsMatcher::SmartsMatcher ( const SmartsMatcher rhs)

Member Function Documentation

virtual boost::shared_ptr<FilterMatcherBase> RDKit::SmartsMatcher::copy ( ) const
inlinevirtual

copy

Implements RDKit::FilterMatcherBase.

Definition at line 324 of file FilterMatchers.h.

References RDKit::MolPickler::pickleMol(), and RDUNUSED_PARAM.

virtual bool RDKit::SmartsMatcher::getMatches ( const ROMol mol,
std::vector< FilterMatch > &  matchVect 
) const
virtual

getMatches

Match the filter against a molecule

Parameters
molreadonly const molecule being searched
matchesoutput vector of atom index matches found in the molecule

Implements RDKit::FilterMatcherBase.

unsigned int RDKit::SmartsMatcher::getMaxCount ( ) const
inline

Get the maximum match count for the pattern to be true.

Definition at line 317 of file FilterMatchers.h.

unsigned int RDKit::SmartsMatcher::getMinCount ( ) const
inline

Get the minimum match count for the pattern to be true.

Definition at line 313 of file FilterMatchers.h.

const ROMOL_SPTR& RDKit::SmartsMatcher::getPattern ( ) const
inline

Return the shared_ptr to the underlying query molecule.

Definition at line 304 of file FilterMatchers.h.

virtual bool RDKit::SmartsMatcher::hasMatch ( const ROMol mol) const
virtual

hasMatches

Does the given molecule contain this filter pattern

Parameters
molreadonly const molecule being searched

Implements RDKit::FilterMatcherBase.

bool RDKit::SmartsMatcher::isValid ( ) const
inlinevirtual

Returns True if the Smarts pattern is valid.

Implements RDKit::FilterMatcherBase.

Definition at line 301 of file FilterMatchers.h.

void RDKit::SmartsMatcher::setMaxCount ( unsigned int  val)
inline

Set the maximum match count for the pattern to be true.

Definition at line 319 of file FilterMatchers.h.

References RDKit::FilterMatchOps::And::getMatches(), and RDKit::FilterMatchOps::And::hasMatch().

void RDKit::SmartsMatcher::setMinCount ( unsigned int  val)
inline

Set the minimum match count for the pattern to be true.

Definition at line 315 of file FilterMatchers.h.

void RDKit::SmartsMatcher::setPattern ( const std::string &  smarts)

Set the smarts pattern for the matcher.

void RDKit::SmartsMatcher::setPattern ( const ROMol mol)

Set the query molecule for the matcher.

void RDKit::SmartsMatcher::setPattern ( const ROMOL_SPTR pat)
inline

Set the shared query molecule for the matcher.

Definition at line 310 of file FilterMatchers.h.


The documentation for this class was generated from the following file: