def classify(self, options): """Determine taxonomic classification of genomes. Parameters ---------- options : argparse.Namespace The CLI arguments input by the user. """ check_dir_exists(options.align_dir) make_sure_path_exists(options.out_dir) if options.scratch_dir: make_sure_path_exists(options.scratch_dir) genomes, _ = self._genomes_to_process(options.genome_dir, options.batchfile, options.extension) classify = Classify(options.cpus, options.pplacer_cpus, options.min_af) classify.run(genomes, options.align_dir, options.out_dir, options.prefix, options.scratch_dir, options.recalculate_red, options.debug, options.split_tree) self.logger.info('Done.')
def classify(self, options): """Determine taxonomic classification of genomes. Parameters ---------- options : argparse.Namespace The CLI arguments input by the user. """ # See ticket #255... perhaps an upstream version/OS issue? if not hasattr(options, 'pplacer_cpus'): options.pplacer_cpus = None check_dir_exists(options.align_dir) make_sure_path_exists(options.out_dir) if options.scratch_dir: make_sure_path_exists(options.scratch_dir) genomes, _ = self._genomes_to_process(options.genome_dir, options.batchfile, options.extension) classify = Classify(options.cpus, options.pplacer_cpus) classify.run(genomes, options.align_dir, options.out_dir, options.prefix, options.scratch_dir, options.recalculate_red, options.debug, options.split_tree) self.logger.info('Done.')
def classify(self, options): """Determine taxonomic classification of genomes. Parameters ---------- options : argparse.Namespace The CLI arguments input by the user. """ check_dir_exists(options.align_dir) make_sure_path_exists(options.out_dir) if options.scratch_dir: make_sure_path_exists(options.scratch_dir) genomes, _ = self._genomes_to_process(options.genome_dir, options.batchfile, options.extension) classify = Classify(options.cpus, options.pplacer_cpus, options.min_af) classify.run(genomes=genomes, align_dir=options.align_dir, out_dir=options.out_dir, prefix=options.prefix, scratch_dir=options.scratch_dir, debugopt=options.debug, fulltreeopt=options.full_tree, recalculate_red=False) self.logger.info( 'Note that Tk classification mode is insufficient for publication of new taxonomic ' 'designations. New designations should be based on one or more de novo trees, an ' 'example of which can be produced by Tk in de novo mode.') self.logger.info('Done.')
def setUp(self): self.classify = Classify() self.out_dir = tempfile.mkdtemp(prefix='gtdbtk_tmp_') self.prefix = 'gtdbtk' self.pplacer_dir_reference = 'tests/data/pplacer_dir_reference' self.aln_dir_ref = 'tests/data/align_dir_reference/align' self.user_msa_file = os.path.join(self.aln_dir_ref, 'gtdbtk.ar122.user_msa.fasta') self.taxonomy_file = Config.TAXONOMY_FILE self.gtdb_taxonomy = Taxonomy().read(self.taxonomy_file)
def setUp(self): self.classify = Classify() self.generic_out_path = 'tests/data/results' tmp_folder = ''.join(random.choice( string.ascii_uppercase + string.digits) for _ in range(10)) self.out_dir = os.path.join(self.generic_out_path, tmp_folder) if not os.path.exists(self.generic_out_path): os.makedirs(self.generic_out_path) self.prefix = 'gtdbtk' self.pplacer_dir_reference = 'tests/data/pplacer_dir_reference' self.user_msa_file = os.path.join( self.pplacer_dir_reference, 'gtdbtk.ar122.user_msa.fasta') self.taxonomy_file = Config.TAXONOMY_FILE self.gtdb_taxonomy = Taxonomy().read(self.taxonomy_file)