Skip to content

Commit

Permalink
feat(#639): add brand name comma check
Browse files Browse the repository at this point in the history
  • Loading branch information
tamslo committed Oct 15, 2024
1 parent dedfeea commit 525de49
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions scripts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ and optionally correct what can be corrected easily in
| Check | Description | `--correct`ed | Only for single-gene results* |
| ----- | ----------- | ------------- | ----------------------------- |
| `brand_whitespace` | Drug brand names should not have leading or trailing white space. |||
| `brand_comma` | Drug brand names should not include commas (spit these, could do automatically). |||
| `single_any_fallback` | If any fallback guidelines `*` are present, only one guideline should be present (otherwise other guidelines are ignored) |||
| `fallback_single_lookup` | If fallback guidelines `*` or `~` are present, only one lookup value per gene should be present (otherwise other lookup values are ignored) |||
| `annotated_but_not_staged` | Warns if a drug is annotated but not staged (ignored drugs in `IGNORE_STAGED_CHECK`) |||
Expand Down
3 changes: 2 additions & 1 deletion scripts/analyze.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import sys

from analyze_functions.checks.fully_annotated_staged import check_if_fully_annotated_staged
from analyze_functions.checks.brand_name_whitespace import check_brand_name_whitespace
from analyze_functions.checks.brand_name import check_brand_name_comma, check_brand_name_whitespace
from analyze_functions.checks.metabolization_before_consequence import check_metabolization_before_consequence
from analyze_functions.checks.fallback_guidelines import check_single_any_fallback_guideline, check_single_lookup_fallback_guideline
from analyze_functions.checks.non_metabolizer import check_non_metabolizer
Expand All @@ -22,6 +22,7 @@

DRUG_CHECKS = {
'brand_whitespace': check_brand_name_whitespace,
'brand_comma': check_brand_name_comma,
'single_any_fallback': check_single_any_fallback_guideline,
'fallback_single_lookup': check_single_lookup_fallback_guideline,
'annotated_but_not_staged': check_if_fully_annotated_staged,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,13 @@ def check_brand_name_whitespace(args):
if trimmed_name != brand_name:
check_applies = False
break
return check_applies

def check_brand_name_comma(args):
annotations = args['annotations']
check_applies = True
for brand_name in annotations['brand_names']:
if ',' in brand_name:
check_applies = False
break
return check_applies

0 comments on commit 525de49

Please sign in to comment.