KarrLab / datanator_rest_api

A OAS3 compliant REST API for the Datanator integrated database
MIT License
0 stars 3 forks source link

Reaction API Not Returning Data When bound=tight #51

Closed yosefdroth closed 4 years ago

yosefdroth commented 4 years ago

One of the reaction queries only seems to work when the bound is set to loose. However, it should return information even when the bound is set to tight.

The query for: D-Glucose 1,6-bisphosphate + D-Mannose 6-phosphate → D-Mannose 1,6-bisphosphate + D-Glucose 6-phosphate

Does not work whe the bound is set to tight: http://api.datanator.info/reactions/kinlaw_by_name/?substrates=D-Glucose%201%2C6-bisphosphate&substrates=D-Mannose%206-phosphate&products=D-Mannose%201%2C6-bisphosphate&products=D-Glucose%206-phosphate&_from=0&size=10&bound=tight&taxon_distance=false&projection=%7B%27_id%27%3A%200%2C%20%27kegg_meta.gene_ortholog%27%3A%200%7D

But does work when the bound is set to loose: http://api.datanator.info/reactions/kinlaw_by_name/?substrates=D-Glucose%201%2C6-bisphosphate&substrates=D-Mannose%206-phosphate&products=D-Mannose%201%2C6-bisphosphate&products=D-Glucose%206-phosphate&_from=0&size=10&bound=loose&taxon_distance=false&projection=%7B%27_id%27%3A%200%2C%20%27kegg_meta.gene_ortholog%27%3A%200%7D

However, if you check the information returned from the loose query, reaction data where the substrates and products precisely math the query. Therefore, it should return that information even when the bound is set to tight.

lzy7071 commented 4 years ago

@yosefdroth Thank you for letting me know. The bug has to do with how the query parameter is serialized by Swagger. By default, , is interpreted as an indication for a new item in lists. So when a reactant's /substrate's name is D-Glucose 1,6-bisphosphate, the serializer turned the substrate into D-Glucose 1 and 6-bisphosphate. The reaction equation, therefore, became D-Glucose 1 + 6-bisphosphate + D-Mannose 6-phosphate -> D-Mannose 1 + 6-bisphosphate + D-Glucose 6-phosphate, causing bound = tight to return no qualifying results. I changed the way swagger serialized URL for this particular query and the URL schema is as follows: /reactions/kinlaw_by_name/?substrates={}|{}&products={}|{}&_from=0&size=10&bound=tight&taxon_distance=false&species=homo%20sapiens&projection=%7B%27_id%27%3A%200%2C%20%27kegg_meta.gene_ortholog%27%3A%200%7D

yosefdroth commented 4 years ago

Thanks!