schrodinger.application.phase.packages.shape_screen_al_driver module

Implementation of screening large library with Shape Screen active learning scheme.

Shape screen active learning scheme 1. Select N ligands from the library 2. Shape Screen the selected portion of the library. 3. Train a ligand_ml model with the Shape CPU screening scores. 4. Evaluate the whole library with the generated ligand_ml model. 5. Pick N from the top M best ligands predicted by the ligand_ml model. 6. Shape Screen the ligands picked in step 5 and repeat step 3 until it reaches num_iter.

Copyright Schrodinger Inc, All Rights Reserved.

class schrodinger.application.phase.packages.shape_screen_al_driver.ActiveLearningShapeScreenJob(args, al_node_supplier)

Bases: schrodinger.active_learning.al_driver.ActiveLearningJob

__init__(args, al_node_supplier)

Initialize the ActiveLearningShapeScreenJob from the cmd arguments.

Parameters

args (argparse.Namespace) – argument namespace with command line options

LoadOptionalRestartFiles()

Load the restart files for the possible restarting of the running node.

Returns

list of filenames

Type

list(str) or None

LoadOptionalRestartFilesDict()

Load a dict of the optional restart files. The dictionary maps the jobname of the subjob to a list of optional files for restarting the subjob.

Returns

dict of optional files

Return type

{str: list}

static LoadPreviousNodes(restart_file)

Load nodes that were finished in previous job.

Parameters

restart_file (str) – filename of the AL .pkl restart file

Returns

Nodes that were finished in previous job.

Return type

OrderedDict that maps node name to node instance.

addOptionalRestartFilesDict()

Pass variable optional_restart_files_dict to the restart dictionary. Dump the restart dictionary as a pickle file.

checkOSFileLimit()

Check the system file descriptors limit.

configure()

Prepare the active learning job.

getInitialInputs()

Get the inputs for the runNode() method of the first node in the workflow.

Returns

dict that contains the keyword arguments and values for the runNode() of the first node.

Return type

dict{keyword argument: value}

getLocalArgs()
Returns

arguments on local machine.

Return type

argparse.Namespace

static getNodeClasses(use_known_score, al_node_supplier)

Return a list of node classes to run based on the job type.

Parameters
  • use_known_score (bool) – Use known scores in score_file to obtain the score.

  • al_node_supplier (ActiveLearningNodeSupplier) – Supplier of active learning nodes

Returns

a list of ActiveLearningNode subclass

Return type

list

getNodesToRun()

Return nodes to run and finished nodes for current active learning job.

getPilotScoreFile()

Reorder the columns in the pilot ligand score file for the use of machine learning model training input.

Returns

name of reorder .csv file.

Return type

str

getRestartNode()

Get the node for restarting the workflow.

Returns

last finished node

Return type

ActiveLearningNode

postprocessing()

Combine the log files of all subjobs.

property restart_files

Get all the necessary files for restarting the workflow from finished nodes.

Returns

a set of files for restarting.

Return type

set(str)

runNodes()

Run all the ActiveLearningNode instances in self.nodes_to_run.

property scored_csv_file_list

Get all the .csv files that contain scored ligands from ScoreProviderNode.

Returns

list of .csv files contain score ligands.

Return type

list(str)

splitInputfiles()

Separate the input files into small blocks randomly.

schrodinger.application.phase.packages.shape_screen_al_driver.parse_input_file(args)

Parse the input file. Some inter-keyword dependencies and validation are handled here.

Parameters

args (argparse.Namespace) – argument namespace (modified in place!)

schrodinger.application.phase.packages.shape_screen_al_driver.get_parser()

Creates argument parser for shape_screen active learning job.

Returns

configured argument parser

Return type

argparse.ArgumentParser

schrodinger.application.phase.packages.shape_screen_al_driver.parse_args(argv=None)

Parses and validates command-line arguments.

Parameters

argv (list(str)) – argument list

Returns

argument namespace with command line options

Return type

argparse.Namespace

schrodinger.application.phase.packages.shape_screen_al_driver.validate_args(args)

Validate command-line arguments

Parameters

args (argparse.Namespace) – argument namespace with command line options

Returns

(validation outcome, error message)

Return type

(bool, str)

schrodinger.application.phase.packages.shape_screen_al_driver.check_license()

Check for the existence of the ACTIVE_LEARN license and exit with an error message if it doesn’t.

schrodinger.application.phase.packages.shape_screen_al_driver.get_job_spec_from_args(argv)

Register input files with jobcontrol.

Parameters

argv (List[str]) – Argument list

schrodinger.application.phase.packages.shape_screen_al_driver.main()