annotate plot_regression_performance.py @ 1:ca5ffd01f136 draft default tip

planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit 2473a53fde6d8e646e90d2a5201999c8c6a48695
author bgruening
date Wed, 09 Jan 2019 02:56:53 -0500
parents 157659f94256
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
1 import argparse
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
2 import pandas as pd
1
ca5ffd01f136 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit 2473a53fde6d8e646e90d2a5201999c8c6a48695
bgruening
parents: 0
diff changeset
3 import numpy as np
0
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
4 import plotly
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
5 import plotly.graph_objs as go
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
6
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
7
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
8 def main(infile_input, infile_output):
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
9 """
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
10 Produce an interactive actual vs predicted curves and residual plots
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
11 Args:
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
12 infile_input: str, input tabular file with true values
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
13 infile_output: str, input tabular file with predicted values
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
14 """
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
15
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
16 df_input = pd.read_csv(infile_input, sep='\t', parse_dates=True)
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
17 df_output = pd.read_csv(infile_output, sep='\t', parse_dates=True)
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
18 true_values = df_input.iloc[:, -1].copy()
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
19 predicted_values = df_output.iloc[:, -1].copy()
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
20 axis_labels = list(range(1, len(true_values)+1))
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
21
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
22 # true vs predicted curves
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
23 trace_true = go.Scatter(
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
24 x=axis_labels,
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
25 y=true_values,
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
26 mode='lines+markers',
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
27 name='True values'
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
28 )
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
29
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
30 trace_predicted = go.Scatter(
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
31 x=axis_labels,
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
32 y=predicted_values,
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
33 mode='lines+markers',
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
34 name='Predicted values'
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
35 )
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
36
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
37 layout_tp = go.Layout(
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
38 title='True vs predicted values',
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
39 xaxis=dict(title='Number of data points'),
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
40 yaxis=dict(title='Values')
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
41 )
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
42
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
43 data_tp = [trace_true, trace_predicted]
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
44 fig_tp = go.Figure(data=data_tp, layout=layout_tp)
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
45 plotly.offline.plot(fig_tp, filename="output_actual_vs_pred.html", auto_open=False)
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
46
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
47 # scatter plot
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
48 max_tv = int(max(true_values))
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
49 x_y_values = list(range(0, max_tv))
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
50
1
ca5ffd01f136 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit 2473a53fde6d8e646e90d2a5201999c8c6a48695
bgruening
parents: 0
diff changeset
51 true_mean = np.mean(true_values)
ca5ffd01f136 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit 2473a53fde6d8e646e90d2a5201999c8c6a48695
bgruening
parents: 0
diff changeset
52 res_true_predicted = np.sum((true_values - predicted_values) ** 2)
ca5ffd01f136 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit 2473a53fde6d8e646e90d2a5201999c8c6a48695
bgruening
parents: 0
diff changeset
53 res_total = np.sum((true_values - true_mean) ** 2)
ca5ffd01f136 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit 2473a53fde6d8e646e90d2a5201999c8c6a48695
bgruening
parents: 0
diff changeset
54 r2 = 1 - (res_true_predicted / float(res_total))
ca5ffd01f136 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit 2473a53fde6d8e646e90d2a5201999c8c6a48695
bgruening
parents: 0
diff changeset
55 rmse = np.sqrt(np.mean([(x - y) ** 2 for x, y in zip(true_values, predicted_values)]))
ca5ffd01f136 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit 2473a53fde6d8e646e90d2a5201999c8c6a48695
bgruening
parents: 0
diff changeset
56
0
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
57 trace_x_eq_y = go.Scatter(
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
58 x=x_y_values,
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
59 y=x_y_values,
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
60 mode='lines',
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
61 name='X = Y curve'
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
62 )
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
63
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
64 trace_true_pred = go.Scatter(
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
65 x=true_values,
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
66 y=predicted_values,
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
67 mode='markers',
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
68 name='True and predicted values'
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
69 )
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
70
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
71 layout_true_pred = go.Layout(
1
ca5ffd01f136 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit 2473a53fde6d8e646e90d2a5201999c8c6a48695
bgruening
parents: 0
diff changeset
72 title='True vs predicted values (RMSE: %s, R2: %s)' % (str(np.round(rmse, 2)), str(np.round(r2, 2))),
0
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
73 xaxis=dict(title='True values'),
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
74 yaxis=dict(title='Predicted values')
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
75 )
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
76
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
77 data_true_pred = [trace_true_pred, trace_x_eq_y]
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
78 fig_true_pred = go.Figure(data=data_true_pred, layout=layout_true_pred)
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
79 plotly.offline.plot(fig_true_pred, filename="output_scatter_plot.html", auto_open=False)
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
80
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
81 # residual plot
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
82 residual = predicted_values - true_values
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
83 trace_residual = go.Scatter(
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
84 x=predicted_values,
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
85 y=residual,
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
86 mode='markers'
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
87 )
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
88
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
89 layout_residual = go.Layout(
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
90 title='Residual vs predicted values',
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
91 xaxis=dict(title='Predicted values'),
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
92 yaxis=dict(title='Residual (Predicted - True)')
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
93 )
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
94
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
95 data_residual = [trace_residual]
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
96 fig_residual = go.Figure(data=data_residual, layout=layout_residual)
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
97 plotly.offline.plot(fig_residual, filename="output_residual_plot.html", auto_open=False)
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
98
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
99
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
100 if __name__ == "__main__":
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
101 aparser = argparse.ArgumentParser()
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
102 aparser.add_argument("-i", "--input", dest="infile_input", required=True)
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
103 aparser.add_argument("-j", "--output", dest="infile_output", required=True)
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
104 args = aparser.parse_args()
157659f94256 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_regression_performance_plots commit c17efec384ad7438f54675fae1ab0c3a57c22869
bgruening
parents:
diff changeset
105 main(args.infile_input, args.infile_output)