Skip to content

Commit ad1f8b2

Browse files
committed
manhattan plot is ready to go
1 parent 9bd483f commit ad1f8b2

File tree

3 files changed

+25
-13
lines changed

3 files changed

+25
-13
lines changed

src/notebooks/manhattan-plot-with-matplotlib.ipynb

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,7 @@
44
"cell_type": "markdown",
55
"metadata": {},
66
"source": [
7-
"## Manhattan Plot with Matplotlib"
8-
]
9-
},
10-
{
11-
"cell_type": "markdown",
12-
"metadata": {},
13-
"source": [
14-
"**Manhattan plot** is a type of scatterplot which is mostly used in genome-wide association studies (GWAS). Each point represents a genetic variant. X axis value represents its position on the chromosome and the value on the y-axis represents the −log10 of the P value.\n",
7+
"A [Manhattan plot](https://en.wikipedia.org/wiki/Manhattan_plot#:~:text=A%20Manhattan%20plot%20is%20a,GWAS)%20to%20display%20significant%20SNPs.) is a variation of a [scatterplot](https://www.python-graph-gallery.com/scatter-plot/). It is used in genome-wide association studies (GWAS). Each point represents a genetic variant. Its X axis value represents its position on the chromosome and the value on the y-axis represents the `−log10` of its P value.\n",
158
"\n",
169
"[Elad Joseph](https://stackoverflow.com/users/2807860/elad-joseph) suggested this nice solution on [stackoverflow](https://stackoverflow.com/questions/37463184/how-to-create-a-manhattan-plot-with-matplotlib-in-python) to build a manhattan plot with matplotlib and pandas:"
1710
]
@@ -80,18 +73,32 @@
8073
"# show the graph\n",
8174
"plt.show()"
8275
]
76+
},
77+
{
78+
"source": [
79+
"Et voila! A nice Manhattan plot allowing to check for phenotype - genotype associations!"
80+
],
81+
"cell_type": "markdown",
82+
"metadata": {}
83+
},
84+
{
85+
"source": [
86+
"> Note: if you're willing to build a manhattan plot with R, [this blogpost](https://www.r-graph-gallery.com/101_Manhattan_plot.html) should interest you"
87+
],
88+
"cell_type": "markdown",
89+
"metadata": {}
8390
}
8491
],
8592
"metadata": {
8693
"chartType": "scatter",
87-
"description": "This post explains how to build a <b>manhattan plot</b> in python and provides a reproducible code.",
94+
"description": "This post explains how to build a <b>manhattan plot</b> using <code>python</code> and <code>matplotlib</code>. A manhattan plot is commonly used by geneticians for genome-wide association study.",
8895
"family": "correlation",
8996
"kernelspec": {
9097
"display_name": "Python 3",
9198
"language": "python",
9299
"name": "python3"
93100
},
94-
"keywords": "python, chart, plot, seaborn, matplotlib, scatterplot, manhattan",
101+
"keywords": "python, chart, plot, seaborn, matplotlib, scatterplot, manhattan, genetics, gwas",
95102
"language_info": {
96103
"codemirror_mode": {
97104
"name": "ipython",
@@ -104,10 +111,10 @@
104111
"pygments_lexer": "ipython3",
105112
"version": "3.7.3"
106113
},
107-
"seoDescription": "How to draw a manhattan plot with matplotlib",
114+
"seoDescription": "How to draw a manhattan plot with python and matplotlib for genetics analysis",
108115
"slug": "manhattan-plot-with-matplotlib",
109-
"title": "Manhattan Plot with Matplotlib"
116+
"title": "Manhattan Plot with Python and Matplotlib"
110117
},
111118
"nbformat": 4,
112119
"nbformat_minor": 4
113-
}
120+
}

src/pages/scatter-plot.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,11 @@ export default function ViolinPlot() {
197197
caption="Add an annotation to highlight a specific marker"
198198
linkTo="/193-annotate-matplotlib-chart"
199199
/>
200+
<ChartImageContainer
201+
imgName="manhattan-plot-with-matplotlib"
202+
caption="How to build a Manhattan plot with Python and Matplotlib"
203+
linkTo="/manhattan-plot-with-matplotlib"
204+
/>
200205
</Row>
201206
</Container>
202207

151 KB
Loading

0 commit comments

Comments
 (0)