Yifan-Yin / DMR-Project

shinyapp for DMR Visualization
0 stars 0 forks source link

Separate out transcripts plot on it's own #6

Closed wvictor14 closed 4 years ago

wvictor14 commented 4 years ago

There's an issue with genes that have a lot of transcripts. The methylation plots basically get really squished and it is difficult to see anything. This is in part because I have this auto-adjust function at the end ggarrange call that's based on the number of transcripts.

I think this could be fixed if we

I'll post an example of the problem tomorrow

wvictor14 commented 4 years ago

Here's an example of what I'm talking about.

image

I'm not sure how many genes have as many transcripts as BRCA1 (not many, probably).

wvictor14 commented 4 years ago

@Yifan-Yin Can you give this one an attempt? I think you'll be able to do it faster/better than me

Yifan-Yin commented 4 years ago

@Yifan-Yin Can you give this one an attempt? I think you'll be able to do it faster/better than me

Sounds good! I will figure it out by this weekend.

wvictor14 commented 4 years ago

Thanks!

Another solution might be to dynamically adjust the total plot height in the plotOutput call, based on the number of transcripts.

Yifan-Yin commented 4 years ago

The plot height will dynamically change depends on the number of transcripts for selceted gene. The hight will increase to 900 pixels when the number of transcipts is more than 20, otherwise it will be 800 pixels.

wvictor14 commented 4 years ago

Cool! Can you post a picture of what it looks like now for BRCA1?

Yifan-Yin commented 4 years ago

This is a screenshot when the plot height is 900 pixels. image

This one is 1300 pixels. V XVR~66A2{N RP2 AL1FP2

wvictor14 commented 4 years ago

I think this is a good enough solution for now, but the aspect ratio is a bit messed up. I think the relative heights argument in the last ggarrange needs a bit of playing around with so that the function plays nice with many-transcript-genes and few-transcript-genes.

The problem with this type of solution though is that it is very time-consuming to go in and find the "right" settings (e.g. height of the output, relative heights of each plot, etc.). In retrospect, this was a result of a bad design decision on my part. Hopefully, at some point I will have enough time to give this a bit more attention.

Consider this solved for now, but leave this issue open so I can return to this later. Thanks!