schrodinger.application.phase.packages.shape_screen_job_utils module

Performs job-related functionality for shape_screen_driver.py. For clarity, the term “fast” is synonymous with the default way of screening, wherein the fast_shape.cpp backend is invoked. This in contrast to “classic” screens, wherein the shape_screen.cpp backend is invoked.

Copyright Schrodinger LLC, All Rights Reserved.

schrodinger.application.phase.packages.shape_screen_job_utils.get_checkpoint_dir(args: argparse.Namespace) str

Constructs the name of the checkpoint directory for a classic screen.

schrodinger.application.phase.packages.shape_screen_job_utils.get_checkpoint_file_path(args: argparse.Namespace, filename: str) str

If running a classic screen, this function joins the checkpoint directory with the provided file name and returns the result. Returns the provided file name if it’s a fast screen.

schrodinger.application.phase.packages.shape_screen_job_utils.get_input_files_possibly_list(arg_value: str) List[str]

For an argument that could be a single file or a .list file, and which has no dependence on other arguments, absolute path, etc., this function returns the corresponding list of files that must be registered as input files.

schrodinger.application.phase.packages.shape_screen_job_utils.get_input_screen_files(args: argparse.Namespace) List[str]

Returns the list of screening files that must be registered as input files.

schrodinger.application.phase.packages.shape_screen_job_utils.get_input_smarts_files(smarts: str, classic: bool) List[str]

Given the <smarts> argument for -align <smarts> and whether running in classic mode, this function returns the corresponding list of files that must be registered as input files.

In fast mode, smarts may be * A single SMARTS pattern. * A .list file that contains a SMARTS for each shape query, with one SMARTS per line.

In classic mode, smarts may be * A text file that contains one or more SMARTS matching rules, with one rule per line. Multiple rules are interpreted as multiple, disjoint substructures in the query. * A .list file that contains a list of text files as described in option 1. Must contain a file name for each shape query, with one name per line.

schrodinger.application.phase.packages.shape_screen_job_utils.get_input_subset_files(args: argparse.Namespace) List[str]

Returns the list of database subset files that must be registered as input files. Behavior depends on whether running in fast or classic mode, whether this is a subjob, and whether -nocopy was supplied. It is best illustrated by way of examples from the following partial command line:

shape_screen … -isub <druglike> -JOB test -HOST localhost:2 -NSUB 3

Here, <druglike> could contain a local or absolute path, and the absolute path may or may not exist on localhost.

Fast mode, parent job * <druglike> is local or an absolute path that exists locally Returns [<druglike> +’_phase.inp’] * <druglike> is an absolute path that doesn’t exist locally Returns []

Fast mode, with subjob name = ‘test_sub_1’ Returns [‘test_sub_1_1_phase.inp’, ‘test_sub_1_2_phase.inp’, ‘test_sub_1_3_phase.inp’] The subjob command itself will contain [‘-isub’, <druglike>], with no reference to the 3 subjob files above. Those files are created in the setup step of the parent job and supplied via the -isub argument to 3 fast_shape binary suprocesses spawned by test_sub_1. Only 2 actual subjobs, (‘test_sub_1’, ‘test_sub_2’), are launched by the parent job.

Classic mode, parent job * <druglike> is local or an absolute path that exists locally Returns [<druglike> + ‘_phase.inp’] * <druglike> is an absolute path that doesn’t exist locally Returns []

Classic mode, with subjob name = ‘test_sub_0’ Returns [‘.shape_no_checkpoint_test/test_sub_0_in_phase.inp’], which is 1 of 6 subset files created in the setup step of the parent job. The arguments [‘-isub’, ‘.shape_no_checkpoint_test/test_sub_0_in’] appear in the command for this subjob, and total of 6 subjobs, (‘test_sub_0’,…, ‘test_sub_5’), are launched by the parent job and distributed over 2 CPUs.

The behavior changes as follows if the command line contains -nocopy

Fast mode, parent job Returns []

Fast mode, with subjob name = ‘test_sub_1’ Returns [‘test_sub_1_1_phase.inp’, ‘test_sub_1_2_phase.inp’, ‘test_sub_1_3_phase.inp’]

Classic mode, parent job Returns []

Classic mode, with subjob name = ‘test_sub_0’ Returns [‘.shape_no_checkpoint_test/test_sub_0_in_phase.inp’]

schrodinger.application.phase.packages.shape_screen_job_utils.get_jobname(args: argparse.Namespace) str

Determines the job name from args in the following order of precedence:

  1. args.subjob

  2. args.jobname

  3. args.shape

schrodinger.application.phase.packages.shape_screen_job_utils.get_parent_jobname(args: argparse.Namespace) str

Returns the name of the parent shape_screen job. May be called from the parent job or from a subjob.

schrodinger.application.phase.packages.shape_screen_job_utils.get_required_licenses(args: argparse.Namespace) List[Tuple[int, int]]

Returns a list of (license_code, token_count) tuples a parent job or subjob will check out. Note that classic screens check out a 1-token SHAPE_SCREEN, a 5-token PHASE_CORE_HOPPING or 1-token IFMD license in the setup step of the parent job and in each subjob. Fast screens check out a 1-token SHAPE_SCREEN license in each subjob, but not in the parent job.

schrodinger.application.phase.packages.shape_screen_job_utils.get_subjob_commands(argv: List[str], args: argparse.Namespace) List[List[str]]

Given a command line generated by arg_utils.prepare_for_parsing() and the result of of parsing it (including assignment of args.classic), this function returns the commands to launch each subjob. Assumes that the fast_shape/shape_screen setup step has already been run.

schrodinger.application.phase.packages.shape_screen_job_utils.get_subjob_commands_classic(argv: List[str], args: argparse.Namespace) List[List[str]]

Helper function that generates classic screen subjob commands.

schrodinger.application.phase.packages.shape_screen_job_utils.get_subjob_commands_fast(argv: List[str], args: argparse.Namespace) List[List[str]]

Helper function that generates fast screen subjob commands.

schrodinger.application.phase.packages.shape_screen_job_utils.get_subjob_counts_fast(jobname: str) Tuple[int, int]

Given the parent job name, this function returns a tuple of the number of CPUs and number of subjobs per CPU for a fast screen. Assumes the fast_shape setup step has been run.

schrodinger.application.phase.packages.shape_screen_job_utils.get_subjob_names_classic(args: argparse.Namespace) List[str]

Returns all subjob names for a classic job. Assumes the setup step has been run.

schrodinger.application.phase.packages.shape_screen_job_utils.is_list_file(filename: str) bool

Returns True if filename is a .list file.

schrodinger.application.phase.packages.shape_screen_job_utils.set_input_and_output_files(args: argparse.Namespace, jsb: schrodinger.job.launchapi.JobSpecificationArgsBuilder) None

Registers input and output files through a JobSpecificationArgsBuilder. Raises a phase_utils.MissingInputFileError if a required input file is missing.

schrodinger.application.phase.packages.shape_screen_job_utils.use_glide_sort(args: argparse.Namespace) bool

Returns True if output alignments will be sorted via glide_sort.