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}
__init__(logger, default_type='Linear')
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, stereo=0)

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

  • stereo (canvas.ChmMmctAdaptor.StereoType) – stereo type that should be used when creating chmmol from a Structure object

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 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')
addOptions(parser)

Add options for fingerprint type, atom typing scheme and number of bits to use. The parser argument is an instance of argparse.ArgumentParser.

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