From 52f8901f96e793068a2d215b52ffd26b49ad8169 Mon Sep 17 00:00:00 2001 From: Tongzhou Xu Date: Thu, 21 Mar 2024 19:28:47 -0400 Subject: [PATCH] folder path --- mashpit/mashpit.py | 4 ++-- mashpit/query.py | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/mashpit/mashpit.py b/mashpit/mashpit.py index eb2e9ad..29569d5 100755 --- a/mashpit/mashpit.py +++ b/mashpit/mashpit.py @@ -46,8 +46,8 @@ def commandToArgs(commandline): subparser_update.set_defaults(func=update.update) # "query" subcommand - subparser_query.add_argument(dest="sample", type=str, help="file path of the query sample") - subparser_query.add_argument(dest="database", type=str, help="path for the database folder") + subparser_query.add_argument(dest="sample", type=str, help="file path to the query sample") + subparser_query.add_argument(dest="database", type=str, help="path to the database folder") subparser_query.add_argument("--number", type=int, help="number of isolates in the query output, default is 200",default=200) subparser_query.add_argument("--threshold", type=float, help="minimum jaccard similarity for mashtree, default is 0.85",default=0.85) subparser_query.add_argument("--annotation", type=str, help="mashtree tip annoatation, default is none") diff --git a/mashpit/query.py b/mashpit/query.py index 9a8a2ab..5ffb5f9 100755 --- a/mashpit/query.py +++ b/mashpit/query.py @@ -153,8 +153,9 @@ def query(args): if not os.path.exists(db_folder): logging.error('Database path not found.') exit(1) - sql_path = os.path.join(db_folder,f'{args.database}.db') - sig_path = os.path.join(db_folder, f'{args.database}.sig') + folder_name = os.path.basename(db_folder) + sql_path = os.path.join(db_folder,f'{folder_name}.db') + sig_path = os.path.join(db_folder, f'{folder_name}.sig') if not (os.path.exists(sql_path) and os.path.exists(sig_path)): logging.error('Database incomplete.') exit(1)