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)[source]

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)[source]
Parameters

bitset (like schrodinger.infra.canvas.ChmSparseBitset32) – Canvas bitset.

schrodinger.utils.multifpfile.get_fingerprint_types(filename)[source]

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)[source]

Bases: object

__init__(filename, fpnames)[source]
Parameters

fpnames (list(str)) – Fingerprint type names.

close()[source]
append(chmol, molid=None)[source]

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 schrodinger.utils.multifpfile.MultiFPFile(filename)[source]

Bases: object

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

__init__(filename)[source]
Parameters

filename (str) – File name.

close()[source]
get_typenames()[source]
get_mol_ids()[source]
Returns

List of molecule IDs.

Return type

list(int)

get_fingerprints(mol_id)[source]
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)[source]

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).