Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolai-vKuegelgen committed Jun 25, 2024
1 parent e565fef commit 8e72a3b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cubi_tk/isa_tab/add_ped.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,11 @@ def on_visit_material(self, material, node_path, study=None, assay=None):

def on_visit_process(self, process, node_path, study=None, assay=None):
super().on_visit_process(process, node_path, study, assay)
donor_name = node_path[0].name if _is_source(node_path[0]) else _sample_to_donor_name(node_path[0].name)
donor_name = (
node_path[0].name
if _is_source(node_path[0])
else _sample_to_donor_name(node_path[0].name)
)
if donor_name not in self.donor_map:
return None
proc_config_pairs = {
Expand Down Expand Up @@ -481,9 +485,11 @@ def _append_assay_line_protocol(
counter += 1
return counter, curr


def _sample_to_donor_name(sample_name):
return sample_name.rstrip("-N1")


def _donor_to_sample_name(donor_name):
return "%s-N1" % donor_name

Expand Down
1 change: 1 addition & 0 deletions tests/test_isa_tab_add_ped.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ def test_add_ped_just_update(tmpdir):
str(pathlib.Path(__file__).parent / "data" / "isa_tab" / "expected_output"),
)


def test_add_ped_sheet_subset_update(tmpdir):
"""Test updating study and assay, but only a subset of the sheet."""
scratch_dir = tmpdir / "scratch"
Expand Down

0 comments on commit 8e72a3b

Please sign in to comment.