@@ -16,7 +16,7 @@ def run_bigscape(
16
16
antismash_path : str | PathLike ,
17
17
output_path : str | PathLike ,
18
18
extra_params : str ,
19
- version : Literal ["1" , "2" ] = "1" ,
19
+ version : Literal [1 , 2 ] = 1 ,
20
20
) -> bool :
21
21
"""Runs BiG-SCAPE to cluster BGCs.
22
22
@@ -48,7 +48,7 @@ def run_bigscape(
48
48
antismash_path: Path to the antismash output directory.
49
49
output_path: Path to the output directory where BiG-SCAPE will write its results.
50
50
extra_params: Additional parameters to pass to BiG-SCAPE.
51
- version: The version of BiG-SCAPE to run. Must be "1" or "2" .
51
+ version: The version of BiG-SCAPE to run. Must be 1 or 2 .
52
52
53
53
Returns:
54
54
True if BiG-SCAPE ran successfully, False otherwise.
@@ -62,15 +62,15 @@ def run_bigscape(
62
62
Examples:
63
63
>>> from nplinker.genomics.bigscape import run_bigscape
64
64
>>> run_bigscape(antismash_path="./antismash", output_path="./output",
65
- ... extra_params="--help", version="1" )
65
+ ... extra_params="--help", version=1 )
66
66
"""
67
67
# switch to correct version of BiG-SCAPE
68
- if version == "1" :
68
+ if version == 1 :
69
69
bigscape_py_path = "bigscape.py"
70
- elif version == "2" :
70
+ elif version == 2 :
71
71
bigscape_py_path = "bigscape-v2.py"
72
72
else :
73
- raise ValueError ("Invalid BiG-SCAPE version number. Expected: '1' or '2' ." )
73
+ raise ValueError ("Invalid BiG-SCAPE version number. Expected: 1 or 2 ." )
74
74
75
75
try :
76
76
subprocess .run ([bigscape_py_path , "-h" ], capture_output = True , check = True )
@@ -92,9 +92,9 @@ def run_bigscape(
92
92
93
93
# version 2 points to specific Pfam file, version 1 points to directory
94
94
# version 2 also requires the cluster subcommand
95
- if version == "1" :
95
+ if version == 1 :
96
96
args .extend (["--pfam_dir" , PFAM_PATH ])
97
- elif version == "2" :
97
+ elif version == 2 :
98
98
args .extend (["cluster" , "--pfam_path" , os .path .join (PFAM_PATH , "Pfam-A.hmm" )])
99
99
100
100
# add input and output paths. these are unchanged
0 commit comments