biothings / mychem.info

MyChem.info: A BioThings API for chemical/drug annotations
http://mychem.info
Apache License 2.0
15 stars 12 forks source link

split ndc.pharm_classes value into a list #161

Closed newgene closed 5 months ago

newgene commented 1 year ago

https://mychem.info/v1/query?q=_exists_:ndc.pharm_classes&fields=ndc.pharm_classes

"pharm_classes": "Anti-Inflammatory Agents, Non-Steroidal [CS], Cyclooxygenase Inhibitors [MoA], Histamine H2 Receptor Antagonists [MoA], Histamine-2 Receptor Antagonist [EPC], Nonsteroidal Anti-inflammatory Drug [EPC]",

Looks like it can be split into a list of string or object (if we want to split out CS, MoA parts)

colleenXu commented 1 year ago

Note that I mention this field here in a potential annotation service effort https://github.com/biothings/biothings_explorer/issues/344#issuecomment-961647522

newgene commented 1 year ago

@VidhiKulkarni the relevant data plugin is here:

https://github.com/biothings/mychem.info/tree/master/src/hub/dataload/sources/ndc

particularly, the ndc_parser.py file.

DylanWelzel commented 10 months ago

@newgene So the expected result for:

"pharm_classes": "Anti-Inflammatory Agents, Non-Steroidal [CS], Cyclooxygenase Inhibitors [MoA], Histamine H2 Receptor Antagonists [MoA], Histamine-2 Receptor Antagonist [EPC], Nonsteroidal Anti-inflammatory Drug [EPC]",

Should be:

    "pharm_classes": [
        "Anti-Inflammatory Agents, Non-Steroidal",
        "Cyclooxygenase Inhibitors",
        "Histamine H2 Receptor Antagonists",
        "Histamine-2 Receptor Antagonist",
        "Nonsteroidal Anti-inflammatory Drug"
    ]

?

newgene commented 10 months ago

@DylanWelzel can you provide the available values of the categories within the brackets, like CS, MoA, EPC etc.? We might consider split these values out.

DylanWelzel commented 10 months ago

@newgene I included the total count for each category as well

MoA (56950)
EPC (94522)
CS (50390)
PE (58556)
Chemical/Ingredient (510)
EXT (1620)
DylanWelzel commented 10 months ago

commit 42ff7cf8091e8efaaff92cb37afb3c95fbf688b4 fixes this issue, pending new release

DylanWelzel commented 5 months ago

fixed with new release