当前位置: 首页>>代码示例>>Python>>正文


Python Status.write_backup方法代码示例

本文整理汇总了Python中status.Status.write_backup方法的典型用法代码示例。如果您正苦于以下问题:Python Status.write_backup方法的具体用法?Python Status.write_backup怎么用?Python Status.write_backup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在status.Status的用法示例。


在下文中一共展示了Status.write_backup方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from status import Status [as 别名]
# 或者: from status.Status import write_backup [as 别名]

#.........这里部分代码省略.........
            # if you do not want to build only models, check if the project directory is empty
            if len(os.listdir(self.config.settings["project_dir"])) != 0:
                self.log.warning("The project directory is not empty, this can result in unpredictable behavior.")
                if self.yes:
                    answer = "y"
                else:
                    answer = utils.get_answer_timeout("Remove? [Y/N]")
                if answer == "y":
                    self.log.info("Deleting old project directory..")
                    shutil.rmtree(self.config.settings["project_dir"])
                    os.mkdir(self.config.settings["project_dir"])
                else:
                    self.log.critical("Please provide an empty project directory. Quiting...")
                    sys.exit(1)

            if self.backup:
                self.stat = Status(logged=True)
                self.backupdir = os.path.join(self.config.settings["project_dir"], "backup")
                os.mkdir(self.backupdir)

            self.log.info("creating folder structure...")
            self.create_folderstructure()

            self.log.info("checking database")
            self.check_db()

            if len(self.config.genomes_exclude) != 0:
                # write organisms that will not be considered into a file
                utils.list_to_file(self.config.genomes_exclude,
                             os.path.join(self.config.settings["project_dir"], "excluded.txt"))

                if self.stat is not None:
                    self.stat.add_written_file(os.path.join(self.config.settings["project_dir"], "excluded.txt"))
                    self.stat.write_backup(self.backupdir)

            self.log.info("Processing NCBI data...")
            self.process_ncbi()
            if self.stat is not None:
                self.stat.change_variable(1, "status")
                self.stat.change_variable(self.organism_file_map, "organism_file_map")
                self.stat.change_variable(self.genomes_excluded, "genomes_excluded")
                self.stat.change_variable(self.organisms, "organisms")
                self.stat.write_backup(self.backupdir)

            self.log.info("tree processing...")
            self.tree_process()
            if self.stat is not None:
                self.stat.change_variable(2, "status")
                self.stat.change_variable(self.nodes, "nodes")
                self.stat.change_variable(self.tree_file, "tree_file")
                self.stat.write_backup(self.backupdir)

            self.log.info("mapping genomes on the tree...")
            self.map_genomes_on_tree()
            if self.stat is not None:
                self.stat.change_variable(3, "status")
                self.stat.change_variable("n_frags_per_node", "status")
                self.stat.change_variable("tree_organism_map", "status")
                self.stat.change_variable("organisms_invalid", "status")
                self.stat.change_variable("organism_tree_map", "status")
                self.stat.write_backup(self.backupdir)

            self.log.info("generating sequence fragments...")
            self.generate_seq()
            if self.stat is not None:
                self.stat.change_variable(4, "status")
开发者ID:algbioi,项目名称:docker_ppsp,代码行数:70,代码来源:train.py


注:本文中的status.Status.write_backup方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。