Core Classes

ChewbaccaCommand

class classes.ChewbaccaCommand.ChewbaccaCommand(args_)[source]

Represents a portable, executable Command. ChewbaccaCommands have a list of supported_programs, a default_program, and an args object (object with parameters as attributes). Chewbacca Commands read the program attribute from the args object, and call the appropriate program (if supported), falling back to the default if no match is found.

execute_command()[source]

Executes the command.

Returns:Results of execution.
get_program(program)[source]

Given a program name, searches for that Program in the list of supported_programs, and returns an instance of that Program initalized with the parameter object. If not found, returns an instance of the default_program initalized with the parameter object.

Parameters:program – String name of the desired program. This should match the .name attribute of a ChewbaccaProgram
Returns:An instance of a ChewbaccaProgram, initalized with the argparse object.

ChewbaccaProgram

class classes.ChewbaccaProgram.ChewbaccaProgram(args_)[source]

Represents a way of completing a ChewbaccaCommand using a particular program (with some combination of external programs, and custom Chewbacca scripts. ChewbaccaPrograms are responsbile for carrying out their associated ChewbaccaCommand. The name attribute denotes the primary external program used, e.g. “vsearch” if VSearch is used, or “chewbacca” if a custom script is used.

execute_program()[source]

Completes the representative ChewbaccaCommand using the specified program.

ProgramRunner

class classes.ProgramRunner.ProgramRunner(program_, params, conditions_={}, custom_arg_string='', dryrun=False)[source]

A class to interact with external command line programs. The class contains a dictionary of formatted command strings for external programs. The class supports validation, sanitization, and debugging of user-supplied parameters.

Attributes:
self.DEFAULT_CONFIG_FILEPATH: The filepath to a config file containing user-specified overrides (such as file paths to exectuables. self.program_paths: Specifies the default location of executables used in the commandTemplates dictionary. self.commandTemplates: A dictionary mapping chewbacca commands to un-paramaterized command line strings. Used as templates for commands.
run()[source]

Validates conditions (or prints them for a verbose/dry run) and then executes the command.