schrodinger.application.phase.shape_screen_reporter.option_utils module

Performs parsing and validation of options for generating and using shape screen report databases.

Copyright Schrodinger LLC, All Rights Reserved.

class schrodinger.application.phase.shape_screen_reporter.option_utils.ClusterBy

Bases: Enum

features = 1
scaffolds = 2
class schrodinger.application.phase.shape_screen_reporter.option_utils.PageSize

Bases: Enum

Letter = 1
A4 = 2
schrodinger.application.phase.shape_screen_reporter.option_utils.add_cluster_args(parser)

Adds arguments for the “cluster” task.

Parameters:

parser (argparse.ArgumentParser) – Argument parser object.

schrodinger.application.phase.shape_screen_reporter.option_utils.add_create_args(parser)

Adds arguments for the “create” task.

Parameters:

parser (argparse.ArgumentParser) – Argument parser object.

schrodinger.application.phase.shape_screen_reporter.option_utils.add_export_args(parser)

Adds arguments for the “export” task.

Parameters:

parser (argparse.ArgumentParser) – Argument parser object.

schrodinger.application.phase.shape_screen_reporter.option_utils.add_feature_matching_args(parser, features_required=False)

Adds arguments for specifying a list of features to match, positional tolerances and feature type matching rules.

Parameters:
  • parser (argparse.ArgumentParser) – Argument parser object.

  • features_required – If True, the help message will indicate that the list of features is required.

schrodinger.application.phase.shape_screen_reporter.option_utils.add_filter_args(parser)

Adds arguments for the “filter” task.

Parameters:

parser (argparse.ArgumentParser) – Argument parser object.

schrodinger.application.phase.shape_screen_reporter.option_utils.add_print_args(parser)

Adds arguments for the “print” task.

Parameters:

parser (argparse.ArgumentParser) – Argument parser object.

schrodinger.application.phase.shape_screen_reporter.option_utils.check_feature_string(s, expect_number=False)

Returns a non-empty error message if s is not a valid pharmacophore feature specification.

Parameters:
  • s (str) – Pharmacophore feature string

  • expect_number (bool) – Whether to expect a feature number at the end of s

Returns:

Non-empty error message if s is invalid

Return type:

str

schrodinger.application.phase.shape_screen_reporter.option_utils.check_permitted_features_string(s)

Returns a non-empty error message if s contains any illegal characters.

Parameters:

s (str) – String of permitted feature types

Returns:

Non-empty error message if s is invalid

Return type:

str

schrodinger.application.phase.shape_screen_reporter.option_utils.get_parser()

Creates argparse.ArgumentParser with supported command line options.

Returns:

Argument parser object

Return type:

argparse.ArgumentParser

schrodinger.application.phase.shape_screen_reporter.option_utils.is_mae_or_sd(filename)

Returns True if filename corresponds to a Maestro or SD file.

Parameters:

filename (str) – File name

Returns:

True if filename is a Maestro or SD file

Return type:

bool

schrodinger.application.phase.shape_screen_reporter.option_utils.is_positive_int(value)

Returns True if the provided string can be cast to a positive int.

Parameters:

value (str) – The string to be tested

Returns:

Whether value is a positive int (1, 2, etc.)

Return type:

bool

schrodinger.application.phase.shape_screen_reporter.option_utils.is_positive_numeric(value)

Returns True if the provided string can be cast to a float value > 0.

Parameters:

value (str) – The string to be tested

Returns:

Whether value is a positive numeric

Return type:

bool

schrodinger.application.phase.shape_screen_reporter.option_utils.parse_feature_rules(rules_string, expect_number=False)

Given a comma-delimited string of <feature>:<permitted> pairs, where <feature> may or may not contain a number, and where <permitted> is a string of feature types that <feature> is allowed to match, this function attempts to translate the string into a dictionary and reports any syntax errors it finds.

Parameters:
  • rules_string (str) – Comma-delimited string of <feature>:<permitted> pairs

  • expect_number (bool) – Whether to expect a feature number at the end of each feature string

Returns:

tuple of <feature>:<permitted> dictionary and non-empty error message if rules_string is illegal

Return type:

dict{str: float}, str

schrodinger.application.phase.shape_screen_reporter.option_utils.parse_feature_tol(tol_string, expect_number=False)

Given a comma-delimited string of <feature>:<tol> pairs, where <feature> may or may not contain a number, this function attempts to translate the string into a dictionary and reports any syntax errors it finds.

Parameters:
  • tol_string (str) – Comma-delimited string of <feature>:<tol> pairs

  • expect_number (bool) – Whether to expect a feature number at the end of each feature string

Returns:

tuple of <feature>:<tol> dictionary and non-empty error message if tol_string is illegal

Return type:

dict{str: float}, float

schrodinger.application.phase.shape_screen_reporter.option_utils.sanitize_permitted(feature, permitted)

Constructs a permitted features string that conforms to the format Phase expects, which is the type of the feature itself, followed by other types it’s allowed to match. For example, if feature is ‘R’ and permitted is ‘HR’, the sanitized permitted features string would be ‘RH’.

Parameters:
  • feature (str) – Feature type, with or without a trailing number

  • permitted (str) – String of types feature is allowed to match

Returns:

Sanitized version of permitted

Return type:

str

schrodinger.application.phase.shape_screen_reporter.option_utils.validate_cluster_args(args)

Checks the validity of arguments for “cluster” task.

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

schrodinger.application.phase.shape_screen_reporter.option_utils.validate_create_args(args)

Checks the validity of arguments for “create” task.

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

schrodinger.application.phase.shape_screen_reporter.option_utils.validate_export_args(args)

Checks the validity of arguments for “export” task.

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

schrodinger.application.phase.shape_screen_reporter.option_utils.validate_feature_matching_args(args)

Checks validity of args -features <list>, -tol <dict> and -rules <dict>, where the features in the <dict> specifications are expected to include feature numbers.

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

schrodinger.application.phase.shape_screen_reporter.option_utils.validate_filter_args(args)

Checks the validity of arguments for “filter” task.

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

schrodinger.application.phase.shape_screen_reporter.option_utils.validate_print_args(args)

Checks the validity of arguments for “print” task.

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

schrodinger.application.phase.shape_screen_reporter.option_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