Skip to content

Commit

Permalink
fix: handle chembl approval enum oddities
Browse files Browse the repository at this point in the history
  • Loading branch information
jsstevenson committed Oct 9, 2023
1 parent 078bde5 commit ffe49c7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion therapy/etl/chembl.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ def _unwrap_group_concat(value: Optional[str]) -> List[str]:
@staticmethod
def _get_approval_rating(value: Optional[float]) -> Optional[ApprovalRating]:
"""Standardize approval rating value
:param value: value retrieved from ChEMBL database
:return: instantiated ApprovalRating
:raise: ValueError if invalid value is provided
Expand Down Expand Up @@ -106,7 +107,6 @@ def _get_indications(self, value: Optional[str]) -> List[Dict]:
indication = {
"disease_id": ind_group[0],
"disease_label": ind_group[2],
"supplemental_info": {"chembl_max_phase_for_ind": phase},
}
if phase is not None:
indication["supplemental_info"] = {
Expand Down
9 changes: 9 additions & 0 deletions therapy/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,15 @@ class ApprovalRating(str, Enum):
ulcer at Phase 3, and also liver disease at Phase 1. "
- CHEMBL_4: "A marketed drug e.g. AMINOPHYLLINE (CHEMBL1370561) is an FDA
approved drug for treatment of asthma. "
- CHEMBL_WITHDRAWN: "A withdrawn drug is an approved drug contained in a medicinal
product that subsequently had been removed from the market. The reasons for
withdrawal may include toxicity, lack of efficacy, or other reasons such as an
unfavorable risk-to-benefit ratio following approval and marketing of the drug.
ChEMBL considers an approved drug to be withdrawn only if all medicinal products
that contain the drug as an active ingredient have been withdrawn from one (or more)
regions of the world. Note that all medicinal products for a drug can be withdrawn
in one region of the world while still being marketed in other jurisdictions."
https://pubs.acs.org/doi/10.1021/acs.chemrestox.0c00296
Drugs@FDA:
- FDA_PRESCRIPTION: "A prescription drug product requires a doctor's authorization
Expand Down

0 comments on commit ffe49c7

Please sign in to comment.