diff --git a/DI-1299/README.md b/DI-1299/README.md index 2cf20a3..864ad59 100644 --- a/DI-1299/README.md +++ b/DI-1299/README.md @@ -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. diff --git a/DI-1299/compare_b37_and_b38.py b/DI-1299/compare_b37_and_b38.py index cdefd3c..d733248 100644 --- a/DI-1299/compare_b37_and_b38.py +++ b/DI-1299/compare_b37_and_b38.py @@ -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: @@ -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)