Chemical Data Processing Library Python API - Version 1.4.0
Classes | Public Member Functions | Properties | List of all members
CDPL.ConfGen.TorsionRule Class Reference

Data structure for the representation of single torsion library rules. More...

+ Inheritance diagram for CDPL.ConfGen.TorsionRule:

Classes

class  AngleEntry
 One preferred torsion angle for a rule, characterized by its value, the two tolerance bands and a score. More...
 

Public Member Functions

None __init__ ()
 Initializes the TorsionRule instance.
 
None __init__ (TorsionRule rule)
 Initializes a copy of the TorsionRule instance rule. More...
 
int getObjectID ()
 Returns the numeric identifier (ID) of the wrapped C++ class instance. More...
 
TorsionRule assign (TorsionRule rule)
 Replaces the current state of self with a copy of the state of the TorsionRule instance rule. More...
 
str getMatchPatternString ()
 Returns the SMARTS match pattern. More...
 
None setMatchPatternString (str ptn_str)
 Sets the SMARTS match pattern. More...
 
Chem.MolecularGraph getMatchPattern ()
 Returns the match pattern molecular graph. More...
 
None setMatchPattern (Chem.MolecularGraph ptn)
 Sets the match pattern molecular graph. More...
 
int getNumAngles ()
 Returns the number of stored angle entries. More...
 
AngleEntry getAngle (int idx)
 Returns the angle entry at index idx. More...
 
None removeAngle (int idx)
 Removes the angle entry at index idx. More...
 
None addAngle (AngleEntry ang_entry)
 Appends the angle entry ang_entry to the rule. More...
 
None addAngle (float ang, float tol1, float tol2, float score)
 
None clear ()
 Clears the match pattern and removes all angle entries.
 
None swap (TorsionRule rule)
 Swaps the contents of this rule with rule. More...
 
int __len__ ()
 
AngleEntry __getitem__ (int idx)
 
None __delitem__ (int idx)
 
None __iadd__ (AngleEntry ang_entry)
 Performs the in-place addition operation self += ang_entry. More...
 

Properties

 objectID = property(getObjectID)
 
 numAngles = property(getNumAngles)
 
 matchPatternString = property(getMatchPatternString, setMatchPatternString)
 
 matchPattern = property(getMatchPattern, setMatchPattern)
 

Detailed Description

Data structure for the representation of single torsion library rules.

Eeach rule consists of a SMARTS match pattern and a list of preferred torsion angles (each with tolerances and a score).

Constructor & Destructor Documentation

◆ __init__()

None CDPL.ConfGen.TorsionRule.__init__ ( TorsionRule  rule)

Initializes a copy of the TorsionRule instance rule.

Parameters
ruleThe TorsionRule instance to copy.

Member Function Documentation

◆ getObjectID()

int CDPL.ConfGen.TorsionRule.getObjectID ( )

Returns the numeric identifier (ID) of the wrapped C++ class instance.

Different Python TorsionRule instances may reference the same underlying C++ class instance. The commonly used Python expression a is not b thus cannot tell reliably whether the two TorsionRule instances a and b reference different C++ objects. The numeric identifier returned by this method allows to correctly implement such an identity test via the simple expression a.getObjectID() != b.getObjectID().

Returns
The numeric ID of the internally referenced C++ class instance.

◆ assign()

TorsionRule CDPL.ConfGen.TorsionRule.assign ( TorsionRule  rule)

Replaces the current state of self with a copy of the state of the TorsionRule instance rule.

Parameters
ruleThe TorsionRule instance to copy.
Returns
self

◆ getMatchPatternString()

str CDPL.ConfGen.TorsionRule.getMatchPatternString ( )

Returns the SMARTS match pattern.

Returns
A reference to the SMARTS match pattern.

◆ setMatchPatternString()

None CDPL.ConfGen.TorsionRule.setMatchPatternString ( str  ptn_str)

Sets the SMARTS match pattern.

Parameters
ptn_strThe new SMARTS match pattern.

◆ getMatchPattern()

Chem.MolecularGraph CDPL.ConfGen.TorsionRule.getMatchPattern ( )

Returns the match pattern molecular graph.

Returns
A shared reference to the match pattern molecular graph.

◆ setMatchPattern()

None CDPL.ConfGen.TorsionRule.setMatchPattern ( Chem.MolecularGraph  ptn)

Sets the match pattern molecular graph.

Parameters
ptnThe new match pattern molecular graph.

◆ getNumAngles()

int CDPL.ConfGen.TorsionRule.getNumAngles ( )

Returns the number of stored angle entries.

Returns
The angle-entry count.

◆ getAngle()

AngleEntry CDPL.ConfGen.TorsionRule.getAngle ( int  idx)

Returns the angle entry at index idx.

Parameters
idxThe zero-based angle-entry index.
Returns
A reference to the angle entry.
Exceptions
Base.IndexErrorif the number of angle entries is zero or idx is not in the range [0, getNumAngles() - 1].

◆ removeAngle()

None CDPL.ConfGen.TorsionRule.removeAngle ( int  idx)

Removes the angle entry at index idx.

Parameters
idxThe zero-based angle-entry index.
Exceptions
Base.IndexErrorif the number of angle entries is zero or idx is not in the range [0, getNumAngles() - 1].

◆ addAngle() [1/2]

None CDPL.ConfGen.TorsionRule.addAngle ( AngleEntry  ang_entry)

Appends the angle entry ang_entry to the rule.

Parameters
ang_entryThe angle entry to append.

◆ addAngle() [2/2]

None CDPL.ConfGen.TorsionRule.addAngle ( float  ang,
float  tol1,
float  tol2,
float  score 
)
Parameters
ang
tol1
tol2
score

◆ swap()

None CDPL.ConfGen.TorsionRule.swap ( TorsionRule  rule)

Swaps the contents of this rule with rule.

Parameters
ruleThe other torsion rule.

◆ __len__()

int CDPL.ConfGen.TorsionRule.__len__ ( )
Returns

◆ __getitem__()

AngleEntry CDPL.ConfGen.TorsionRule.__getitem__ ( int  idx)
Parameters
idx
Returns

◆ __delitem__()

None CDPL.ConfGen.TorsionRule.__delitem__ ( int  idx)
Parameters
idx

◆ __iadd__()

None CDPL.ConfGen.TorsionRule.__iadd__ ( AngleEntry  ang_entry)

Performs the in-place addition operation self += ang_entry.

Parameters
ang_entrySpecifies the second addend.
Returns
The updated None instance self.