schrodinger.application.fpsim module

This module provides an API for performing GPU-based fingerprint similarity queries against compound databases on FPsim servers. Two variants of the API are provided: a query function and the FPsimSearcher class.

The module-level query function can be used to query either all or a specific subset of the public databses available on a single FPsim server.

The FPsimSearcher class allows multiple servers to be specified, each with either all public databases or a specific subset. The entire collection of databases may then be queried in a single call.

The server url should be the base url without the endpoint extension (e.g. http://fpsim.foo.com/, not http://fpsim.foo.com/similarity_search)

schrodinger.application.fpsim.query(smiles, url='FPSIM_DEFAULT', max_results=100, similarity_cutoff=0.5, dbnames='FPSIM_DEFAULT')

Perform an FPSim query for a given smiles on a specific server.

Parameters
  • smiles – the query smiles to search against

  • url – the base FPsim server URL

  • max_results – max number of matches to return

  • similarity_cutoff – minimum similarity cutoff for matches (0 - 1.0)

  • dbnames – names of databases to search. Default: all public databases

Returns

a pandas.DataFrame of similar smiles with corresponding corporate ids and similarity scores.

schrodinger.application.fpsim.get_public_databases(url='FPSIM_DEFAULT')

Retrieves a list of database names for the public databases on an FPsim server.

Parameters

url – the base FPsim server url. By default this will be the Schrodinger FPsim server.

Returns

a list of database names, which may be used as the dbnames parameter to a query.

Raises

requests.exception.ConnectionTimeout – when the get request, which should be instantaneous (up to network delays), takes longer than 3s.

class schrodinger.application.fpsim.FPsimSearcher(url='FPSIM_DEFAULT', dbnames='FPSIM_DEFAULT')

Bases: object

A search context for FPsim queries. Specify a collection of data sources on the object to perform multiple queries on the same servers and databases.

__init__(url='FPSIM_DEFAULT', dbnames='FPSIM_DEFAULT')
addSource(url='FPSIM_DEFAULT', dbnames='FPSIM_DEFAULT')

Add databases to the searcher specified by URL and database name(s).

Parameters
  • url – the base FPsim server url. By default this will be the Schrodinger FPsim server.

  • dbnames – the database name to add for the specified server. This may be a single name or a list of names.

getSources()

Gets all the sources that have been added to this searcher. :return: a dictionary of {url:dbnames}.

query(smiles, max_results=100, similarity_cutoff=0.5)

Perform a query on all the sources in this searcher. Each server will be queried in the order it was added via addSource until max_results results have been found. The results from each server are simply concatenated, with no de-duplication of results.

See module function query() for parameter docs.

exception schrodinger.application.fpsim.ServerError

Bases: RuntimeError

exception schrodinger.application.fpsim.QueryError

Bases: RuntimeError

exception schrodinger.application.fpsim.SearchError

Bases: RuntimeError