-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCode.py
48 lines (41 loc) · 1.1 KB
/
Code.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# Your own data can be uploaded on Github (in a repository) first and then raw data link be used.
# https://dash.plotly.com/dash-bio/manhattanplot
import pandas as pd
import dash
from dash.dependencies import Input, Output
import dash_bio as dashbio
from dash import html, dcc
app = dash.Dash(__name__)
df = pd.read_csv('https://git.io/manhattan_data.csv')
app.layout = html.Div([
'Threshold value',
dcc.Slider(
id='default-manhattanplot-input',
min=1,
max=10,
marks={
i: {'label': str(i)} for i in range(10)
},
value=4
),
html.Br(),
html.Div(
dcc.Graph(
id='default-dashbio-manhattanplot',
figure=dashbio.ManhattanPlot(
dataframe=df
)
)
)
])
@app.callback(
Output('default-dashbio-manhattanplot', 'figure'),
Input('default-manhattanplot-input', 'value')
)
def update_manhattanplot(threshold):
return dashbio.ManhattanPlot(
dataframe=df,
genomewideline_value=threshold
)
if __name__ == '__main__':
app.run_server(debug=True)