schrodinger.utils.multifpfile module

SQLite3 DB to hold several kinds of fingerprints associated with the same structures.

schrodinger.utils.multifpfile.make_fp_generator(fp_type)

Repeats code from createFpGenerators() (see phase_database.cpp).

Parameters:fp_type (phase.PhpFpType or str) – Fingerprint type.
Returns:Fingerprint generator.
Return type:canvas.ChmFPOut32
schrodinger.utils.multifpfile.bitset_to_list(bitset)
Parameters:bitset (like schrodinger.infra.canvas.ChmSparseBitset32) – Canvas bitset.
schrodinger.utils.multifpfile.get_fingerprint_types(filename)

Determines whether filename is a valid multi-fp file, and if it is, returns stored fingerprint types.

Parameters:filename (str) – File name.
Returns:List of available fingerprint types or None.
Return type:list(str) or None
class schrodinger.utils.multifpfile.MultiFPFileWriter(filename, fpnames)

Bases: object

__init__(filename, fpnames)
Parameters:fpnames (list(str)) – Fingerprint type names.
__enter__()
__exit__(*a)
close()
append(chmol, molid=None)

Computes and stores fingerprints for Canvas molecule.

Parameters:
  • chmol (schrodinger.canvas.ChmMol) – Canvas molecule.
  • molid (int) – Molecule ID to use (must be unique). If not provided, next available value will be used.
Returns:

Molecule ID for the just added set of fingerprints.

Return type:

int

__class__

alias of builtins.type

__delattr__

Implement delattr(self, name).

__dict__ = mappingproxy({'__module__': 'schrodinger.utils.multifpfile', '__init__': <function MultiFPFileWriter.__init__>, '__enter__': <function MultiFPFileWriter.__enter__>, '__exit__': <function MultiFPFileWriter.__exit__>, 'close': <function MultiFPFileWriter.close>, 'append': <function MultiFPFileWriter.append>, '__dict__': <attribute '__dict__' of 'MultiFPFileWriter' objects>, '__weakref__': <attribute '__weakref__' of 'MultiFPFileWriter' objects>, '__doc__': None})
__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.utils.multifpfile'
__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.utils.multifpfile.MultiFPFile(filename)

Bases: object

Multi-fingerprint file (read-only, random access).

__init__(filename)
Parameters:filename (str) – File name.
__enter__()
__exit__(*a)
close()
get_typenames()
get_mol_ids()
Returns:List of molecule IDs.
Return type:list(int)
get_fingerprints(mol_id)
Returns:List of lists of the “on” bits for all types of fingerprints stored in the associated DB (ordered as the names returned by get_typenames()).
Return type:list(list(int))
iter_fingerprints(typenames=None, molids=None)

Generator to iterate over the fingerprints of the desired types.

Parameters:
  • typenames (list(str)) – List of desired fingerprint types.
  • molids (containment checkable for int) – IDs of desired entries (or None for all).
__class__

alias of builtins.type

__delattr__

Implement delattr(self, name).

__dict__ = mappingproxy({'__module__': 'schrodinger.utils.multifpfile', '__doc__': '\n Multi-fingerprint file (read-only, random access).\n ', '__init__': <function MultiFPFile.__init__>, '__enter__': <function MultiFPFile.__enter__>, '__exit__': <function MultiFPFile.__exit__>, 'close': <function MultiFPFile.close>, 'get_typenames': <function MultiFPFile.get_typenames>, 'get_mol_ids': <function MultiFPFile.get_mol_ids>, 'get_fingerprints': <function MultiFPFile.get_fingerprints>, 'iter_fingerprints': <function MultiFPFile.iter_fingerprints>, '__dict__': <attribute '__dict__' of 'MultiFPFile' objects>, '__weakref__': <attribute '__weakref__' of 'MultiFPFile' 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.utils.multifpfile'
__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)