schrodinger.application.phase.packages.oned_option_utils module¶
Provides argument parsing and validation for the 1D similarity driver.
Copyright Schrodinger LLC, All Rights Reserved.
- schrodinger.application.phase.packages.oned_option_utils.add_create_args(parser)¶
Adds arguments for TASK_CREATE.
- Parameters
parser (argparse.ArgumentParser) – Argument parser object.
- schrodinger.application.phase.packages.oned_option_utils.add_describe_args(parser)¶
Adds arguments for TASK_DESCRIBE.
- Parameters
parser (argparse.ArgumentParser) – Argument parser object.
- schrodinger.application.phase.packages.oned_option_utils.add_export_args(parser)¶
Adds arguments for TASK_EXPORT.
- Parameters
parser (argparse.ArgumentParser) – Argument parser object.
- schrodinger.application.phase.packages.oned_option_utils.add_merge_args(parser)¶
Adds arguments for TASK_MERGE.
- Parameters
parser (argparse.ArgumentParser) – Argument parser object.
- schrodinger.application.phase.packages.oned_option_utils.add_run_args(parser)¶
Adds arguments TASK_RUN.
- Parameters
parser (argparse.ArgumentParser) – Argument parser object.
- schrodinger.application.phase.packages.oned_option_utils.add_split_args(parser)¶
Adds arguments for TASK_SPLIT.
- Parameters
parser (argparse.ArgumentParser) – Argument parser object.
- schrodinger.application.phase.packages.oned_option_utils.get_parser()¶
Creates argparse.ArgumentParser with supported command line options.
- Returns
Argument parser object
- Return type
argparse.ArgumentParser
- schrodinger.application.phase.packages.oned_option_utils.validate_absolute_source_path(source)¶
Raises a ValidationError if any 1D data file in source doesn’t contain an absolute path. source is assumed to be a 1D data file or a .list file containing the names of 1D data files.
- Parameters
source (str) – 1D data file or .list file
- Raise
ValidationError if validation fails
- schrodinger.application.phase.packages.oned_option_utils.validate_oned_data_file(oned_data_file, must_exist=False)¶
Raises a ValidationError if oned_data_file has the wrong extension or if must_exist is True and oned_data_file doesn’t exist.
- Parameters
oned_data_file (str) – The name of the 1D data file
must_exist (bool) – Whether the file must exist
- Raise
ValidationError if validation fails
- schrodinger.application.phase.packages.oned_option_utils.validate_oned_data_file_attributes(oned_data_files, pharm3d=False)¶
Raises a ValidationError unless all of the supplied 1D data files contain the same attributes. If pharm3d is True, the structure treatment must be phase.ONED_TREATMENT_PHARM3D.
- Parameters
oned_data_files (list(str)) – The names of the 1D data files
- Raise
ValidationError if validation fails
- schrodinger.application.phase.packages.oned_option_utils.validate_oned_data_file_source(source, must_exist=False)¶
Raises a ValidationError if the provided source is not a 1D data file or a list file containing the names of 1D data files. If must_exist is True, a RuntimeError is raised if any 1D data file doesn’t exist.
- Parameters
source – The name of the screening source file
must_exist (bool) – Whether 1D data files must exist
- Raise
ValidationError if validation fails
- schrodinger.application.phase.packages.oned_option_utils.validate_property_names(property_names)¶
Raises a ValidationError if any members of the supplied list are not m2io-style properties.
- Parameters
property_names (list(str)) – The property names to check
- Raise
ValidationError if validation fails
- schrodinger.application.phase.packages.oned_option_utils.validate_structure_file(structure_file, legal_formats)¶
Raises a ValidationError if structure_file is not one of the specified formats or if it doesn’t exist.
- Parameters
structure_file (str) – The name of the structure file
legal_formats (list[str]) – List of legal fileutils formats
- Raise
ValidationError if validation fails
- schrodinger.application.phase.packages.oned_option_utils.validate_create_args(args)¶
Raises a ValidationError if arguments for TASK_CREATE are invalid.
- Parameters
args (argparser.Namespace) – argparser.Namespace with command line arguments
- Raise
ValidationError if validation fails
- schrodinger.application.phase.packages.oned_option_utils.validate_describe_args(args)¶
Raises a ValidationError if arguments for TASK_DESCRIBE are invalid.
- Parameters
args (argparser.Namespace) – argparser.Namespace with command line arguments
- Raise
ValidationError if validation fails
- schrodinger.application.phase.packages.oned_option_utils.validate_export_args(args)¶
Raises a ValidationError if arguments for TASK_EXPORT are invalid.
- Parameters
args (argparser.Namespace) – argparser.Namespace with command line arguments
- Raise
ValidationError if validation fails
- schrodinger.application.phase.packages.oned_option_utils.validate_merge_args(args)¶
Raises a ValidationError if arguments for TASK_MERGE are invalid.
- Parameters
args (argparser.Namespace) – argparser.Namespace with command line arguments
- Raise
ValidationError if validation fails
- schrodinger.application.phase.packages.oned_option_utils.validate_run_args(args)¶
Raises a ValidationError if arguments for TASK_RUN are invalid.
- Parameters
args (argparser.Namespace) – argparser.Namespace with command line arguments
- Raise
ValidationError if validation fails
- schrodinger.application.phase.packages.oned_option_utils.validate_split_args(args)¶
Raises a ValidationError if arguments for TASK_SPLIT are invalid.
- Parameters
args (argparser.Namespace) – argparser.Namespace with command line arguments
- Raise
ValidationError if validation fails
- schrodinger.application.phase.packages.oned_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