diff --git a/config/nplinker.toml b/config/nplinker.toml index ba47aec7..04899350 100644 --- a/config/nplinker.toml +++ b/config/nplinker.toml @@ -80,6 +80,10 @@ parameters = "version1_parameters_or_version2_parameters" # BiG-SCPAPE v2 also runs a `--mix` analysis by default, so you don't need to set this parameter here. # An example value could be: "--mibig-version 3.1 --include-singletons --gcf-cutoffs 0.30" +full_results = false +# [REQUIRED-UNDER-CONDITIONS] Only required for BiG-SCAPE 2 +# Whether to generate a full set of results instead of only the output database for BiG-SCAPE 2 + [gnps] # Settings for GNPS. diff --git a/src/nplinker/arranger.py b/src/nplinker/arranger.py index 1cd64cfc..6166a3fa 100644 --- a/src/nplinker/arranger.py +++ b/src/nplinker/arranger.py @@ -319,6 +319,7 @@ def _run_bigscape(self) -> None: self.bigscape_running_output_dir, self.config.bigscape.parameters, version, + self.config.bigscape.full_results ) if version == "1": diff --git a/src/nplinker/config.py b/src/nplinker/config.py index 0b8626a6..ff88a9e3 100644 --- a/src/nplinker/config.py +++ b/src/nplinker/config.py @@ -70,6 +70,7 @@ def load_config(config_file: str | PathLike) -> Dynaconf: Validator("bigscape.parameters", is_type_of=str), Validator("bigscape.cutoff", required=True, is_type_of=str), Validator("bigscape.version", required=True, is_type_of=str, is_in=["1", "2"]), + Validator("bigscape.full_results", required=True, when=Validator("bigscape.version", eq="2"), is_type_of=bool), # GNPS Validator("gnps.version", required=True, is_type_of=str, is_in=["1", "2"]), # Scoring diff --git a/src/nplinker/genomics/bigscape/runbigscape.py b/src/nplinker/genomics/bigscape/runbigscape.py index c38076c7..fcb89c03 100644 --- a/src/nplinker/genomics/bigscape/runbigscape.py +++ b/src/nplinker/genomics/bigscape/runbigscape.py @@ -17,6 +17,7 @@ def run_bigscape( output_path: str | PathLike, extra_params: str, version: Literal["1", "2"] = "1", + full_results: bool = False ) -> bool: """Runs BiG-SCAPE to cluster BGCs. @@ -49,6 +50,7 @@ def run_bigscape( output_path: Path to the output directory where BiG-SCAPE will write its results. extra_params: Additional parameters to pass to BiG-SCAPE. version: The version of BiG-SCAPE to run. Must be "1" or "2". + full_results: Whether to generate full results for BiG-SCAPE 2 Returns: True if BiG-SCAPE ran successfully, False otherwise. @@ -100,10 +102,12 @@ def run_bigscape( "cluster", "--pfam-path", os.path.join(PFAM_PATH, "Pfam-A.hmm"), - "--db-only-output", ] ) + if not full_results: + args.append("--db-only-output") + # add input and output paths. these are unchanged args.extend(["-i", str(antismash_path), "-o", str(output_path)])