diff --git a/unassigner/command.py b/unassigner/command.py index 9a86d87..0e5aba2 100644 --- a/unassigner/command.py +++ b/unassigner/command.py @@ -103,17 +103,17 @@ def main(argv=None): elif os.path.exists("unassigner_species.fasta"): ltp_fp = "unassigner_species.fasta" else: - if args.output_dir is None: - output_dir = os.path.splitext(args.query_fasta.name)[0] + "_unassigned" - else: - output_dir = args.output_dir - os.makedirs(args.db_dir, exist_ok=True) ltp_fp = download_type_strain_data(output_dir=args.db_dir) with open(ltp_fp) as f: species_names = dict(parse_species_names(f)) + if args.output_dir is None: + output_dir = os.path.splitext(args.query_fasta.name)[0] + "_unassigned" + else: + output_dir = args.output_dir + writer = OutputWriter(output_dir, species_names) alignment_query_fp = writer.output_fp("unassigner_query.fasta")