🚧 Add drug_interactions
#12
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This modifies the ddi data on the starling page to pass the linting checks.
Here's a sample of the original facts:
and here is what it looks like following the changes:
This was done by replacing
-,", and/in the drug names with underscores_and converting everything to lowercase:As a precaution, I recorded each "corrected" value to a dictionary, and would throw an error if the same key was mapped to two different values in the original set:
{ "3_hydroxy_3_methylglutaryl_coenzyme_a_reductase": [ "\"3-hydroxy-3-methylglutaryl-coenzyme_A_reductase\"" ], "pravastatin": [ "\"Pravastatin\"" ], "gamma_aminobutyric_acid_type_b_receptor_subunit_1": [ "\"Gamma-aminobutyric_acid_type_B_receptor_subunit_1\"" ], "baclofen": [ "\"Baclofen\"" ] }I was worried there might be cases like:
Warfarin/otherandWarfarin_otherthat would get mapped into the same bucket, but this did not occur and structures should be equivalent up to renaming.The code I used to do this is copied below, but it isn't interesting enough to commit to the repository:
Python script to clean DDI data to pass linter