Skip to content

Commit

Permalink
Merge pull request #495 from pepkit/dev
Browse files Browse the repository at this point in the history
Release 0.40.7
  • Loading branch information
khoroshevskyi authored Sep 30, 2024
2 parents 5b255d8 + cfccd7e commit 60523c5
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 5 deletions.
2 changes: 1 addition & 1 deletion peppy/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.40.6"
__version__ = "0.40.7"
2 changes: 1 addition & 1 deletion peppy/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -809,7 +809,7 @@ def attr_merge(self):
if len(this_sample_rows) == 0:
_LOGGER.debug(
"No merge rows for sample '%s', skipping",
sample[SAMPLE_NAME_ATTR],
sample[self.st_index],
)
continue
_LOGGER.debug("%d rows to merge", len(this_sample_rows))
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
pep_version: "2.1.0"
sample_table: sample_table.csv
subsample_table:
- subsample_table1.csv
- subsample_table2.csv

sample_table_index: sample_id

sample_modifiers:
append:
local_files: LOCAL
genome: "fg"
derive:
attributes: [local_files]
sources:
LOCAL: "../data/{file_path}"
imply:
- if:
identifier: "frog1"
then:
genome: "frog_frog"
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
sample_id,protocol,identifier
frog_1,anySampleType,frog1
frog_2,anySampleType,frog2
frog_3,anySampleType,frog3
frog_4,anySampleType,frog4
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
sample_id,file_path,subsample_name
frog_1,file/a.txt,a
frog_1,file/b.txt,b
frog_1,file/c.txt,c
frog_2,file/a.txt,a
frog_2,file/b.txt,b
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
sample_id,random_string,subsample_name
frog_1,x_x,x
frog_1,y_y,y
frog_1,z_z,z
frog_2,xy_yx,xy
frog_2,xx_xx,xx
8 changes: 5 additions & 3 deletions tests/test_Project.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,10 @@ def test_subsample_table_works_when_no_sample_mods(self, example_pep_cfg_path):
p = Project(cfg=example_pep_cfg_path)
assert any([s["file"] != "multi" for s in p.samples])

@pytest.mark.parametrize("example_pep_cfg_path", ["custom_index"], indirect=True)
def test_cutsom_sample_table_index_config(self, example_pep_cfg_path):
@pytest.mark.parametrize(
"example_pep_cfg_path", ["custom_index", "multiple_subsamples"], indirect=True
)
def test_custom_sample_table_index_config(self, example_pep_cfg_path):
"""
Verify that custom sample table index is sourced from the config
"""
Expand Down Expand Up @@ -599,7 +601,7 @@ def test_unequality(self, example_pep_cfg_path, example_pep_csv_path):

@pytest.mark.parametrize(
"example_pep_cfg_path",
["append", "custom_index", "imply", "subtables"],
["append", "custom_index", "imply", "subtables", "multiple_subsamples"],
indirect=True,
)
@pytest.mark.parametrize("orient", ["dict", "records"])
Expand Down

0 comments on commit 60523c5

Please sign in to comment.