PediatricOpenTargets / OpenPedCan-api

2 stars 7 forks source link

Improve readability of boxplots that have too many boxes #45

Closed logstar closed 2 years ago

logstar commented 3 years ago

Boxplots transferred by /tpm/gene-disease-gtex/plot and /tpm/gene-all-cancer/plot are 13 inches wide and 9 inches long. Following is an example:

api_boxplot

When there are a couple of more boxes, the boxplot will become less readable, because smaller boxes and texts will be shown in the plot.

@taylordm suggested to collapse all GTEx tissue groups into one box. Implement this approach for the new endpoints in #44. The plots will be further discussed and evaluated.

cc @chinwallaa @afarrel @taylordm

logstar commented 3 years ago

All-cancer-groups and all-GTEx-tissue-subgroups plot is not easily readable without collapsing GTEx samples. For example:

gpc2_acg

Collapsing GTEx samples into one box makes the plot easily readable. For example:

gpc2_acg_collapse

I will implement #44 with all GTEx samples collapsed into one box.

logstar commented 3 years ago

@taylordm suggested to provide another API option/parameter to return wider images for boxplots with too many boxes. For example, add a gtex_box_group parameter, which takes the following values:

Wider images will require horizontal scrolling on PedOT website, so this needs to be further coordinated with FNL team front-end development.

The width of the image can be implemented either statically or dynamically. I will implement the static-image-size option, to make the API more robust and straightforward.

cc @taylordm @afarrel @chinwallaa

logstar commented 3 years ago

@taylordm @afarrel @chinwallaa - Following is an example all-cancer all-GTEx-tissue boxplot with image width doubled. The response time of the wide image is about 80% longer than the standard image, because the wide and standard image sizes are about 600KB and 1200KB respectively.

test-tpm-gene-all-cancer-gtex-ENSG00000213420-y-scale-log10