schrodinger.application.combinatorial_screen.fingerprint_utils module

This module provides Canvas fingerprint-related functionality needed for combinatorial similarity screening.

Copyright Schrodinger LLC, All Rights Reserved.

schrodinger.application.combinatorial_screen.fingerprint_utils.create_reactant_fp_file(reactants_file, fp_file)

Creates a Canvas dendritic fingerprint file for a set of reactants in a .csv file or a .pfx zip archive.

Parameters:
  • reactants_file (str) – Input .csv file with SMILES and titles, or .pfx archive
  • fp_file (str) – Output fingerprint file. Will contain titles as the structure ids and SMILES as the lone extra data column.
Returns:

The number of fingerprints written

Return type:

int

Raises:
  • FileNotFoundError – If reactants_file cannot be found
  • canvas.ChmException – If a Canvas-related error occurs
schrodinger.application.combinatorial_screen.fingerprint_utils.get_reactant_combo_sim(query_fp, reactant_fp_lists, reactant_combo)

Returns the Tanimoto simliarity between the provided query fingerprint and the logical OR fingerprint of a particular reactant combination.

Parameters:
  • query_fp (canvas.ChmSparseBitset) – Query fingerprint
  • reactant_fp_lists (list(list(canvas.ChmSparseBitset))) – Lists of reactant fingerprints
  • reactant_combo (list(int)) – A list of 0-based positions into reactant_fp_lists which define the combination of reactants
Returns:

Tanimoto similarity

Return type:

float

schrodinger.application.combinatorial_screen.fingerprint_utils.rank_reactants(fp_file, query_fp, max_reactants, alpha=1.0, beta=0.0)

Reads a file of reactant fingerprints, scores them against a query fingerprint, and returns titles, SMILES, reactant indices and bitsets sorted by decreasing score and capped at max_reactants. Scores are computed as the Tversky similarity between reactant and query:

ON(R & Q) / (ON(R & Q) + alpha * ON(R - Q) + beta * ON(Q - R))

where:

ON(R & Q) = Number of ‘on’ bits shared by reactant and query ON(R - Q) = Number of ‘on’ bits that are unique to reactant ON(Q - R) = Number of ‘on’ bits that are unique to query

Parameters:
  • fp_file (str) – Input file of reactant fingerprints
  • query_fp (canvas.ChmSparseBitset) – Query fingerprint for scoring reactants
  • max_reactants (int) – Cap on the number of rows in each returned list
  • alpha (float) – Reactant weight
  • beta (float) – Query weight (use 1.0 for Tanimoto similarity)
Returns:

Lists of titles, SMILES, zero-based indices and bitsets

Return type:

list(str), list(str), list(int), list(canvas.ChmSparseBitset)

Raises:
  • FileNotFoundError – If fp_file cannot be found
  • canvas.ChmException – If a Canvas-related error occurs
schrodinger.application.combinatorial_screen.fingerprint_utils.read_reactant_fps(fp_file)

Reads a file of reactant fingerprints and returns titles, SMILES and bitsets for all rows in the file.

Parameters:

fp_file (str) – Input file of reactant fingerprints

Returns:

Lists of bitsets, titles and SMILES

Return type:

list(canvas.ChmSparseBitset), list(str), list(str)

Raises:
  • FileNotFoundError – If fp_file cannot be found
  • canvas.ChmException – If a Canvas-related error occurs
schrodinger.application.combinatorial_screen.fingerprint_utils.smiles_to_fingerprint(smiles)

Returns a dendritic fingerprint for the provided SMILES string.

Parameters:smiles (str) – SMILES string
Returns:Bitset that represents the fingerprint
Return type:canvas.ChmSparseBitset
Raises:RuntimeError – If a Canvas-related error occurs
schrodinger.application.combinatorial_screen.fingerprint_utils.smiles_to_fingerprints(smiles_list)

Returns dendritic fingerprints for a list of SMILES strings.

Parameters:smiles_list (list(str)) – List of SMILES strings
Returns:Fingerprints for the provided SMILES strings
Return type:list(canvas.ChmSparseBitset)
Raises:RuntimeError – If a Canvas-related error occurs