Skip to content

Commit 3d96a3f

Browse files
authored
Merge pull request #58 from teojcryan/fix/custom-tax-bug
Fix: validate --custom-tax argument to prevent TypeError
2 parents 9857579 + c7f67bf commit 3d96a3f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

mess/workflow/rules/preflight/functions.smk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ if "input_tsv" not in tsv_cache:
212212
else:
213213
tsv_df = tsv_cache["input_tsv"]
214214

215-
if config.args.custom_tax:
215+
if isinstance(config.args.custom_tax, str):
216216
if "custom_tax_df" not in tsv_cache:
217217
custom_tax_df = pd.read_csv(config.args.custom_tax, sep="\t")
218218
tsv_cache["custom_tax_df"] = custom_tax_df

mess/workflow/rules/preflight/setup.smk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ if not os.path.exists(os.path.join(TAXONKIT, "names.dmp")):
5151

5252

5353
RANKS = config.args.ranks
54-
if config.args.custom_tax:
54+
if isinstance(config.args.custom_tax, str):
5555
RANKS = ",".join(list(custom_tax_df.columns[1:]))
5656
TAXONKIT = os.path.join(TAXONKIT, "custom")
5757

0 commit comments

Comments
 (0)