# Manhattan Plot for association results

**URL:** <https://discuss.hail.is/t/manhattan-plot-for-association-results/522>\
**Category:** Feature Requests\
**Created:** [June 11, 2018, 1:59pm UTC](https://discuss.hail.is/t/manhattan-plot-for-association-results/522 "2018-06-11T13:59:10Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jjfarrell](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/jjfarrell/32/108_2.png) [@jjfarrell](https://discuss.hail.is/u/jjfarrell)\
**Post date:** [June 11, 2018, 1:59pm UTC](https://discuss.hail.is/t/manhattan-plot-for-association-results/522/1 "2018-06-11T13:59:10Z")

</div>

A Hail Manhattan Plot function would be very useful for summarizing association results. It would be much simpler to implement than the regional plot feature that was requested previously.

Here is an R code example:

> <https://github.com/Nealelab/UK_Biobank_GWAS/blob/master/imputed-v2-gwas/Manhattan_plot.R>

---

<div class="post-metadata">

**Author:** ![Laura](https://avatars.discourse-cdn.com/v4/letter/l/a4c791/32.png) [@Laura](https://discuss.hail.is/u/Laura)\
**Post date:** [August 31, 2018, 2:11pm UTC](https://discuss.hail.is/t/manhattan-plot-for-association-results/522/2 "2018-08-31T14:11:58Z")

</div>

Hi Tim,

I know your plotting functionality is in early stages. Do you think that it would be possible to customize the Manhattan plot (adding colors, the Bonferroni line, and the FDR line) please?

Thanks,

Laura

---

<div class="post-metadata">

**Author:** ![tpoterba](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/tpoterba/32/61_2.png) [@tpoterba](https://discuss.hail.is/u/tpoterba)\
**Post date:** [August 31, 2018, 2:41pm UTC](https://discuss.hail.is/t/manhattan-plot-for-association-results/522/3 "2018-08-31T14:41:53Z")

</div>

The manhattan plot function returns a bokeh Figure object, which can be used with other bokeh functionality:

[https://bokeh.pydata.org/en/latest/docs/reference/plotting.html](https://bokeh.pydata.org/en/latest/docs/reference/plotting.html)

Depending on how you want to add colors, that will need to happen inside the manhattan function, so you may need to copy/edit that code.

---

<div class="post-metadata">

**Author:** ![Laura](https://avatars.discourse-cdn.com/v4/letter/l/a4c791/32.png) [@Laura](https://discuss.hail.is/u/Laura)\
**Post date:** [November 15, 2018, 4:30pm UTC](https://discuss.hail.is/t/manhattan-plot-for-association-results/522/4 "2018-11-15T16:30:59Z")

</div>

Hi Tim,

Thanks for the Bonferroni line. With Ines, we added the FDR line too. I attached the code if it can help someone.

import numpy as np  
mt.count\_rows()  
Bonferroni\_line = -np.log10(0.05/ mt.count\_rows())  
FDR\_line = -np.log10(1\*10\*\*-5)  
manhattan = hl.plot.manhattan(gwas.p\_value, title=“Manhattan Plot”, size=4)  
from bokeh.models import Span  
hline1 = Span(location=Bonferroni\_line, dimension=‘width’, line\_color=‘red’, line\_width=1)  
hline2 = Span(location=FDR\_line, dimension=‘width’, line\_color=‘orange’, line\_width=1)  
manhattan.renderers.extend([hline1,hline2])  
show(manhattan)

Best,

Laura

---

<div class="post-metadata">

**Author:** ![jjfarrell](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/jjfarrell/32/108_2.png) [@jjfarrell](https://discuss.hail.is/u/jjfarrell)\
**Post date:** [September 15, 2019, 12:37pm UTC](https://discuss.hail.is/t/manhattan-plot-for-association-results/522/5 "2019-09-15T12:37:42Z")

</div>

Is there a way to save the manhattan and qq plots programmatically to a png or pdf file?

---

<div class="post-metadata">

**Author:** ![danking](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/danking/32/43_2.png) [@danking](https://discuss.hail.is/u/danking)\
**Post date:** [September 16, 2019, 2:24pm UTC](https://discuss.hail.is/t/manhattan-plot-for-association-results/522/6 "2019-09-16T14:24:11Z")

</div>

Hail plots use Bokeh, so you can use the Bokeh facilities for exporting: [https://bokeh.pydata.org/en/latest/docs/user\_guide/export.html](https://bokeh.pydata.org/en/latest/docs/user_guide/export.html)
