schrodinger.application.phase.packages.hypo_refine.project_utils module

Module with phase_hypo_refine project-related functionality.

Copyright Schrodinger LLC, All Rights Reserved.

schrodinger.application.phase.packages.hypo_refine.project_utils.create_project(infile, fd, conf_options, dest_dir=None)

Creates a multi-conformer zipped Phase project from a Maestro/SD file.

Parameters:
  • infile (str) – Input Maestro/SD file
  • fd (list of phase.PhpFeatureDefinition) – Feature definitions
  • conf_options (phase.PhpConfOptions) – Conformer generation options
  • dest_dir (str) – Directory in which to create the project (default: cwd).
Returns:

Zipped project name including any leading path

Return type:

str

schrodinger.application.phase.packages.hypo_refine.project_utils.create_projects(args, dest_dir=None)

Creates any required zipped projects from Maestro/SD files in args. No action is taken for an argument which already corresponds to a zipped project. args.actives and args.decoys are replaced with the zipped project names if zipped projects are created. If args.valid is set, the actives2 and/or decoys2 values are similarly replaced.

Parameters:
  • args (argparser.Namespace) – argparser.Namespace with command line arguments
  • dest_dir (str) – Directory in which to create projects (default: cwd).
schrodinger.application.phase.packages.hypo_refine.project_utils.derive_project_name(file_path, zipped=False)

Determines the name of the Phase project to associate with the supplied Maestro file, SD file, or zipped project name. For example, if file_path is “/home/jsmith/actives.maegz”, the returned value would be “actives.phprj”. If zipped is True, the returned value would be “actives.phzip”.

Parameters:file_path (str) – Name of Maestro/SD file or zipped project
Returns:Project name derived from file_path
Return type:str
schrodinger.application.phase.packages.hypo_refine.project_utils.get_ligand_titles(zipped_project, unique=False)

Extracts ligand titles from a zipped project. If unique is True, only unique titles will be returned.

Parameters:
  • zipped_project (str) – Name of zipped project
  • unique (bool) – Whether to return only unique titles
Returns:

Ligand titles

Return type:

list(str)

schrodinger.application.phase.packages.hypo_refine.project_utils.get_project_file_names(project_path, file_name)

Returns the appropriate file name to use, zip_file_path, to extract the indicated file from the provided zipped Phase project, and the file name to use, disk_file_path, to access the extracted file on disk. Use forward slashes in file_name if it’s located in a subdirectory of the project, e.g., hypotheses/AADRR_1.phypo. The returned zip_file_path always contains forward slashes, whereas disk_file_path contains the appropriate platform-dependent separators.

Parameters:
  • project_path (str) – Path to zipped project
  • file_name (str) – Name of file in archive
Returns:

tuple of zip_file_path, disk_file_path

Return type:

str, str

schrodinger.application.phase.packages.hypo_refine.project_utils.get_screen_dict(args)

Creates a dictionary from the active/decoy files to screen:

“actives” –> args.actives “decoys” –> args.decoys “actives2” –> actives2 file extracted from args.valid, if provided “decoys2” –> decoys2 file extracted from args.valid, if provided

Parameters:args (argparse.Namespace) – Command line arguments
Returns:Dictionary of active/decoy files keyed as described above
Return type:dict of str:str
schrodinger.application.phase.packages.hypo_refine.project_utils.zip_project(project_path, dest_dir=None)

Zips a Phase project, removes the project directory, and returns the name of the zipped project.

Parameters:
  • project_path (str) – Path to project (.phprj)
  • dest_dir (str) – Destination directory for zipped project (default: cwd).
Returns:

Zipped project name (.phzip) including any leading path

Return type:

str