Closed qj009 closed 1 year ago
Hi, this is most likely because you are plotting rice data. The manhattan plot assumes there are 22 or 23 chromosomes of a certain length in the input datasets.
This however does not explain why it doesnt show a legend for multiple phenotypes. Can you please show me the command you are using to call the manhattan plot function and a screenshot of your plot?
Hi, it can plot 12 chrosome. It just contain big gap between chrosomes, like the picture attached below.
The code is: manhattan(list(hap_plot, hapi_plot,snp), legend_labels = c("pheno1", "pheno2","pheno3"),sign_thresh = 5e-06)
Besides, it can not show the legend when I only plot one chromsome. And one chromsome plot looks ok to me since it can fill the whole plot.
code: manhattan(list(hap_plot, hapi_plot,snp), legend_labels = c("pheno1", "pheno2","pheno3"),sign_thresh = 5e-06, chr="chr12")
The gaps on the Manhattan plot are there because the human chromosomes are larger than the rice chromosomes. There is a relatively easy fix to this which I will implement in topr version 1.1.10.
The missing legend when plotting one chromosome only, is a bug introduced in version 1.1.9. This will be fixed in version 1.1.10 as well. Until then, you can add the use_shades argument as a temporary fix:
manhattan(list(hap_plot, hapi_plot,snp), legend_labels = c("pheno1", "pheno2","pheno3"),sign_thresh = 5e-06, chr="chr12", use_shades=T)
I will let you know when version 1.1.10 is released - it should be within the next couple of days, or at the weekend.
Sounds great! I am looking forward to it!
Hi again,
topr_v.1.1.10 is now available from CRAN. Now you can make Manhattan plots from datasets with varying number of chromosomes and chromosome lengths by including the argument get_chr_lengths_from_data = T in your manhattan function call.
Example:
> manhattan(CD_UKBB %>% filter(POS < 80000000))
Example of how to plot without the gaps:
> manhattan(CD_UKBB %>% filter(POS < 80000000), get_chr_lengths_from_data = T)
Please let me know if something doesnt work as expected!
Hello, it works perfectly! Thank you!
Hello, I am plotting rice data and data points can not fill the whole plot. It contains a big empty gap between chromsomes. When I plot one chromsome, it looks ok. But It does not show legend for multiple phenotypes.