schrodinger.application.matsci.smartsutils module¶
Utilities for working with SMARTS patterns
Copyright Schrodinger, LLC. All rights reserved.
-
class
schrodinger.application.matsci.smartsutils.SMARTSGroupData(number, name, pattern, indexes)¶ Bases:
tuple-
__contains__¶ Return key in self.
-
__init__¶ Initialize self. See help(type(self)) for accurate signature.
-
__len__¶ Return len(self).
-
count(value) → integer -- return number of occurrences of value¶
-
index(value[, start[, stop]]) → integer -- return first index of value.¶ Raises ValueError if the value is not present.
-
indexes¶ Alias for field number 3
-
name¶ Alias for field number 1
-
number¶ Alias for field number 0
-
pattern¶ Alias for field number 2
-
-
schrodinger.application.matsci.smartsutils.validate_name(name)¶ Make sure name has the correct set of characters
Parameters: name (str) – The string to check Return type: bool Returns: True if name has no invalid characters, False if any characters are invalid
-
exception
schrodinger.application.matsci.smartsutils.SMARTSGroupError¶ Bases:
ExceptionClass for exceptions related to SMARTS group finding
-
__init__¶ Initialize self. See help(type(self)) for accurate signature.
-
args¶
-
with_traceback()¶ Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
-
-
schrodinger.application.matsci.smartsutils.delete_group_properties(struct)¶ Delete all SMARTS group properties (structure and atom) from the structure
Parameters: struct ( schrodinger.structure.Structure) – The structure to delete properties from
-
schrodinger.application.matsci.smartsutils.find_group_data(struct)¶ Find an SMARTS group data on the structure
Parameters: struct ( schrodinger.structure.Structure) – The structure to find groups onReturn type: dict Returns: A dictionary. Keys are smarts group numbers, values are SMARTSGroupDatanamed tuples for the SMARTS group with that numberRaises: SMARTSGroupError – If something in the data is not consistent
-
schrodinger.application.matsci.smartsutils.get_rdkit_atoms(smarts)¶ Return a collection of rdkit atoms for the given SMARTS. The return value has the length of a potential match group, for example for ‘cc’ this length is 2, for ‘[$([NH]([CH2])[CH2])]C’ it is 2, for [n-0X2].[n-0X2] it is 2, etc., even though there might be any number of matches if the pattern was matched.
Parameters: smarts (str) – the SMARTS pattern Raises: RuntimeError – if rdkit has a problem with the SMARTS Return type: rdkit.Chem.rdchem._ROAtomSeq Returns: the rdkit atoms
-
schrodinger.application.matsci.smartsutils.is_smarts_bonding_pair(smarts)¶ Return True if the given SMARTS would match a bonding pair, False otherwise.
Parameters: smarts (str) – the SMARTS pattern Return type: bool Returns: True if the SMARTS would match a bonding pair, False otherwise