annotate paracords_plot.py @ 2:9958188c6195 draft default tip

"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit b26c6ec671ec63cce1f86c70e928673ed2c82f82"
author bgruening
date Mon, 04 Nov 2019 12:20:51 -0500
parents 7b21a9b5922f
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
7b2455348edf planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit 93fcfe0fa6a64246d13e0fb7e35a357985b02465
bgruening
parents:
diff changeset
1 import sys
7b2455348edf planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit 93fcfe0fa6a64246d13e0fb7e35a357985b02465
bgruening
parents:
diff changeset
2 import argparse
7b2455348edf planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit 93fcfe0fa6a64246d13e0fb7e35a357985b02465
bgruening
parents:
diff changeset
3 import plotly
7b2455348edf planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit 93fcfe0fa6a64246d13e0fb7e35a357985b02465
bgruening
parents:
diff changeset
4 import plotly.graph_objs as go
7b2455348edf planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit 93fcfe0fa6a64246d13e0fb7e35a357985b02465
bgruening
parents:
diff changeset
5 import pandas as pd
2
9958188c6195 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit b26c6ec671ec63cce1f86c70e928673ed2c82f82"
bgruening
parents: 1
diff changeset
6 import re
0
7b2455348edf planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit 93fcfe0fa6a64246d13e0fb7e35a357985b02465
bgruening
parents:
diff changeset
7
2
9958188c6195 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit b26c6ec671ec63cce1f86c70e928673ed2c82f82"
bgruening
parents: 1
diff changeset
8
9958188c6195 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit b26c6ec671ec63cce1f86c70e928673ed2c82f82"
bgruening
parents: 1
diff changeset
9 def main(infile, col_dimensions, categorized, col_color,
9958188c6195 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit b26c6ec671ec63cce1f86c70e928673ed2c82f82"
bgruening
parents: 1
diff changeset
10 dimension_mode='by_index'):
0
7b2455348edf planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit 93fcfe0fa6a64246d13e0fb7e35a357985b02465
bgruening
parents:
diff changeset
11 """
7b2455348edf planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit 93fcfe0fa6a64246d13e0fb7e35a357985b02465
bgruening
parents:
diff changeset
12 Produce an interactive paracords plotting html
7b2455348edf planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit 93fcfe0fa6a64246d13e0fb7e35a357985b02465
bgruening
parents:
diff changeset
13 Args:
7b2455348edf planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit 93fcfe0fa6a64246d13e0fb7e35a357985b02465
bgruening
parents:
diff changeset
14 infile: str, tabular file
7b2455348edf planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit 93fcfe0fa6a64246d13e0fb7e35a357985b02465
bgruening
parents:
diff changeset
15 col_dimensions: str, comma separated index numbers. For example: "3,4,5"
7b2455348edf planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit 93fcfe0fa6a64246d13e0fb7e35a357985b02465
bgruening
parents:
diff changeset
16 col_color: str, index number
2
9958188c6195 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit b26c6ec671ec63cce1f86c70e928673ed2c82f82"
bgruening
parents: 1
diff changeset
17 dimension_mode: str, one ['by_index', 'by_name']
0
7b2455348edf planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit 93fcfe0fa6a64246d13e0fb7e35a357985b02465
bgruening
parents:
diff changeset
18 """
7b2455348edf planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit 93fcfe0fa6a64246d13e0fb7e35a357985b02465
bgruening
parents:
diff changeset
19 df = pd.read_csv(infile, sep='\t', parse_dates=True)
7b2455348edf planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit 93fcfe0fa6a64246d13e0fb7e35a357985b02465
bgruening
parents:
diff changeset
20
7b2455348edf planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit 93fcfe0fa6a64246d13e0fb7e35a357985b02465
bgruening
parents:
diff changeset
21 dimensions = []
2
9958188c6195 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit b26c6ec671ec63cce1f86c70e928673ed2c82f82"
bgruening
parents: 1
diff changeset
22
9958188c6195 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit b26c6ec671ec63cce1f86c70e928673ed2c82f82"
bgruening
parents: 1
diff changeset
23 if dimension_mode not in ['by_index', 'by_name']:
9958188c6195 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit b26c6ec671ec63cce1f86c70e928673ed2c82f82"
bgruening
parents: 1
diff changeset
24 raise ValueError("Select dimensions `{}` is not supported!"\
9958188c6195 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit b26c6ec671ec63cce1f86c70e928673ed2c82f82"
bgruening
parents: 1
diff changeset
25 .format(dimension_mode))
9958188c6195 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit b26c6ec671ec63cce1f86c70e928673ed2c82f82"
bgruening
parents: 1
diff changeset
26 if dimension_mode == 'by_index':
9958188c6195 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit b26c6ec671ec63cce1f86c70e928673ed2c82f82"
bgruening
parents: 1
diff changeset
27 col_dimensions = [int(x)-1 for x in col_dimensions.split(',')]
9958188c6195 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit b26c6ec671ec63cce1f86c70e928673ed2c82f82"
bgruening
parents: 1
diff changeset
28 col_dimensions = df.columns[col_dimensions]
9958188c6195 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit b26c6ec671ec63cce1f86c70e928673ed2c82f82"
bgruening
parents: 1
diff changeset
29 else:
9958188c6195 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit b26c6ec671ec63cce1f86c70e928673ed2c82f82"
bgruening
parents: 1
diff changeset
30 if '*' not in col_dimensions:
9958188c6195 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit b26c6ec671ec63cce1f86c70e928673ed2c82f82"
bgruening
parents: 1
diff changeset
31 col_dimensions = [header.strip() for header in col_dimensions.split(',')]
9958188c6195 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit b26c6ec671ec63cce1f86c70e928673ed2c82f82"
bgruening
parents: 1
diff changeset
32 else:
9958188c6195 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit b26c6ec671ec63cce1f86c70e928673ed2c82f82"
bgruening
parents: 1
diff changeset
33 pattern = col_dimensions.strip()
9958188c6195 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit b26c6ec671ec63cce1f86c70e928673ed2c82f82"
bgruening
parents: 1
diff changeset
34 col_dimensions = [header for header in df.columns
9958188c6195 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit b26c6ec671ec63cce1f86c70e928673ed2c82f82"
bgruening
parents: 1
diff changeset
35 if re.search(pattern, header)]
9958188c6195 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit b26c6ec671ec63cce1f86c70e928673ed2c82f82"
bgruening
parents: 1
diff changeset
36
9958188c6195 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit b26c6ec671ec63cce1f86c70e928673ed2c82f82"
bgruening
parents: 1
diff changeset
37 for col_name in col_dimensions:
9958188c6195 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit b26c6ec671ec63cce1f86c70e928673ed2c82f82"
bgruening
parents: 1
diff changeset
38 values = df[col_name]
1
7b21a9b5922f planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit 7ba5d8f0e920dccbc82588e4f4a7b9039dc3ea36
bgruening
parents: 0
diff changeset
39 if categorized == 'boolfalse' and all(type(e) is int for e in values ):
0
7b2455348edf planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit 93fcfe0fa6a64246d13e0fb7e35a357985b02465
bgruening
parents:
diff changeset
40 dimensions.append(
7b2455348edf planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit 93fcfe0fa6a64246d13e0fb7e35a357985b02465
bgruening
parents:
diff changeset
41 dict( values = values,
7b2455348edf planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit 93fcfe0fa6a64246d13e0fb7e35a357985b02465
bgruening
parents:
diff changeset
42 tickformat = ",.2r",
2
9958188c6195 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit b26c6ec671ec63cce1f86c70e928673ed2c82f82"
bgruening
parents: 1
diff changeset
43 label = col_name)
0
7b2455348edf planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit 93fcfe0fa6a64246d13e0fb7e35a357985b02465
bgruening
parents:
diff changeset
44 )
1
7b21a9b5922f planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit 7ba5d8f0e920dccbc82588e4f4a7b9039dc3ea36
bgruening
parents: 0
diff changeset
45 elif categorized == 'boolfalse' and all(type(e) is float for e in values ):
0
7b2455348edf planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit 93fcfe0fa6a64246d13e0fb7e35a357985b02465
bgruening
parents:
diff changeset
46 dimensions.append(
7b2455348edf planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit 93fcfe0fa6a64246d13e0fb7e35a357985b02465
bgruening
parents:
diff changeset
47 dict( values = values,
7b2455348edf planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit 93fcfe0fa6a64246d13e0fb7e35a357985b02465
bgruening
parents:
diff changeset
48 tickformat = "g",
2
9958188c6195 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit b26c6ec671ec63cce1f86c70e928673ed2c82f82"
bgruening
parents: 1
diff changeset
49 label = col_name)
0
7b2455348edf planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit 93fcfe0fa6a64246d13e0fb7e35a357985b02465
bgruening
parents:
diff changeset
50 )
7b2455348edf planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit 93fcfe0fa6a64246d13e0fb7e35a357985b02465
bgruening
parents:
diff changeset
51 else:
7b2455348edf planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit 93fcfe0fa6a64246d13e0fb7e35a357985b02465
bgruening
parents:
diff changeset
52 unique_values = list(set(values))
1
7b21a9b5922f planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit 7ba5d8f0e920dccbc82588e4f4a7b9039dc3ea36
bgruening
parents: 0
diff changeset
53 unique_values.sort()
2
9958188c6195 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit b26c6ec671ec63cce1f86c70e928673ed2c82f82"
bgruening
parents: 1
diff changeset
54 # cast to str, fix object indexing
9958188c6195 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit b26c6ec671ec63cce1f86c70e928673ed2c82f82"
bgruening
parents: 1
diff changeset
55 unique_values = [repr(e) for e in unique_values]
0
7b2455348edf planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit 93fcfe0fa6a64246d13e0fb7e35a357985b02465
bgruening
parents:
diff changeset
56 dimensions.append(
7b2455348edf planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit 93fcfe0fa6a64246d13e0fb7e35a357985b02465
bgruening
parents:
diff changeset
57 dict( range = [0, len(unique_values)-1],
7b2455348edf planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit 93fcfe0fa6a64246d13e0fb7e35a357985b02465
bgruening
parents:
diff changeset
58 tickvals = list(range(len(unique_values))),
2
9958188c6195 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit b26c6ec671ec63cce1f86c70e928673ed2c82f82"
bgruening
parents: 1
diff changeset
59 ticktext = unique_values,
9958188c6195 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit b26c6ec671ec63cce1f86c70e928673ed2c82f82"
bgruening
parents: 1
diff changeset
60 values = list(map(lambda e: unique_values.index(repr(e)), values )),
9958188c6195 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit b26c6ec671ec63cce1f86c70e928673ed2c82f82"
bgruening
parents: 1
diff changeset
61 label = col_name)
0
7b2455348edf planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit 93fcfe0fa6a64246d13e0fb7e35a357985b02465
bgruening
parents:
diff changeset
62 )
7b2455348edf planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit 93fcfe0fa6a64246d13e0fb7e35a357985b02465
bgruening
parents:
diff changeset
63
7b2455348edf planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit 93fcfe0fa6a64246d13e0fb7e35a357985b02465
bgruening
parents:
diff changeset
64 col_color = int(col_color) - 1
7b2455348edf planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit 93fcfe0fa6a64246d13e0fb7e35a357985b02465
bgruening
parents:
diff changeset
65 colors = df[df.columns[col_color]]
7b2455348edf planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit 93fcfe0fa6a64246d13e0fb7e35a357985b02465
bgruening
parents:
diff changeset
66 if all(type(e) is int for e in colors ):
7b2455348edf planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit 93fcfe0fa6a64246d13e0fb7e35a357985b02465
bgruening
parents:
diff changeset
67 tickformat = ",.2r"
7b2455348edf planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit 93fcfe0fa6a64246d13e0fb7e35a357985b02465
bgruening
parents:
diff changeset
68 elif all(type(e) is float for e in colors ):
7b2455348edf planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit 93fcfe0fa6a64246d13e0fb7e35a357985b02465
bgruening
parents:
diff changeset
69 tickformat = "g"
7b2455348edf planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit 93fcfe0fa6a64246d13e0fb7e35a357985b02465
bgruening
parents:
diff changeset
70 else:
7b2455348edf planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit 93fcfe0fa6a64246d13e0fb7e35a357985b02465
bgruening
parents:
diff changeset
71 sys.exit("Error: the column for coloring must contain all numerical values!")
7b2455348edf planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit 93fcfe0fa6a64246d13e0fb7e35a357985b02465
bgruening
parents:
diff changeset
72
7b2455348edf planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit 93fcfe0fa6a64246d13e0fb7e35a357985b02465
bgruening
parents:
diff changeset
73 dimensions.append(
7b2455348edf planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit 93fcfe0fa6a64246d13e0fb7e35a357985b02465
bgruening
parents:
diff changeset
74 dict(
7b2455348edf planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit 93fcfe0fa6a64246d13e0fb7e35a357985b02465
bgruening
parents:
diff changeset
75 values = colors,
7b2455348edf planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit 93fcfe0fa6a64246d13e0fb7e35a357985b02465
bgruening
parents:
diff changeset
76 tickformat = tickformat,
7b2455348edf planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit 93fcfe0fa6a64246d13e0fb7e35a357985b02465
bgruening
parents:
diff changeset
77 label = df.columns[col_color]
7b2455348edf planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit 93fcfe0fa6a64246d13e0fb7e35a357985b02465
bgruening
parents:
diff changeset
78 )
7b2455348edf planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit 93fcfe0fa6a64246d13e0fb7e35a357985b02465
bgruening
parents:
diff changeset
79 )
7b2455348edf planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit 93fcfe0fa6a64246d13e0fb7e35a357985b02465
bgruening
parents:
diff changeset
80
7b2455348edf planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit 93fcfe0fa6a64246d13e0fb7e35a357985b02465
bgruening
parents:
diff changeset
81 line = dict(
7b2455348edf planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit 93fcfe0fa6a64246d13e0fb7e35a357985b02465
bgruening
parents:
diff changeset
82 color = colors,
7b2455348edf planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit 93fcfe0fa6a64246d13e0fb7e35a357985b02465
bgruening
parents:
diff changeset
83 colorscale = 'Jet',
7b2455348edf planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit 93fcfe0fa6a64246d13e0fb7e35a357985b02465
bgruening
parents:
diff changeset
84 showscale = True,
7b2455348edf planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit 93fcfe0fa6a64246d13e0fb7e35a357985b02465
bgruening
parents:
diff changeset
85 reversescale = True
7b2455348edf planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit 93fcfe0fa6a64246d13e0fb7e35a357985b02465
bgruening
parents:
diff changeset
86 )
7b2455348edf planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit 93fcfe0fa6a64246d13e0fb7e35a357985b02465
bgruening
parents:
diff changeset
87
7b2455348edf planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit 93fcfe0fa6a64246d13e0fb7e35a357985b02465
bgruening
parents:
diff changeset
88 data = [
7b2455348edf planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit 93fcfe0fa6a64246d13e0fb7e35a357985b02465
bgruening
parents:
diff changeset
89 go.Parcoords(
7b2455348edf planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit 93fcfe0fa6a64246d13e0fb7e35a357985b02465
bgruening
parents:
diff changeset
90 line = line,
7b2455348edf planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit 93fcfe0fa6a64246d13e0fb7e35a357985b02465
bgruening
parents:
diff changeset
91 dimensions = dimensions
7b2455348edf planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit 93fcfe0fa6a64246d13e0fb7e35a357985b02465
bgruening
parents:
diff changeset
92 )
7b2455348edf planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit 93fcfe0fa6a64246d13e0fb7e35a357985b02465
bgruening
parents:
diff changeset
93 ]
7b2455348edf planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit 93fcfe0fa6a64246d13e0fb7e35a357985b02465
bgruening
parents:
diff changeset
94
7b2455348edf planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit 93fcfe0fa6a64246d13e0fb7e35a357985b02465
bgruening
parents:
diff changeset
95 plotly.offline.plot(data, filename = "output.html", auto_open=False)
7b2455348edf planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit 93fcfe0fa6a64246d13e0fb7e35a357985b02465
bgruening
parents:
diff changeset
96
7b2455348edf planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit 93fcfe0fa6a64246d13e0fb7e35a357985b02465
bgruening
parents:
diff changeset
97 if __name__ == "__main__":
7b2455348edf planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit 93fcfe0fa6a64246d13e0fb7e35a357985b02465
bgruening
parents:
diff changeset
98 aparser = argparse.ArgumentParser()
7b2455348edf planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit 93fcfe0fa6a64246d13e0fb7e35a357985b02465
bgruening
parents:
diff changeset
99 aparser.add_argument( "-i", "--input", dest="infile", required=True)
7b2455348edf planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit 93fcfe0fa6a64246d13e0fb7e35a357985b02465
bgruening
parents:
diff changeset
100 aparser.add_argument( "-d", "--col_dimensions", dest="col_dimensions")
1
7b21a9b5922f planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit 7ba5d8f0e920dccbc82588e4f4a7b9039dc3ea36
bgruening
parents: 0
diff changeset
101 aparser.add_argument( "-t", "--categorized_datatype", dest="categorized")
0
7b2455348edf planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit 93fcfe0fa6a64246d13e0fb7e35a357985b02465
bgruening
parents:
diff changeset
102 aparser.add_argument( "-c", "--col_color", dest="col_color")
2
9958188c6195 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit b26c6ec671ec63cce1f86c70e928673ed2c82f82"
bgruening
parents: 1
diff changeset
103 aparser.add_argument( "-m", "--dimension_mode", dest="dimension_mode")
0
7b2455348edf planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit 93fcfe0fa6a64246d13e0fb7e35a357985b02465
bgruening
parents:
diff changeset
104 args = aparser.parse_args()
7b2455348edf planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit 93fcfe0fa6a64246d13e0fb7e35a357985b02465
bgruening
parents:
diff changeset
105
2
9958188c6195 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit b26c6ec671ec63cce1f86c70e928673ed2c82f82"
bgruening
parents: 1
diff changeset
106 main(args.infile, args.col_dimensions, args.categorized, args.col_color,
9958188c6195 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_parallel_coordinates_plot commit b26c6ec671ec63cce1f86c70e928673ed2c82f82"
bgruening
parents: 1
diff changeset
107 args.dimension_mode)