statgen / locuszoom-hosted

A web service to upload and share GWAS results with LocusZoom.js
https://my.locuszoom.org
MIT License
1 stars 0 forks source link

Internal server (500) errors for datasets with "inf" values for Beta or std_err_beta #47

Open abought opened 6 months ago

abought commented 6 months ago

Summary

JSON does not support serializing values of "infinity". Trying to do so results in errors on the client, server, or both.

When a GWAS file has a value of infinity in these columns, plots of that region fail to render with a 500 Internal Server Error (see screenshot) because the backend json serializer fails.

Screen Shot 2024-02-22 at 4 15 01 PM

Proposed fix

We already special-case serialization of these values for the neg_log_pvalue field. Similar treatment of beta and stderr_beta should alleviate this error. This should be tested on a real dataset, in case there are follow on problems (UI etc) when displaying plot tooltips with inf values.

https://github.com/statgen/locuszoom-hosted/blob/d726fb23477e36d244c43be87d84b5ed3e1725e7/locuszoom_plotting_service/api/serializers.py#L46-L61

We've seen several reports of this problem recently, after a long period of none. It's possible that a new GWAS program has been released that is prone to under/overflow, which might make this a higher priority for users in the future.