-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(#639): add non metabolizer check
- Loading branch information
Showing
4 changed files
with
32 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import analyze_functions.constants as constants | ||
|
||
def check_non_metabolizer(args): | ||
guideline = args['item'] | ||
annotations = args['annotations'] | ||
is_non_metabolizer_guideline = any(map( | ||
lambda gene: gene in constants.NON_METABOLIZERS, | ||
guideline['phenotypes'].keys(), | ||
)) and all(map( | ||
lambda gene: gene in constants.NON_METABOLIZERS or \ | ||
guideline['phenotypes'][gene][0].lower() in constants.MISSING_PHENOTYPES, | ||
guideline['phenotypes'].keys(), | ||
)) | ||
has_metabolizer_text = any(map( | ||
lambda metabolizer_text: metabolizer_text in annotations['implication'], | ||
constants.METABOLIZER_TEXTS, | ||
)) | ||
return not is_non_metabolizer_guideline or not has_metabolizer_text |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters