Skip to content

Commit

Permalink
Update README and change asserts to raising errors to appease the rabbit
Browse files Browse the repository at this point in the history
  • Loading branch information
rklocke committed Dec 17, 2024
1 parent 8177b82 commit 79c054f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion DI-1299/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Compare Somalier outputs in GRCh37 and GRCh38
# Compare Somalier outputs in GRCh37 and GRCh38

### Description
The `compare_b37_and_b38.py` script is used to compare Somalier Predicted_Sex values for samples in GRCh37 and GRCh38 and return any mismatches.
Expand Down
12 changes: 8 additions & 4 deletions DI-1299/compare_b37_and_b38.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,10 @@ def find_projects(search_term, number_of_projects=None):
describe={"fields": {"name": True}},
)
)
assert projects, f"No projects found with the search term {search_term}"
if not projects:
raise ValueError(
f"No projects found with the search term {search_term}"
)
projects = sorted(projects, key=lambda x: x["describe"]["name"])

if number_of_projects is not None:
Expand Down Expand Up @@ -187,9 +190,10 @@ def get_run_name_from_project_name(b38_project_name):
name of the sequencing run
"""
match = re.search(r"\d{6}_[A-Za-z0-9]+_\d{4}_[A-Z0-9]+", b38_project_name)
assert (
match
), f"Error - no sequencing run name extracted from {b38_project_name}"
if not match:
raise ValueError(
f"Error - no sequencing run name extracted from {b38_project_name}"
)

return match.group(0)

Expand Down

0 comments on commit 79c054f

Please sign in to comment.