@@ -92,10 +92,6 @@ def _convert_gbk_bigslice(self, ctx: contextlib.ExitStack) -> None:
92
92
from Bio .SeqFeature import SeqFeature , FeatureLocation
93
93
from ...model import ClusterTable
94
94
95
- # locate original folder
96
- if not os .path .exists (self .input_dir ):
97
- self .error ("Could not find input folder:" , repr (self .input_dir ))
98
- raise CommandExit (errno .ENOENT )
99
95
# collect `*.clusters.tsv` files
100
96
cluster_files = glob .glob (os .path .join (self .input_dir , "*.clusters.tsv" ))
101
97
unit = "table" if len (cluster_files ) == 1 else "tables"
@@ -262,6 +258,13 @@ def execute(self, ctx: contextlib.ExitStack) -> int: # noqa: D102
262
258
self ._check ()
263
259
ctx .enter_context (self .progress )
264
260
ctx .enter_context (patch_showwarnings (self ._showwarnings )) # type: ignore
261
+ # check the input is a folder
262
+ if not os .path .exists (self .input_dir ):
263
+ self .error ("Could not find input folder:" , repr (self .input_dir ))
264
+ raise CommandExit (errno .ENOENT )
265
+ elif not os .path .isdir (self .input_dir ):
266
+ self .error ("Input is not a folder:" , repr (self .input_dir ))
267
+ raise CommandExit (errno .ENOTDIR )
265
268
# run the appropriate method
266
269
if self .args ["gbk" ]:
267
270
if self .args ["--format" ] == "bigslice" :
0 commit comments