[docs]defparse_command_line_arguments(args):parser=argparse.ArgumentParser(description="Tool for building specification for applying previously trained ML models in Galaxy")parser.add_argument("-t","--trained_model",required=True,help="The trained ML model to apply to the dataset.")parser.add_argument("-o","--output_path",required=True,help="Output location for the generated yaml file (directory).")parser.add_argument("-f","--file_name",default="specs.yaml",help="Output file name for the yaml file. Default name is 'specs.yaml' if not specified.")returnparser.parse_args(args)
[docs]defmain(args):parsed_args=parse_command_line_arguments(args)specs=build_specs(parsed_args)ifnotos.path.isfile(parsed_args.trained_model):logging.warning(f"Could not locate trained ML model: {parsed_args.trained_model}")PathBuilder.build(parsed_args.output_path)output_location=Path(parsed_args.output_path)/parsed_args.file_namewrite_yaml(output_location,specs)returnstr(output_location)