broadinstitute / gnomad-browser

Explore gnomAD datasets on the web
https://gnomad.broadinstitute.org
MIT License
81 stars 43 forks source link

Improve support for large region requests #170

Open nawatts opened 6 years ago

nawatts commented 6 years ago

Currently, the region page will only load a maximum of 5000 variants, however large a region is requested. This is done to prevent someone from, for example, requesting a region spanning all of chromosome 1 and its 1,687,282 variants (for comparison, TTN has 52,780 variants).

https://github.com/macarthur-lab/gnomadjs/blob/cd016641c10ffe41f07af9f75f9858372ade6922/packages/api/src/schema/types/region.js#L214-L221

https://github.com/macarthur-lab/gnomadjs/blob/cd016641c10ffe41f07af9f75f9858372ade6922/packages/api/src/schema/types/elasticVariant.js#L591-L594

Furthermore, for some region sizes it will only load variants of certain consequences.

https://github.com/macarthur-lab/gnomadjs/blob/cd016641c10ffe41f07af9f75f9858372ade6922/packages/api/src/schema/types/elasticVariant.js#L578-L588

However, nowhere in the browser is it indicated that either the number of variants or the consequence is limited. Thus, there's no explanation for why the individual variant track does not match up with the binned variant track or the total number of variants shown at the top of the page.

Options:

nawatts commented 5 years ago

This now returns either all of the requested variants or no variants and an error message if there are too many.

If there are too many variants to show individual variants, a binned variant track should be shown.