diff --git a/cubi_tk/snappy/itransfer_sv_calling.py b/cubi_tk/snappy/itransfer_sv_calling.py index e7cb76d..7a91912 100644 --- a/cubi_tk/snappy/itransfer_sv_calling.py +++ b/cubi_tk/snappy/itransfer_sv_calling.py @@ -15,8 +15,7 @@ class SnappyStepNotFoundException(Exception): - def __str__(self): - return "snappy-pipeline config does not define the expected steps this function needs." + """Raise when snappy-pipeline config does not define the expected steps this function needs.""" class SnappyItransferSvCallingCommand(IndexLibrariesOnlyMixin, SnappyItransferCommandBase): @@ -24,7 +23,7 @@ class SnappyItransferSvCallingCommand(IndexLibrariesOnlyMixin, SnappyItransferCo fix_md5_files = True command_name = "itransfer-sv-calling" - step_names = ("sv_calling", "sv_calling_targeted") + step_names = ("sv_calling_wgs", "sv_calling_targeted") start_batch_in_family = True def __init__(self, args): @@ -46,7 +45,15 @@ def __init__(self, args): f"Could not find any sv-calling step name in 'config.yaml'. Was looking for one of: {', '.join(self.__class__.step_names)}" ) - self.defined_callers = config["step_config"][self.step_name]["tools"] + if self.step_name == "sv_calling_targeted": + self.defined_callers = config["step_config"][self.step_name]["tools"] + else: # if self.step_name == 'sv_calling_wgs' + # For WGS config looks like: sv_calling_wgs::tools::::[...] + self.defined_callers = [ + tool + for subcat in config["step_config"][self.step_name]["tools"] + for tool in config["step_config"][self.step_name]["tools"][subcat] + ] @classmethod def setup_argparse(cls, parser: argparse.ArgumentParser) -> None: diff --git a/tests/test_snappy_itransfer_sv_calling.py b/tests/test_snappy_itransfer_sv_calling.py index 813e6b2..6b677cc 100644 --- a/tests/test_snappy_itransfer_sv_calling.py +++ b/tests/test_snappy_itransfer_sv_calling.py @@ -42,10 +42,11 @@ def fake_config(n_tools=1): tool2 = textwrap.dedent( r""" - sv_calling: - tools: - - gcnv - - manta + sv_calling_wgs: + dna: + tools: + - gcnv + - manta dummy_line """ ).rstrip("dummy_line\n")