Roleren / ORFik

MIT License
32 stars 9 forks source link

Ribo-seq Check plot needs more horizontal space #165

Closed SuhasSrinivasan closed 5 months ago

SuhasSrinivasan commented 6 months ago

Hello again!

This is a small bug/enhancement request.

The read length on X-axis has less horizontal space, which is a consequence of the overall width of the plot.

STATS_plot_Ribo-seq_Check.pdf

Request that the plot be made wider and accommodate a wider X-axis.

Roleren commented 5 months ago

I updated the function to use 9 break points for x axis if there are more than 14 read lengths in total. Pull master from github to test.

Other things you can do:

  1. Manually specify width to be larger, eventually all characters will be non overlapping (might need to be very big)
  2. Make it yourself by returning the list output as following:
library(ORFik); library(data.table); library(ggplot2); library(gridExtra)
plot_list <- RiboQC.plot(df, as_gg_list = TRUE)
# Returns this now: plot_list <- list(gg_all_mrna, gg_frame_per_stack, gg_all_tx_regions, gg_all_tx_other, gg_mRNA_regions)
# Now make your plot
frame_size <- rep(2, 2) # Default is rep(2,1)
lay <- rbind(c(frame_size, 1),
               c(frame_size, 3),
               c(frame_size, 4),
               c(frame_size, 5))
final <- gridExtra::grid.arrange(grobs = plot_list, layout_matrix = lay); plot(final)

Let me know how it works, will close issue in a few days if nothing more is needed :)

SuhasSrinivasan commented 5 months ago

Thank you let me try this.

Roleren commented 5 months ago

Reopen if there was still a problem.