Skip to content

Commit 592af10

Browse files
committed
remove the bigscape changes from other pull request
1 parent 915b2ad commit 592af10

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

src/nplinker/genomics/bigscape/runbigscape.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def run_bigscape(
1616
antismash_path: str | PathLike,
1717
output_path: str | PathLike,
1818
extra_params: str,
19-
version: Literal["1", "2"] = "1",
19+
version: Literal[1, 2] = 1,
2020
) -> bool:
2121
"""Runs BiG-SCAPE to cluster BGCs.
2222
@@ -48,7 +48,7 @@ def run_bigscape(
4848
antismash_path: Path to the antismash output directory.
4949
output_path: Path to the output directory where BiG-SCAPE will write its results.
5050
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.
5252
5353
Returns:
5454
True if BiG-SCAPE ran successfully, False otherwise.
@@ -62,15 +62,15 @@ def run_bigscape(
6262
Examples:
6363
>>> from nplinker.genomics.bigscape import run_bigscape
6464
>>> run_bigscape(antismash_path="./antismash", output_path="./output",
65-
... extra_params="--help", version="1")
65+
... extra_params="--help", version=1)
6666
"""
6767
# switch to correct version of BiG-SCAPE
68-
if version == "1":
68+
if version == 1:
6969
bigscape_py_path = "bigscape.py"
70-
elif version == "2":
70+
elif version == 2:
7171
bigscape_py_path = "bigscape-v2.py"
7272
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.")
7474

7575
try:
7676
subprocess.run([bigscape_py_path, "-h"], capture_output=True, check=True)
@@ -92,9 +92,9 @@ def run_bigscape(
9292

9393
# version 2 points to specific Pfam file, version 1 points to directory
9494
# version 2 also requires the cluster subcommand
95-
if version == "1":
95+
if version == 1:
9696
args.extend(["--pfam_dir", PFAM_PATH])
97-
elif version == "2":
97+
elif version == 2:
9898
args.extend(["cluster", "--pfam_path", os.path.join(PFAM_PATH, "Pfam-A.hmm")])
9999

100100
# add input and output paths. these are unchanged

tests/unit/genomics/test_runbigscape.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from .. import DATA_DIR
55

66

7-
@pytest.mark.parametrize("version", ["1", "2"])
7+
@pytest.mark.parametrize("version", [1, 2])
88
def test_run_bigscape(tmp_path, version):
99
"""Test whether BiG-SCAPE runs at all using the --help command"""
1010
result = bigscape.run_bigscape(
@@ -20,7 +20,7 @@ def test_run_bigscape(tmp_path, version):
2020
@pytest.mark.skipif(
2121
os.getenv("GITHUB_ACTIONS") == "true", reason="The test is time-consuming on CI"
2222
)
23-
@pytest.mark.parametrize("version", ["1", "2"])
23+
@pytest.mark.parametrize("version", [1, 2])
2424
def test_run_bigscape_small_dataset(tmp_path, version):
2525
result = bigscape.run_bigscape(
2626
antismash_path=DATA_DIR / "bigscape" / "minimal_dataset",
@@ -38,13 +38,13 @@ def test_run_bigscape_wrong_version(tmp_path):
3838
antismash_path=DATA_DIR,
3939
output_path=tmp_path,
4040
extra_params="--help",
41-
version="3",
41+
version=3,
4242
)
4343

4444
assert "version" in e.value.args[0]
4545

4646

47-
@pytest.mark.parametrize("version", ["1", "2"])
47+
@pytest.mark.parametrize("version", [1, 2])
4848
def test_input_path_not_exist(tmp_path, version):
4949
with pytest.raises(FileNotFoundError) as e:
5050
bigscape.run_bigscape(
@@ -57,7 +57,7 @@ def test_input_path_not_exist(tmp_path, version):
5757
assert "antismash_path" in e.value.args[0]
5858

5959

60-
@pytest.mark.parametrize("version", ["1", "2"])
60+
@pytest.mark.parametrize("version", [1, 2])
6161
def test_bad_parameters(tmp_path, version):
6262
with pytest.raises(RuntimeError) as e:
6363
bigscape.run_bigscape(

0 commit comments

Comments
 (0)