Skip to content

Min box

Command-line interface for minimizing the simulation box size of a PDB file.

add_min_box_subparser(subparsers)

Adds the 'min_box' subcommand to the Simlify CLI for minimizing the box size.

This function configures an argparse subparser named 'min_box' which allows users to specify a PDB file and an optional output path. The 'min_box' command will attempt to rotate the system within the PDB file to achieve a smaller bounding box volume.

PARAMETER DESCRIPTION
subparsers

An argparse._SubParsersAction object where the 'min_box' subparser will be added. This is typically obtained by calling add_subparsers() on an ArgumentParser object.

RETURNS DESCRIPTION

argparse.ArgumentParser: The configured argparse parser object for the

'min_box' subcommand.

The 'min_box' subcommand accepts the following arguments:

positional arguments

pdb_path Path to the input PDB file whose box size will be minimized. This argument is optional. If not provided, the program might expect the path through other configuration mechanisms.

optional arguments

--output Path to the new PDB file where the minimized box structure will be saved. If not provided, the output might overwrite the input file or be handled in another way by the underlying function.

The function sets the default action for this subparser to be the cli_minimize_box function, which will be called when the user invokes the 'min_box' subcommand.

cli_minimize_box(args, parser)

Command-line interface function to rotate a protein to minimize its box volume.

This function serves as the entry point when the user executes the 'min_box' subcommand of the Simlify CLI. It receives the parsed command-line arguments and the argument parser object. It extracts the paths to the input PDB file and the desired output PDB file and then calls the run_minimize_box function from the simlify.structure.pdb.orientation module to perform the box minimization.

PARAMETER DESCRIPTION
args

An argparse.Namespace object containing the parsed command-line arguments for the 'min_box' subcommand.

TYPE: Namespace

parser

The argument parser object for the 'min_box' subcommand, used to display help messages if necessary (though not explicitly used in this function).

TYPE: ArgumentParser

RETURNS DESCRIPTION
None

None

The function retrieves the following arguments from the args object: - pdb_path: Path to the input PDB file. - output: Path to the output PDB file.

It then directly calls the run_minimize_box function with these paths to perform the box minimization operation.