def run_basta(self,args): if args.subparser_name == 'sequence': self._check_dir(args) if not dbutils._check_complete(args.directory): self.logger.error("\n[BASTA ERROR] Couldn't find complete_taxa.db in %s. Did you run initial \'basta download\'?" % (args.directory)) sys.exit() self._basta_sequence(args) elif args.subparser_name == 'single': self._check_dir(args) if not dbutils._check_complete(args.directory): self.logger.error("\n[BASTA ERROR] Couldn't find complete_taxa.db in %s. Did you run initial \'basta download\'?" % (args.directory)) sys.exit() self._basta_single(args) elif args.subparser_name == 'multiple': self._check_dir(args) if not dbutils._check_complete(args.directory): self.logger.error("\n[BASTA ERROR] Couldn't find complete_taxa.db in %s. Did you run initial \'basta download\'?" % (args.directory)) sys.exit() self._basta_multiple(args) elif args.subparser_name == 'download': self._check_dir(args) self._basta_download(args) elif args.subparser_name == 'create_db': self._check_dir(args) self._basta_create_db(args) elif args.subparser_name == 'taxonomy': self._check_dir(args) self._basta_taxonomy(args)
def test_check_complete(self): os.mkdir(os.path.join(self.pwd, "complete_taxa.db")) self.assertTrue(db._check_complete(self.pwd)) os.rmdir(os.path.join(self.pwd, "complete_taxa.db"))