Skip to content

Commit

Permalink
Addressing review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolai-vKuegelgen committed Jan 25, 2024
1 parent 7d898a9 commit ddb9838
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 14 deletions.
12 changes: 0 additions & 12 deletions cubi_tk/snappy/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,6 @@ class CouldNotFindBioMedSheet(Exception):
"""Raised when BioMedSheet could not be found in configuration file."""


def load_snappy_config(path_yaml):
"""Load SNAPPY configuration file.
:param path_yaml: Path to SNAPPY configuration file.
:type path_yaml: pathlib.Path
:return: Returns configuration dictionary.
"""
with open(path_yaml, "rt") as f:
return yaml.safe_load(f)


def load_sheet_tsv(path_tsv, tsv_shortcut="germline"):
"""Load sample sheet.
Expand Down
6 changes: 4 additions & 2 deletions cubi_tk/snappy/itransfer_sv_calling.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import typing

from logzero import logger
import yaml

from . import common
from .itransfer_common import IndexLibrariesOnlyMixin, SnappyItransferCommandBase
Expand All @@ -15,7 +16,7 @@

class SnappyStepNotFoundException(Exception):
def __str__(self):
return "snappy-pipeline is not installed. This function will not work."
return "snappy-pipeline config does not define the expected steps this function needs."


class SnappyItransferSvCallingCommand(IndexLibrariesOnlyMixin, SnappyItransferCommandBase):
Expand All @@ -30,7 +31,8 @@ def __init__(self, args):
super().__init__(args)

path = common.find_snappy_root_dir(self.args.base_path or os.getcwd())
config = common.load_snappy_config(path / ".snappy_pipeline/config.yaml")
with open(str(path / ".snappy_pipeline/config.yaml", "rt")) as f:
config = yaml.safe_load(f)
self.step_name = None
for step_name in self.__class__.step_names:
if not self.step_name and step_name in config["step_config"]:
Expand Down

0 comments on commit ddb9838

Please sign in to comment.