Package schrodinger :: Package application :: Package glide :: Package packages :: Module sp_filter
[hide private]
[frames] | no frames]

Module sp_filter

Client-server based cutoff calculator.

This module is based on the CutoffCalculator class, which is a stateful cutoff calculator. This class may be glued to an HTTP server via the CutoffHTTPServer and CutoffHTTPRequestHandler classes. It subclass, CutoffCalculatorClient, uses HTTP to connect to a server-based calculator object.

The idea is that a single server can be shared by multiple subjobs for the same parent docking job. The cutoff is initialized after an "induction period" during which all poses are accepted; after that, the cutoff is bumped a bit up or down depending on whether the latest pose was accepted or rejected, in such a way that the acceptance rate converges around the desired target (e.g. 10%).

Classes [hide private]
  Pose
Pose(score, title)
  CutoffCalculator
A stateful cutoff calculator.
  CutoffCalculatorClient
Subclass of CutoffCalculator which acts as a proxy to a remote CutoffCalculator, connecting via HTTP.
  CutoffHTTPRequestHandler
HTTP handler that dispatches GETs and POSTs to the appropriate methods of the CutoffCalculator object.
  CutoffHTTPServer
HTTPServer subclass that also keeps track of a CutoffCalculator and provides a mechanism for the request handler to tell the server to stop.
Functions [hide private]
 
parse_path(path)
Parse a slash-delimited path in which the first element is the "mode" and all the rest are the "args", returning a tuple (mode, args).
CutoffCalculator
get_cutoff_calculator(config_filename)
Create a cutoff calculator.
 
parse_args()
 
start_server(args)
Start the cutoff server, which will run until it times out or a client requests it to stop.
Variables [hide private]
  logger = log.get_output_logger("sp_filter")
  __package__ = 'schrodinger.application.glide.packages'
Function Details [hide private]

parse_path(path)

 

Parse a slash-delimited path in which the first element is the "mode" and all the rest are the "args", returning a tuple (mode, args). Example: "/foo/x/y" -> ("foo", ["x", "y"])

get_cutoff_calculator(config_filename)

 

Create a cutoff calculator. Depending on the contents of the config file, this may be a CutoffCalculator or a CutoffCalculatorClient.

Parameters:
  • config_filename (str) - configuration file to use. It should be a JSON file containing a dict with the arguments to the constructor of the cutoff calculator class to use
Returns: CutoffCalculator
cutoff calculator

start_server(args)

 

Start the cutoff server, which will run until it times out or a client requests it to stop.

Parameters:
  • args (command-line arguments) - argparse.Namespace