schrodinger.application.phase.packages.mmp3d_driver_utils module

Provides argument parsing, job setup/cleanup, and other and miscellaneous functionality for phase_mmp3d_driver.py.

Copyright Schrodinger LLC, All Rights Reserved.

class schrodinger.application.phase.packages.mmp3d_driver_utils.SubjobType

Bases: enum.Enum

An enumeration.

__class__

alias of enum.EnumMeta

__members__ = mappingproxy(OrderedDict([('smiles_to_3d', <SubjobType.smiles_to_3d: 1>), ('align_pairs', <SubjobType.align_pairs: 2>)]))
__module__ = 'schrodinger.application.phase.packages.mmp3d_driver_utils'
align_pairs = 2
smiles_to_3d = 1
schrodinger.application.phase.packages.mmp3d_driver_utils.align_pairs(project_path, id_pairs_file, out_mae, verbose=False)

Aligns pairs of multi-conformer ligands and writes the alignments to a Maestro file.

Parameters:
  • project_path (str) – Phase project containing the ligands
  • id_pairs_file – CSV file with sorted pairs of ligand IDs
  • out_mae (str) – Output Maestro file for alignments
  • verbose (bool) – If true, a one-line summary will be printed for each pair
schrodinger.application.phase.packages.mmp3d_driver_utils.combine_alignments(args, nsub)

Combines pairwise alignments from subjobs.

Parameters:
  • args (argparser.Namespace) – argparser.Namespace with command line options
  • nsub (int) – Number of subjobs
schrodinger.application.phase.packages.mmp3d_driver_utils.convert_smiles_to_3d(in_smiles, out_mae, verbose=False)

Creates 3D structures from SMILES.

Parameters:
  • in_smiles (str) – Input CSV file with id, public_id, smiles, and prop_value
  • out_mae (str) – Output Maestro file for 3D structures
  • verbose (bool) – If true, each input row from infile will be printed
schrodinger.application.phase.packages.mmp3d_driver_utils.create_phase_project(project_path, maefiles)

Creates a multi-conformer Phase project from the supplied Maestro files.

Parameters:
  • project_path (str) – Path to project to be created
  • maefiles (str) – List of Maestro files with one conformer per compound
schrodinger.application.phase.packages.mmp3d_driver_utils.get_parser()

Creates argparse.ArgumentParser with supported command line options.

Returns:Argument parser object
Return type:argparser.ArgumentParser
schrodinger.application.phase.packages.mmp3d_driver_utils.get_ligand_id_pairs(project_path, mmp_id_pairs)

Returns pairs of ligand IDs in the supplied Phase project that correspond to the provided pairs of compound IDs from the MMP 2D database. A pair will be skipped if either of the compounds in the pair failed to be imported into the project due to size or other characteristics that are unacceptable to phase_database.

Parameters:
  • project_path (str) – Path to Phase project
  • mmp_id_pairs (list((int, int))) – Pairs of compounds IDs from MMP 2D database
Returns:

Pairs of ligand IDs

Return type:

list((int, int))

schrodinger.application.phase.packages.mmp3d_driver_utils.get_num_subjobs(args, total_inputs, subjob_type)

Returns the number of subjobs to run, taking into account the requested number of CPUs and the minimum allowed inputs per subjob.

Parameters:
  • args (argparser.Namespace) – argparser.Namespace with command line options
  • total_inputs (int) – Total number of inputs to be distributed over subjobs
  • subjob_type (SubjobType) – Subjob type
Returns:

Number of subjobs

Return type:

int

schrodinger.application.phase.packages.mmp3d_driver_utils.get_parent_jobname(args)

Returns parent job name of the current subjob.

Parameters:args (argparser.Namespace) – argparser.Namespace with command line options
Returns:Parent job name
Return type:str
schrodinger.application.phase.packages.mmp3d_driver_utils.setup_distributed_align_pairs(args)

Does setup for distributed alignment of activity cliff pairs.

Parameters:args (argparser.Namespace) – argparser.Namespace with command line options
Returns:list of subjob commands
Return type:list(list(str))
schrodinger.application.phase.packages.mmp3d_driver_utils.setup_distributed_smiles_to_3d(args)

Does setup for a distributed conversion of SMILES to 3D.

Parameters:args (argparser.Namespace) – argparser.Namespace with command line options
Returns:list of subjob commands
Return type:list(list(str))
schrodinger.application.phase.packages.mmp3d_driver_utils.split_inputs(args, rows, subjob_type, nsub=None)

Divides rows of input data over subjob CSV files and returns the commands to run the subjobs.

Parameters:
  • args (argparser.Namespace) – argparser.Namespace with command line arguments
  • rows (list(tuple)) – Rows to split
  • subjob_type (SubjobType) – Subjob type
  • nsub (int) – Overrides automatic determination of number of subjobs
Returns:

list of subjob commands

Return type:

list(list(str))

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

Checks the validity of command line arguments.

Parameters:args (argparser.Namespace) – argparser.Namespace with command line arguments
Returns:tuple of validity and non-empty error message if not valid
Return type:bool, str