dkoslicki / NCATS

MIT License
2 stars 0 forks source link

JSON issue with null result from Q1 #125

Closed saramsey closed 6 years ago

saramsey commented 6 years ago

So the issue is that the JSON parser explodes for that disease. The JSON parser is happy with:

$ python3 Q1Solution.py -j -i malaria

{"source_genetic_conditions": {"OMIM:603903": {"conf": 0.9268518518518523, "path": [{"type": "node", "name": "OMIM:603903", "desc": "SICKLE CELL ANEMIA"}, {"type": "rel", "name": "gene_assoc_with"}, {"type": "node", "name": "P00738", "desc": "HP"}, {"type": "rel", "name": "gene_assoc_with"}, {"type": "node", "name": "DOID:12365", "desc": "malaria"}]}}, "target_disease": "malaria", "text": "The proposed mechanism of action for SICKLE CELL ANEMIA (OMIM:603903) is: (SICKLE CELL ANEMIA)--[gene_assoc_with]-->(HP:P00738:uniprot_protein)--[gene_assoc_with]-->(malaria). Confidence: 0.926852\n"} But the JSON parser is displeased with:

$ python3 Q1Solution.py -j -i alkaptonuria

Sorry, the disease alkaptonuria is not one of the Q1 diseases.

For things to work correctly, that message must be wrapped in a JSON response.

A more elegant solution needs to be designed, but for now, just wrap that in JSON and it will work okay. For the record, ALL responses must be in JSON with –j.

Can you do that?

Thanks, Eric

saramsey commented 6 years ago

@dkoslicki @edeutsch
commit 5e74b89f3542ec731a2beee2157ba8388daf4d64 should fix the issue

dkoslicki commented 6 years ago

Fixed!

edeutsch commented 6 years ago

not really. still doesn't really work. UI always passes lower case. But Q1Solution.pl seems unhappy about lower case terms for some (alkaptonuria) but not others (malaria)

dkoslicki commented 6 years ago

I’ll see if I can’t fix this soon (in 20 min or so)