totajuliusd / topr

topr is a collection of plotting functions for visualizing and exploring genetic association results. Association results from multiple phenotypes can be viewed simultaneously, over the entire genome (Manhattan plot) or in the more detailed regional view.
Other
45 stars 13 forks source link

Inconsistent number of exons being plotted #32

Closed sahirbhatnagar closed 8 months ago

sahirbhatnagar commented 9 months ago

The number of exons plotted seems to be dependent on wether the legend is shown or not.

pacman::p_load(reprex)
pacman::p_load_gh("GenuityScience/topr")
data("R2_CD_UKBB")

# no legend seems to have more exons plotted
locuszoom(R2_CD_UKBB, 
          extract_plots = TRUE,
          protein_coding_only = TRUE, 
          show_gene_legend = FALSE)$gene_plot
#> [1] "Zoomed to region:  1:67042284-67359988"


# with legend seems to have less exons plotted
locuszoom(R2_CD_UKBB, 
          extract_plots = TRUE,
          protein_coding_only = TRUE, 
          show_gene_legend = TRUE)$gene_plot
#> [1] "Zoomed to region:  1:67042284-67359988"

Created on 2023-12-18 with reprex v2.0.2

totajuliusd commented 9 months ago

Hi, you are using an older version of topr. This does not seem to be a problem in the most recent version of topr.

If I do,

install.packages("topr")
library(topr)

 locuszoom(R2_CD_UKBB, 
       extract_plots = TRUE,
       protein_coding_only = TRUE, 
        show_gene_legend = TRUE)$gene_plot

I get

image

Please try this and see if this fixes your problem!