schrodinger.application.canvas.fingerprint module¶
Higher-level wrappers to the Canvas Fingerprint generation and manipulation classes.
Copyright Schrodinger, LLC. All rights reserved.
-
class
schrodinger.application.canvas.fingerprint.
CanvasFingerprintGenerator
(logger, default_type='Linear')¶ Bases:
object
A class to encapsulate canvas finger print generation. Fingerprints may be generated and returned as Fingerprint objects or may be written to a file.
-
FINGERPRINT_TYPES
= ['Linear', 'Radial', 'MolPrint2D', 'Atom Pairs', 'Atom Triplets', 'Topological Torsions', 'Dendritic']¶
-
SHORT_FINGERPRINT_TYPES
= ['linear', 'radial', 'molprint2D', 'pairwise', 'triplet', 'torsion', 'dendritic']¶
-
ATOM_TYPING_SCHEMES
= [' 1. All atoms equivalent; all bonds equivalent.', ' 2. Atoms distinguished by HB acceptor/donor; all bonds equivalent.', ' 3. Atoms distinguished by hybridization state; all bonds equivalent', ' 4. Atoms distinguished by functional type: {H}, {C}, {F,Cl}, {Br,I}, {N,0}, {S}, {other}; bonds by hybridization.', ' 5. Mol2 atom types; all bonds equivalent.', ' 6. Atoms distinguished by whether terminal, halogen, HB acceptor/donor bonds distinguished by bond order', ' 7. Atomic number and bond order', ' 8. Atoms distinguished by ring size, aromaticity, HB acceptor/donor, ionization potential, whether terminal, whether halogen; bonds distinguished by bond order', ' 9. Carhart atom types (atom-pairs approach); all bonds equivalent.', '10. Daylight invariant atom types; bonds distinguished by bond order.', '11. Same as 7, but aromatic distinguished from non-aromatic', '12. Same as 10, but cyclic aliphatic distinguished from acyclic aliphatic']¶
-
PRECISION
= ['32', '64']¶
-
DEFAULT_ATOM_TYPING_SCHEMES
= {'dendritic': 10, 'linear': 10, 'molprint2D': 5, 'pairwise': 9, 'radial': 4, 'torsion': 10, 'triplet': 10}¶
-
__del__
()¶
-
__init__
(logger, default_type='Linear')¶ Initialize self. See help(type(self)) for accurate signature.
-
debug
(output)¶ Wrapper for debug logging, just to simplify logging
-
getDefaultAtomTypingScheme
()¶ Once the fingerprint type has been set then this method will return the default atom typing scheme appropriate for that fingerprint type
-
getDescription
()¶ Returns a string representing a summary of the current fingerprint settings
-
getCurrentType
()¶ Returns the name of the fingerprint type current set:
-
setType
(fp_type)¶ Set the type of fingerprints to be generated by this generator. The type must be one of the values in the class variable CanvasFingerPrintGenerator.FINGERPRINT_TYPE
-
setPrecision
(precision)¶ Set the number of bits to be used for fingerprint generation.
-
getPrecision
()¶ Returns the current number of bits used for fingerprinting
-
setAtomBondTyping
(atom_bond_typing)¶ Set the atom typing scheme. This must be an integer from 1 to the number of atom typing schemes. The atom typing schemes are described in the class variable ATOM_TYPING_SCHEMES
-
getCurrentAtomBondTyping
()¶ Returns the current atom bond typing value
-
generate
(st, chmmol=False)¶ Return a fingerprint object using the current settings for type, bit width and atom typing for the Structure object st
Parameters: st (schrodinger.structure.Structure or canvas.base.chmmol object) – structure to generate the fingerprint for
-
open
(filename)¶ Open a file to which fingerprints are to be written
-
write
(st, fingerprint_id, chmmol=False)¶ Create a fingerprint from the structure ‘st’ and add it to the file with the ID ‘fingerprint_id’. If a file has not been opened then raise an exception
Parameters: st (schrodinger.structure.Structure or canvas.base.chmmol object) – structure to generate the fingerprint for
-
close
()¶ Close the file which was previously open for finger print generation
-
__class__
¶ alias of
builtins.type
-
__delattr__
¶ Implement delattr(self, name).
-
__dict__
= mappingproxy({'__module__': 'schrodinger.application.canvas.fingerprint', '__doc__': '\n A class to encapsulate canvas finger print generation.\n Fingerprints may be generated and returned as Fingerprint objects\n or may be written to a file.\n ', 'FINGERPRINT_TYPES': ['Linear', 'Radial', 'MolPrint2D', 'Atom Pairs', 'Atom Triplets', 'Topological Torsions', 'Dendritic'], 'SHORT_FINGERPRINT_TYPES': ['linear', 'radial', 'molprint2D', 'pairwise', 'triplet', 'torsion', 'dendritic'], 'ATOM_TYPING_SCHEMES': [' 1. All atoms equivalent; all bonds equivalent.', ' 2. Atoms distinguished by HB acceptor/donor; all bonds equivalent.', ' 3. Atoms distinguished by hybridization state; all bonds equivalent', ' 4. Atoms distinguished by functional type: {H}, {C}, {F,Cl}, {Br,I}, {N,0}, {S}, {other}; bonds by hybridization.', ' 5. Mol2 atom types; all bonds equivalent.', ' 6. Atoms distinguished by whether terminal, halogen, HB acceptor/donor bonds distinguished by bond order', ' 7. Atomic number and bond order', ' 8. Atoms distinguished by ring size, aromaticity, HB acceptor/donor, ionization potential, whether terminal, whether halogen; bonds distinguished by bond order', ' 9. Carhart atom types (atom-pairs approach); all bonds equivalent.', '10. Daylight invariant atom types; bonds distinguished by bond order.', '11. Same as 7, but aromatic distinguished from non-aromatic', '12. Same as 10, but cyclic aliphatic distinguished from acyclic aliphatic'], 'PRECISION': ['32', '64'], 'DEFAULT_ATOM_TYPING_SCHEMES': {'linear': 10, 'radial': 4, 'torsion': 10, 'pairwise': 9, 'triplet': 10, 'molprint2D': 5, 'dendritic': 10}, '__del__': <function CanvasFingerprintGenerator.__del__>, '__init__': <function CanvasFingerprintGenerator.__init__>, 'debug': <function CanvasFingerprintGenerator.debug>, 'getDefaultAtomTypingScheme': <function CanvasFingerprintGenerator.getDefaultAtomTypingScheme>, 'getDescription': <function CanvasFingerprintGenerator.getDescription>, 'getCurrentType': <function CanvasFingerprintGenerator.getCurrentType>, 'setType': <function CanvasFingerprintGenerator.setType>, 'setPrecision': <function CanvasFingerprintGenerator.setPrecision>, 'getPrecision': <function CanvasFingerprintGenerator.getPrecision>, 'setAtomBondTyping': <function CanvasFingerprintGenerator.setAtomBondTyping>, 'getCurrentAtomBondTyping': <function CanvasFingerprintGenerator.getCurrentAtomBondTyping>, '_getFingerprinter': <function CanvasFingerprintGenerator._getFingerprinter>, 'generate': <function CanvasFingerprintGenerator.generate>, 'open': <function CanvasFingerprintGenerator.open>, 'write': <function CanvasFingerprintGenerator.write>, 'close': <function CanvasFingerprintGenerator.close>, '__dict__': <attribute '__dict__' of 'CanvasFingerprintGenerator' objects>, '__weakref__': <attribute '__weakref__' of 'CanvasFingerprintGenerator' objects>})¶
-
__dir__
() → list¶ default dir() implementation
-
__eq__
¶ Return self==value.
-
__format__
()¶ default object formatter
-
__ge__
¶ Return self>=value.
-
__getattribute__
¶ Return getattr(self, name).
-
__gt__
¶ Return self>value.
-
__hash__
¶ Return hash(self).
-
__init_subclass__
()¶ This method is called when a class is subclassed.
The default implementation does nothing. It may be overridden to extend subclasses.
-
__le__
¶ Return self<=value.
-
__lt__
¶ Return self<value.
-
__module__
= 'schrodinger.application.canvas.fingerprint'¶
-
__ne__
¶ Return self!=value.
-
__new__
()¶ Create and return a new object. See help(type) for accurate signature.
-
__reduce__
()¶ helper for pickle
-
__reduce_ex__
()¶ helper for pickle
-
__repr__
¶ Return repr(self).
-
__setattr__
¶ Implement setattr(self, name, value).
-
__sizeof__
() → int¶ size of object in memory, in bytes
-
__str__
¶ Return str(self).
-
__subclasshook__
()¶ Abstract classes can override this to customize issubclass().
This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).
-
__weakref__
¶ list of weak references to the object (if defined)
-
-
class
schrodinger.application.canvas.fingerprint.
CanvasFingerprintGeneratorCLI
(logger, default_type='Linear')¶ Bases:
schrodinger.application.canvas.fingerprint.CanvasFingerprintGenerator
A subclass of the canvas fingerprint generator which is to be used from a program with a command line interface. This class has methods for defining options in an option parser and for applying those options once they’ve been parsed. The idea is to provide a standard command line interface for setting the fingerprint options
-
__init__
(logger, default_type='Linear')¶ Initialize self. See help(type(self)) for accurate signature.
-
addOptions
(parser)¶ Add options for fingerprint type, atom typing scheme and number of bits to use. The parser argument is an instance of a SingleDashOptionParser.
-
parseOptions
(options)¶ Examine the options and set the internal state to reflect them.
-
getOptionDesc
()¶ A method which returns a summary of the options supported by the fingerprint generator
-
getAtomBondTypingSchemeDescription
()¶ Return a string which contains a description of the atom and bond typing schemes available for fingerprint generation
-
getFingerprintDescription
()¶ Return a string which contains a description of the atom and bond typing schemes available for fingerprint generation
-
ATOM_TYPING_SCHEMES
= [' 1. All atoms equivalent; all bonds equivalent.', ' 2. Atoms distinguished by HB acceptor/donor; all bonds equivalent.', ' 3. Atoms distinguished by hybridization state; all bonds equivalent', ' 4. Atoms distinguished by functional type: {H}, {C}, {F,Cl}, {Br,I}, {N,0}, {S}, {other}; bonds by hybridization.', ' 5. Mol2 atom types; all bonds equivalent.', ' 6. Atoms distinguished by whether terminal, halogen, HB acceptor/donor bonds distinguished by bond order', ' 7. Atomic number and bond order', ' 8. Atoms distinguished by ring size, aromaticity, HB acceptor/donor, ionization potential, whether terminal, whether halogen; bonds distinguished by bond order', ' 9. Carhart atom types (atom-pairs approach); all bonds equivalent.', '10. Daylight invariant atom types; bonds distinguished by bond order.', '11. Same as 7, but aromatic distinguished from non-aromatic', '12. Same as 10, but cyclic aliphatic distinguished from acyclic aliphatic']¶
-
DEFAULT_ATOM_TYPING_SCHEMES
= {'dendritic': 10, 'linear': 10, 'molprint2D': 5, 'pairwise': 9, 'radial': 4, 'torsion': 10, 'triplet': 10}¶
-
FINGERPRINT_TYPES
= ['Linear', 'Radial', 'MolPrint2D', 'Atom Pairs', 'Atom Triplets', 'Topological Torsions', 'Dendritic']¶
-
PRECISION
= ['32', '64']¶
-
SHORT_FINGERPRINT_TYPES
= ['linear', 'radial', 'molprint2D', 'pairwise', 'triplet', 'torsion', 'dendritic']¶
-
__class__
¶ alias of
builtins.type
-
__del__
()¶
-
__delattr__
¶ Implement delattr(self, name).
-
__dict__
= mappingproxy({'__module__': 'schrodinger.application.canvas.fingerprint', '__doc__': "\n A subclass of the canvas fingerprint generator which is to be\n used from a program with a command line interface. This class has\n methods for defining options in an option parser and for applying\n those options once they've been parsed. The idea is to provide a\n standard command line interface for setting the fingerprint options\n ", '__init__': <function CanvasFingerprintGeneratorCLI.__init__>, 'addOptions': <function CanvasFingerprintGeneratorCLI.addOptions>, 'parseOptions': <function CanvasFingerprintGeneratorCLI.parseOptions>, 'getOptionDesc': <function CanvasFingerprintGeneratorCLI.getOptionDesc>, 'getAtomBondTypingSchemeDescription': <function CanvasFingerprintGeneratorCLI.getAtomBondTypingSchemeDescription>, 'getFingerprintDescription': <function CanvasFingerprintGeneratorCLI.getFingerprintDescription>})¶
-
__dir__
() → list¶ default dir() implementation
-
__eq__
¶ Return self==value.
-
__format__
()¶ default object formatter
-
__ge__
¶ Return self>=value.
-
__getattribute__
¶ Return getattr(self, name).
-
__gt__
¶ Return self>value.
-
__hash__
¶ Return hash(self).
-
__init_subclass__
()¶ This method is called when a class is subclassed.
The default implementation does nothing. It may be overridden to extend subclasses.
-
__le__
¶ Return self<=value.
-
__lt__
¶ Return self<value.
-
__module__
= 'schrodinger.application.canvas.fingerprint'¶
-
__ne__
¶ Return self!=value.
-
__new__
()¶ Create and return a new object. See help(type) for accurate signature.
-
__reduce__
()¶ helper for pickle
-
__reduce_ex__
()¶ helper for pickle
-
__repr__
¶ Return repr(self).
-
__setattr__
¶ Implement setattr(self, name, value).
-
__sizeof__
() → int¶ size of object in memory, in bytes
-
__str__
¶ Return str(self).
-
__subclasshook__
()¶ Abstract classes can override this to customize issubclass().
This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).
-
__weakref__
¶ list of weak references to the object (if defined)
-
close
()¶ Close the file which was previously open for finger print generation
-
debug
(output)¶ Wrapper for debug logging, just to simplify logging
-
generate
(st, chmmol=False)¶ Return a fingerprint object using the current settings for type, bit width and atom typing for the Structure object st
Parameters: st (schrodinger.structure.Structure or canvas.base.chmmol object) – structure to generate the fingerprint for
-
getCurrentAtomBondTyping
()¶ Returns the current atom bond typing value
-
getCurrentType
()¶ Returns the name of the fingerprint type current set:
-
getDefaultAtomTypingScheme
()¶ Once the fingerprint type has been set then this method will return the default atom typing scheme appropriate for that fingerprint type
-
getDescription
()¶ Returns a string representing a summary of the current fingerprint settings
-
getPrecision
()¶ Returns the current number of bits used for fingerprinting
-
open
(filename)¶ Open a file to which fingerprints are to be written
-
setAtomBondTyping
(atom_bond_typing)¶ Set the atom typing scheme. This must be an integer from 1 to the number of atom typing schemes. The atom typing schemes are described in the class variable ATOM_TYPING_SCHEMES
-
setPrecision
(precision)¶ Set the number of bits to be used for fingerprint generation.
-
setType
(fp_type)¶ Set the type of fingerprints to be generated by this generator. The type must be one of the values in the class variable CanvasFingerPrintGenerator.FINGERPRINT_TYPE
-
write
(st, fingerprint_id, chmmol=False)¶ Create a fingerprint from the structure ‘st’ and add it to the file with the ID ‘fingerprint_id’. If a file has not been opened then raise an exception
Parameters: st (schrodinger.structure.Structure or canvas.base.chmmol object) – structure to generate the fingerprint for
-