def run(config, makefiles): check_path(config.temp_root) logfile_template = time.strftime("epiPALEOMIX_pipe.%" "Y%m%d_%H%M%S_%%02i.log") pypeline.logger.initialize(config, logfile_template) logger = logging.getLogger(__name__) pipeline = Pypeline(config=config) topnodes = create_nodes(config, makefiles) assert topnodes, "No analyses to run. Check %s" % (makefiles) pipeline.add_nodes(topnodes) if config.list_output_files: logger.info("Printing output files ...") pipeline.print_output_files() return 0 elif config.list_executables: logger.info("Printing required executables ...") pipeline.print_required_executables() return 0 logger.info("Running Epipaleomix pipeline ...") if not pipeline.run(dry_run=config.dry_run, max_running=config.max_threads, progress_ui=config.progress_ui): return 1 return 0
# If a destination is not specified, save results in same folder as the # makefile filename = makefile["Statistics"]["Filename"] old_destination = config.destination if old_destination is None: config.destination = os.path.dirname(filename) try: nodes = pipeline_func(config, makefile) except pypeline.node.NodeError, error: logger.error("Error while building pipeline for '%s':\n%s", filename, error) return 1 config.destination = old_destination pipeline.add_nodes(nodes) if config.targets: logger.error("ERROR: Could not find --target(s): '%s'", "', '".join(config.targets)) logger.error(" Please use --list-targets to print list of valid target names.") return 1 elif config.list_output_files: logger.info("Printing output files ...") pipeline.print_output_files() return 0 elif config.list_orphan_files: logger.info("Printing orphan files ...") for filename in sorted(list_orphan_files(config, makefiles, pipeline)): print (filename) return 0 elif config.list_executables:
"\n ".join(str(error).split("\n")), file=sys.stderr) return 1 logfile_template = time.strftime("phylo_pipeline.%Y%m%d_%H%M%S_%%02i.log") pypeline.logger.initialize(config, logfile_template) logger = logging.getLogger(__name__) pipeline = Pypeline(config) for (command_key, command_func) in commands: logger.info("Building %s pipeline ...", command_key) command_func(pipeline, config, makefiles) for makefile in makefiles: if "Nodes" in makefile: pipeline.add_nodes(makefile["Nodes"]) if config.list_output_files: logger.info("Printing output files ...") pipeline.print_output_files() return 0 elif config.list_orphan_files: logger.info("Printing orphan files ...") for filename in sorted(list_orphan_files(config, makefiles, pipeline)): print(filename) return 0 elif config.list_executables: logger.info("Printint required executables ...") pipeline.print_required_executables() return 0
"\n %s:\n " % (error.__class__.__name__,), "\n ".join(str(error).split("\n")), file=sys.stderr) return 1 logfile_template = time.strftime("phylo_pipeline.%Y%m%d_%H%M%S_%%02i.log") pypeline.logger.initialize(config, logfile_template) logger = logging.getLogger(__name__) for (command_key, command_func) in commands: logger.info("Building %s pipeline ...", command_key) command_func(pipeline, config, makefiles) for makefile in makefiles: if "Nodes" in makefile: pipeline.add_nodes(makefile["Nodes"]) if config.list_output_files: logger.info("Printing output files ...") pipeline.print_output_files() return 0 elif config.list_orphan_files: logger.info("Printing orphan files ...") for filename in sorted(list_orphan_files(config, makefiles, pipeline)): print(filename) return 0 elif config.list_executables: logger.info("Printint required executables ...") pipeline.print_required_executables() return 0 elif config.dot_file:
# makefile filename = makefile["Statistics"]["Filename"] old_destination = config.destination if old_destination is None: config.destination = os.path.dirname(filename) try: nodes = pipeline_func(config, makefile) except pypeline.node.NodeError, error: logger.error("Error while building pipeline for '%s':\n%s", filename, error) return 1 config.destination = old_destination pipeline.add_nodes(nodes) if config.targets: logger.error("ERROR: Could not find --target(s): '%s'", "', '".join(config.targets)) logger.error( " Please use --list-targets to print list of valid target names." ) return 1 elif config.list_output_files: logger.info("Printing output files ...") pipeline.print_output_files() return 0 elif config.list_orphan_files: logger.info("Printing orphan files ...") for filename in sorted(list_orphan_files(config, makefiles, pipeline)):