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
49 stars 13 forks source link

empty plot when plotting with 'regionplot' #88

Open zhana-optima opened 2 months ago

zhana-optima commented 2 months ago

Hi, when using regionplot, the desired plot appears in second place after an empty plot. In Rmd,e.g.

image

totajuliusd commented 2 months ago

Hi, can you show me the command you are using to create the plot?

zhana-optima commented 2 months ago

Hello,

Here it is: topr::regionplot(to_plot_list, region = rrid, ntop = length(to_plot_list), legend_labels = plot_legends, annotate_with = 'ID', build = 38, log_trans_p = !transform_log10, verbose = FALSE, rsids_with_vline = fit_snps)


From: totajuliusd @.> Sent: 03 September 2024 13:01 To: totajuliusd/topr @.> Cc: Zhana Kuncheva @.>; Author @.> Subject: Re: [totajuliusd/topr] empty plot when plotting with 'regionplot' (Issue #88)

Hi, can you show me the command you are using to create the plot?

— Reply to this email directly, view it on GitHubhttps://github.com/totajuliusd/topr/issues/88#issuecomment-2326346805, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AZQAHLJKTYOT6BN7UP7BQMLZUWQLHAVCNFSM6AAAAABNR5EB36VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMRWGM2DMOBQGU. You are receiving this because you authored the thread.Message ID: @.***>

zhana-optima commented 2 months ago

Also, when I add the option for rsids_with_vline = rsids, I do get an issue with the legend labels which was previously reported and resolved.[cid:824602f7-24ed-4668-a6c8-0b2e5c892b41] If I don't add the rsids_with_vline option, I get a normal legend: [cid:39dcba67-9006-4d83-8f4a-ff370cbf4233]


From: Zhana Kuncheva @.> Sent: 03 September 2024 13:13 To: totajuliusd/topr @.>; totajuliusd/topr @.> Cc: Author @.> Subject: Re: [totajuliusd/topr] empty plot when plotting with 'regionplot' (Issue #88)

Hello,

Here it is: topr::regionplot(to_plot_list, region = rrid, ntop = length(to_plot_list), legend_labels = plot_legends, annotate_with = 'ID', build = 38, log_trans_p = !transform_log10, verbose = FALSE, rsids_with_vline = fit_snps)


From: totajuliusd @.> Sent: 03 September 2024 13:01 To: totajuliusd/topr @.> Cc: Zhana Kuncheva @.>; Author @.> Subject: Re: [totajuliusd/topr] empty plot when plotting with 'regionplot' (Issue #88)

Hi, can you show me the command you are using to create the plot?

— Reply to this email directly, view it on GitHubhttps://github.com/totajuliusd/topr/issues/88#issuecomment-2326346805, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AZQAHLJKTYOT6BN7UP7BQMLZUWQLHAVCNFSM6AAAAABNR5EB36VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMRWGM2DMOBQGU. You are receiving this because you authored the thread.Message ID: @.***>

totajuliusd commented 2 months ago

Which editor are you using? I cant replicate the problem when I run the command from Rstudio or directly from the terminal.

And which version of topr are you using?

zhana-optima commented 2 months ago

I am working in Rstudio on a Mac machine. I am using version 2.0.2 of topr.

Best, Zhana


From: totajuliusd @.> Sent: 03 September 2024 13:49 To: totajuliusd/topr @.> Cc: Zhana Kuncheva @.>; Author @.> Subject: Re: [totajuliusd/topr] empty plot when plotting with 'regionplot' (Issue #88)

Which editor are you using? I cant replicate the problem when I run the command from Rstudio or directly from the terminal.

And which version of topr are you using?

— Reply to this email directly, view it on GitHubhttps://github.com/totajuliusd/topr/issues/88#issuecomment-2326441446, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AZQAHLILX7P7UVSB3PJNENLZUWV5XAVCNFSM6AAAAABNR5EB36VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMRWGQ2DCNBUGY. You are receiving this because you authored the thread.Message ID: @.***>

totajuliusd commented 2 months ago

Does everything work as expected when you do:

manhattan(CD_UKBB)

and:

ggplot()+geom_point(aes(x=c(1:10), y=c(1:10)))

zhana-optima commented 2 months ago

Yes, both seem to be running fine.


From: totajuliusd @.> Sent: 03 September 2024 13:57 To: totajuliusd/topr @.> Cc: Zhana Kuncheva @.>; Author @.> Subject: Re: [totajuliusd/topr] empty plot when plotting with 'regionplot' (Issue #88)

Does everything work as expected when you do:

manhattan(CD_UKBB)

and:

ggplot()+geom_point(aes(x=c(1:10), y=c(1:10)))

— Reply to this email directly, view it on GitHubhttps://github.com/totajuliusd/topr/issues/88#issuecomment-2326458415, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AZQAHLIACHGQVOKS4RWDXJ3ZUWW3JAVCNFSM6AAAAABNR5EB36VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMRWGQ2TQNBRGU. You are receiving this because you authored the thread.Message ID: @.***>

totajuliusd commented 2 months ago

Hmmm.... what about when you do the following?

regionplot(CD_UKBB, gene="IL23R")

zhana-optima commented 2 months ago

Yes, this looks good but there is no legend.


From: totajuliusd @.> Sent: 03 September 2024 14:02 To: totajuliusd/topr @.> Cc: Zhana Kuncheva @.>; Author @.> Subject: Re: [totajuliusd/topr] empty plot when plotting with 'regionplot' (Issue #88)

Hmmm.... what about when you do the following?

regionplot(CD_UKBB, gene="IL23R")

— Reply to this email directly, view it on GitHubhttps://github.com/totajuliusd/topr/issues/88#issuecomment-2326469562, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AZQAHLON56XIZVZQRCXBUX3ZUWXNNAVCNFSM6AAAAABNR5EB36VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMRWGQ3DSNJWGI. You are receiving this because you authored the thread.Message ID: @.***>

totajuliusd commented 2 months ago

What if you do:

regionplot(list(CD_UKBB, lead_snps), gene="IL23R", ntop=2, legend_labels=c("CD UKBB", "lead snps"), build = "38", rsids_with_vline = "rs11576518")

Although, I can see the issue there with the legend label you mentioned. That should have been fixed, but is clearly still a problem in the regionplot.

zhana-optima commented 2 months ago

Yes, with this example I do get both the empty plot first + the legend issue as well.


From: totajuliusd @.> Sent: 03 September 2024 14:16 To: totajuliusd/topr @.> Cc: Zhana Kuncheva @.>; Author @.> Subject: Re: [totajuliusd/topr] empty plot when plotting with 'regionplot' (Issue #88)

What if you do:

regionplot(list(CD_UKBB, lead_snps), gene="IL23R", ntop=2, legend_labels=c("CD UKBB", "lead snps"), build = "38", rsids_with_vline = "rs11576518")

Although, I can see the issue there with the legend label you mentioned. That should have been fixed, but is clearly still a problem in the regionplot.

— Reply to this email directly, view it on GitHubhttps://github.com/totajuliusd/topr/issues/88#issuecomment-2326501601, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AZQAHLPWADUDGUHNGOHCJR3ZUWZC3AVCNFSM6AAAAABNR5EB36VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMRWGUYDCNRQGE. You are receiving this because you authored the thread.Message ID: @.***>

zhana-optima commented 2 months ago

First plot [cid:eaff7929-7ec9-44d7-8b9b-e265e374555f] And then second plot [cid:eef615d0-115f-4379-8264-e02e040b7645]


From: Zhana Kuncheva @.> Sent: 03 September 2024 14:40 To: totajuliusd/topr @.>; totajuliusd/topr @.> Cc: Author @.> Subject: Re: [totajuliusd/topr] empty plot when plotting with 'regionplot' (Issue #88)

Yes, with this example I do get both the empty plot first + the legend issue as well.


From: totajuliusd @.> Sent: 03 September 2024 14:16 To: totajuliusd/topr @.> Cc: Zhana Kuncheva @.>; Author @.> Subject: Re: [totajuliusd/topr] empty plot when plotting with 'regionplot' (Issue #88)

What if you do:

regionplot(list(CD_UKBB, lead_snps), gene="IL23R", ntop=2, legend_labels=c("CD UKBB", "lead snps"), build = "38", rsids_with_vline = "rs11576518")

Although, I can see the issue there with the legend label you mentioned. That should have been fixed, but is clearly still a problem in the regionplot.

— Reply to this email directly, view it on GitHubhttps://github.com/totajuliusd/topr/issues/88#issuecomment-2326501601, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AZQAHLPWADUDGUHNGOHCJR3ZUWZC3AVCNFSM6AAAAABNR5EB36VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMRWGUYDCNRQGE. You are receiving this because you authored the thread.Message ID: @.***>

totajuliusd commented 2 months ago

Which version of RStudio are you using?

And do you think its the inclusion of the legend that causes the empty plot to appear? For examples, is this ok

regionplot(CD_UKBB, gene="IL23R")

but not this:

regionplot(CD_UKBB, gene="IL23R", legend_labels="CD_UKBB")

zhana-optima commented 2 months ago

This is my Rstudio version: Version 2023.12.1+402 (2023.12.1+402) The usage of regionplot triggers an empty plot regardless of the arguments.


From: totajuliusd @.> Sent: 03 September 2024 17:49 To: totajuliusd/topr @.> Cc: Zhana Kuncheva @.>; Author @.> Subject: Re: [totajuliusd/topr] empty plot when plotting with 'regionplot' (Issue #88)

Which version of RStudio are you using?

And do you think its the inclusion of the legend that causes the empty plot to appear? For examples, is this ok

regionplot(CD_UKBB, gene="IL23R")

but not this:

regionplot(CD_UKBB, gene="IL23R", legend_labels='CD_UKBB')

— Reply to this email directly, view it on GitHubhttps://github.com/totajuliusd/topr/issues/88#issuecomment-2326996497, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AZQAHLN7R5UA6SOFGL6QINDZUXSAVAVCNFSM6AAAAABNR5EB36VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMRWHE4TMNBZG4. You are receiving this because you authored the thread.Message ID: @.***>

totajuliusd commented 2 months ago

Does the following also create an empty plot?

jpeg("regionplot.jpg")
regionplot(CD_UKBB, gene="IL23R")
dev.off()

I cant seem to re-create this problem. Im using RStudio version 2024.04.2+764 and R version 4.4.0, and ggplot2 version 3.5.1.

zhana-optima commented 2 months ago

No, it does not produce an empty plot. I will update my Rstudio version and keep you posted if the problem still persists. It could be due to versions...


From: totajuliusd @.> Sent: 03 September 2024 18:23 To: totajuliusd/topr @.> Cc: Zhana Kuncheva @.>; Author @.> Subject: Re: [totajuliusd/topr] empty plot when plotting with 'regionplot' (Issue #88)

Does the following also create an empty plot?

jpeg("regionplot.jpg") regionplot(CD_UKBB, gene="IL23R") dev.off()

I cant seem to re-create this problem. Im using RStudio version 2024.04.2+764 (2024.04.2+764) and R R version 4.4.0, and ggplot2 version 3.5.1.

— Reply to this email directly, view it on GitHubhttps://github.com/totajuliusd/topr/issues/88#issuecomment-2327056726, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AZQAHLIE6FYNRAZPEXXH2D3ZUXWCHAVCNFSM6AAAAABNR5EB36VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMRXGA2TMNZSGY. You are receiving this because you authored the thread.Message ID: @.***>

zhana-optima commented 1 month ago

I have updated both R and Rstudio and both issues (empty plot + legend names) still persist. If I use extract_plots = TRUE, there is no issue, and each sub-plot appears on its own. It is when this defaults to FALSE and the three plots are combined the empty plot issue appears.

Best, Zhana


From: Zhana Kuncheva @.> Sent: 03 September 2024 18:25 To: totajuliusd/topr @.>; totajuliusd/topr @.> Cc: Author @.> Subject: Re: [totajuliusd/topr] empty plot when plotting with 'regionplot' (Issue #88)

No, it does not produce an empty plot. I will update my Rstudio version and keep you posted if the problem still persists. It could be due to versions...


From: totajuliusd @.> Sent: 03 September 2024 18:23 To: totajuliusd/topr @.> Cc: Zhana Kuncheva @.>; Author @.> Subject: Re: [totajuliusd/topr] empty plot when plotting with 'regionplot' (Issue #88)

Does the following also create an empty plot?

jpeg("regionplot.jpg") regionplot(CD_UKBB, gene="IL23R") dev.off()

I cant seem to re-create this problem. Im using RStudio version 2024.04.2+764 (2024.04.2+764) and R R version 4.4.0, and ggplot2 version 3.5.1.

— Reply to this email directly, view it on GitHubhttps://github.com/totajuliusd/topr/issues/88#issuecomment-2327056726, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AZQAHLIE6FYNRAZPEXXH2D3ZUXWCHAVCNFSM6AAAAABNR5EB36VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMRXGA2TMNZSGY. You are receiving this because you authored the thread.Message ID: @.***>

RvV1979 commented 1 month ago

I can confirm that I have the same issues of an empty first page when exporting to PDF. I am running Rstudio 2024.04.2+764 on an Apple M1 Pro. It is not a major issue, however, because I can easily remove the blank page in post.