From 1f4edcd4ea51ec2368b372c3a7523f7af482efaa Mon Sep 17 00:00:00 2001 From: Matthew Wells Date: Fri, 20 Dec 2024 11:14:36 -0600 Subject: [PATCH 1/4] removed empty tests.py file --- tests.py | 0 tests/test_utils.py | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) delete mode 100644 tests.py diff --git a/tests.py b/tests.py deleted file mode 100644 index e69de29..0000000 diff --git a/tests/test_utils.py b/tests/test_utils.py index aad1e0e..af627c1 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -17,11 +17,11 @@ (["14", "1000", "12"], 'int'), ([14, 1000, 12], 'int'), ([""], ''), + ([14, 20, "AA"], 'hash'), #! These tests are commented out for the sake of having some #! set of tests be present and readily testable but if #! further development is to be performed on Profile Dists #! these tests should be addressed. - #! ([14, 20, "AA"], 'mix'), #! (["0.00", "1.0", "3.0"], 'mix'), #! (["0.3", 1.0, "4.2"], 'mix'), #! ([0.00, 1.0, 3.0], 'mix'), From d3643cf17aee6e9646f4875c5458fe93cfd43022 Mon Sep 17 00:00:00 2001 From: Matthew Wells Date: Fri, 20 Dec 2024 15:17:33 -0600 Subject: [PATCH 2/4] added additional tests for row dropping behaviour --- tests/data/data_empty_row.tsv | 7 +++++++ tests/data/data_empty_row_q.tsv | 7 +++++++ tests/data/data_empty_row_space.tsv | 7 +++++++ tests/data/data_empty_row_us.tsv | 7 +++++++ tests/test_workflows.yml | 29 +++++++++++++++++++++++++++++ 5 files changed, 57 insertions(+) create mode 100644 tests/data/data_empty_row.tsv create mode 100644 tests/data/data_empty_row_q.tsv create mode 100644 tests/data/data_empty_row_space.tsv create mode 100644 tests/data/data_empty_row_us.tsv diff --git a/tests/data/data_empty_row.tsv b/tests/data/data_empty_row.tsv new file mode 100644 index 0000000..df0ff9b --- /dev/null +++ b/tests/data/data_empty_row.tsv @@ -0,0 +1,7 @@ +Sample A1 A2 A3 A4 +r1 1 1 1 0 +r2 1 1 1 0 +r3 1 1 1 0 +r4 1 1 1 0 +r5 2 2 2 0 +r6 1 0 0 0 \ No newline at end of file diff --git a/tests/data/data_empty_row_q.tsv b/tests/data/data_empty_row_q.tsv new file mode 100644 index 0000000..fcd08ee --- /dev/null +++ b/tests/data/data_empty_row_q.tsv @@ -0,0 +1,7 @@ +Sample A1 A2 A3 A4 +r1 1 1 1 0 +r2 1 1 1 0 +r3 1 1 1 0 +r4 1 1 1 0 +r5 2 2 2 0 +r6 1 ? ? ? \ No newline at end of file diff --git a/tests/data/data_empty_row_space.tsv b/tests/data/data_empty_row_space.tsv new file mode 100644 index 0000000..aef5d4c --- /dev/null +++ b/tests/data/data_empty_row_space.tsv @@ -0,0 +1,7 @@ +Sample A1 A2 A3 A4 +r1 1 1 1 0 +r2 1 1 1 0 +r3 1 1 1 0 +r4 1 1 1 0 +r5 2 2 2 0 +r6 1 \ No newline at end of file diff --git a/tests/data/data_empty_row_us.tsv b/tests/data/data_empty_row_us.tsv new file mode 100644 index 0000000..ff4cfc7 --- /dev/null +++ b/tests/data/data_empty_row_us.tsv @@ -0,0 +1,7 @@ +Sample A1 A2 A3 A4 +r1 1 1 1 0 +r2 1 1 1 0 +r3 1 1 1 0 +r4 1 1 1 0 +r5 2 2 2 0 +r6 1 _ _ _ \ No newline at end of file diff --git a/tests/test_workflows.yml b/tests/test_workflows.yml index 0051909..2e2f8be 100644 --- a/tests/test_workflows.yml +++ b/tests/test_workflows.yml @@ -25,3 +25,32 @@ - path: scaled/results.text md5sum: 6eb56fbf3a925fa7b50f65b78febdad4 +- name: Hamming Distance and drop empty columns + command: profile_dists -q tests/data/data.tsv -r tests/data/data.tsv -d hamming -o hamming_count_missing --missing_thresh 0.0 + files: + - path: hamming_count_missing/results.text + md5sum: ab0b4f36fcb14e1f50722c52fee9f327 + +- name: Hamming Distance and drop row 0 + command: profile_dists -q tests/data/data_empty_row.tsv -r tests/data/data_empty_row.tsv -d hamming -o hamming --sample_qual_thresh 0.70 + files: + - path: hamming/results.text + md5sum: ab0b4f36fcb14e1f50722c52fee9f327 + +- name: Hamming Distance and drop row question mark + command: profile_dists -q tests/data/data_empty_row_q.tsv -r tests/data/data_empty_row_q.tsv -d hamming -o hamming --sample_qual_thresh 0.70 + files: + - path: hamming/results.text + md5sum: ab0b4f36fcb14e1f50722c52fee9f327 + +- name: Hamming Distance and drop row underscore + command: profile_dists -q tests/data/data_empty_row_us.tsv -r tests/data/data_empty_row_us.tsv -d hamming -o hamming --sample_qual_thresh 0.70 + files: + - path: hamming/results.text + md5sum: ab0b4f36fcb14e1f50722c52fee9f327 + +- name: Hamming Distance and drop space + command: profile_dists -q tests/data/data_empty_row_space.tsv -r tests/data/data_empty_row_space.tsv -d hamming -o hamming --sample_qual_thresh 0.70 + files: + - path: hamming/results.text + md5sum: ab0b4f36fcb14e1f50722c52fee9f327 From a1d6568e7676a32a1739da7ca2498eb23cd13de4 Mon Sep 17 00:00:00 2001 From: Matthew Wells Date: Fri, 20 Dec 2024 15:32:06 -0600 Subject: [PATCH 3/4] fixed branch protection workflow --- .github/workflows/branch.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/branch.yml b/.github/workflows/branch.yml index e87c9c6..2d2175b 100644 --- a/.github/workflows/branch.yml +++ b/.github/workflows/branch.yml @@ -12,7 +12,7 @@ jobs: - name: Check PRs if: github.repository == 'phac-nml/profile_dists' run: | - { [[ ${{github.event.pull_request.head.repo.full_name }} == phac-nml/profile_dists]] && [[ $GITHUB_HEAD_REF == "dev" ]]; } || [[ $GITHUB_HEAD_REF == "patch" ]] + { [[ ${{github.event.pull_request.head.repo.full_name }} == phac-nml/profile_dists ]] && [[ $GITHUB_HEAD_REF == "dev" ]]; } || [[ $GITHUB_HEAD_REF == "patch" ]] # If the above check failed, post a comment on the PR explaining the failure # NOTE - this doesn't currently work if the PR is coming from a fork, due to limitations in GitHub actions secrets From 3293d87c551b2f322694b28f2f50bc6843a6df94 Mon Sep 17 00:00:00 2001 From: Matthew Wells Date: Fri, 20 Dec 2024 15:34:25 -0600 Subject: [PATCH 4/4] fixed branch.yml --- .github/workflows/branch.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/branch.yml b/.github/workflows/branch.yml index e87c9c6..2d2175b 100644 --- a/.github/workflows/branch.yml +++ b/.github/workflows/branch.yml @@ -12,7 +12,7 @@ jobs: - name: Check PRs if: github.repository == 'phac-nml/profile_dists' run: | - { [[ ${{github.event.pull_request.head.repo.full_name }} == phac-nml/profile_dists]] && [[ $GITHUB_HEAD_REF == "dev" ]]; } || [[ $GITHUB_HEAD_REF == "patch" ]] + { [[ ${{github.event.pull_request.head.repo.full_name }} == phac-nml/profile_dists ]] && [[ $GITHUB_HEAD_REF == "dev" ]]; } || [[ $GITHUB_HEAD_REF == "patch" ]] # If the above check failed, post a comment on the PR explaining the failure # NOTE - this doesn't currently work if the PR is coming from a fork, due to limitations in GitHub actions secrets