schrodinger.application.peptide_workflow.driver_utils module

Contains functions and variables associated with running the PeptideWorkflow driver under job control. - Workflow config options - Input/Keyword parsing - Argument parsing - Splitting and creating files

class schrodinger.application.peptide_workflow.driver_utils.PeptideConfig(input_file: str, output_file: str, jobname: str, replicates_jobname: list[str])

Bases: object

Peptide dataclass to hold configuration information for the peptide subjob.

Variables:
  • input_file – Input file containing the peptide.

  • output_file – Output file name for the peptide poses.

  • jobname – Jobname for this peptide simulation.

  • replicates_jobname – List of replicate jobnames.

input_file: str
output_file: str
jobname: str
replicates_jobname: list[str]
__init__(input_file: str, output_file: str, jobname: str, replicates_jobname: list[str]) → None
class schrodinger.application.peptide_workflow.driver_utils.PrintKeywordsAction(option_strings, dest, **k)

Bases: Action

Arparse action class that prints the input config list and exits as soon as the command-line option is processed.

__init__(option_strings, dest, **k)
schrodinger.application.peptide_workflow.driver_utils.get_sampling_parameters(num_crankshaft_atoms: int) → tuple[int, int]

Return default sampling parameters for a peptide size.

Parameters:

num_crankshaft_atoms – Number of detected crankshaft atoms.

Returns:

Monte Carlo steps and number of simulations.

schrodinger.application.peptide_workflow.driver_utils.set_default_sampling_parameters(args: Namespace) → None

Set size-dependent sampling parameters that were not supplied by the user.

For files containing multiple peptides, the largest detected crankshaft atom count determines the defaults so that every peptide receives sufficient sampling. The default step count is reduced for a single input conformation without randomization and for tug-align runs. The reduction factor is 10 for OPLS minimization and 4 for receptor-backed minimization.

Parameters:

args – Parsed command-line arguments.

schrodinger.application.peptide_workflow.driver_utils.parse_input_file(input_file)

Parse the input_file.in, validate the values against the spec

Parameters:

input_file (str) – input file with config options

Returns:

key, value pairs of input config specs

Return type:

InputConfig object

schrodinger.application.peptide_workflow.driver_utils.parse_glide_keywords(args)

Parse keywords in the [GLIDE_MINIMIZER_OPTIONS] section and log if any are being overriden or unusable by the peptide workflow. Defaults REWARD_INTRA_HBONDS keyword to true.

Parameters:

args (argparse.Namespace) – job settings

schrodinger.application.peptide_workflow.driver_utils.has_at_least_n_structures(file, nstruct)

Checks to see if the file has at least n structures.

Parameters:
  • file (str) – File path for structures.

  • nstruct (int) – Min number of structures the file should have.

Return type:

bool

Returns:

True if there are at least nstructs, false otherwise.

schrodinger.application.peptide_workflow.driver_utils.create_conformer_files_and_config(args)

Separate the input peptide file into single conformer files for subjobs. Creates a PeptideConfig for each subjob with its input file, shared output file, subjob name and its replicates. The replicates are taken from the set of conformers.

Examples:

If 5 conformers are available in the peptide file, but only 3 simulations are requested, the first 3 conformers will be used to run and the rest won’t be used. If 5 conformers are available but 10 simluations are requested, the algorithm will loop over all available conformers twice such that 2 replicates of each conformer will be run.

Parameters:

args (argparse.Namespace) – job settings

Return type:

List[PeptideConfig].

Returns:

A list of peptide info required to run each peptide subjob.

schrodinger.application.peptide_workflow.driver_utils.create_peptide_files_and_config(args)

Separate the input peptide file into single peptide files for subjobs. Creates a PeptideConfig for each subjob with its input file, output file, subjob name and its replicates.

Parameters:

args (argparse.Namespace) – job settings

Return type:

List[PeptideConfig].

Returns:

A list of peptide info required to run each peptide subjob.

schrodinger.application.peptide_workflow.driver_utils.split_peptide_file(args)

Split the peptide file into multiple input files if it contains more than 1 structure, and creates input and output names based on the peptide structure titles as well the jobname.

Parameters:

args (argparse.Namespace) – job settings

Return type:

List[PeptideConfig].

Returns:

A list of peptide info required to run each peptide subjob.

Raises:

RuntimeError – If using -are_conformers but the peptides are not conformers.

schrodinger.application.peptide_workflow.driver_utils.check_conformers(args)

Check if all the peptides are conformers.

Parameters:

args (argparse.Namespace) – job settings

Return type:

bool

Returns:

If the peptides are conformers

schrodinger.application.peptide_workflow.driver_utils.get_partial_parser(workflow_name, argv=None)

Create partial command-line argument parser. Contains arguments that are not passed on to the subjobs.

Parameters:
  • workflow_name (str) – name of the workflow

  • argv (list of str or NoneType) – argument list (optional, defaulting to sys.argv)

Returns:

parser

Return type:

argparse.ArgumentParser

schrodinger.application.peptide_workflow.driver_utils.parse_args(workflow_name, argv=None)

Parse the command-line arguments. Optionally parse an input file with the input config options.

Parameters:
  • workflow_name (str) – name of the workflow

  • argv (list of str or NoneType) – argument list (optional, defaulting to sys.argv)

Returns:

argument namespace

Return type:

argparse.Namespace

schrodinger.application.peptide_workflow.driver_utils.run_tug_align(args: Namespace) → None

Align input peptide(s) to a reference peptide using Tug Align 2.

Each peptide in the input file is aligned independently to the reference. The aligned structures are treated as conformers using the same path as -are_conformers.

For a single input peptide, the aligned structure is written to one file and handled via split_peptide_file with are_conformers set. For multiple input peptides, conformer-style configs are built per peptide so that each peptide’s results are clustered independently.

Parameters:

args (argparse.Namespace) – Job settings.