comparison venn_diagram.py @ 10:e744a43171ff draft

"planemo upload commit 6bef056b0e52bfa39dbe8591bfe67f8c95bf3ba2-dirty"
author proteore
date Tue, 14 Jan 2020 09:14:27 -0500
parents bca31ac678f1
children 958eb2ea02aa
comparison
equal deleted inserted replaced
9:72295909dccf 10:e744a43171ff
128 keys= list(key) 128 keys= list(key)
129 column_dict[key] = "_".join([list_names[k] for k in keys]) 129 column_dict[key] = "_".join([list_names[k] for k in keys])
130 130
131 #construct tsv 131 #construct tsv
132 for key in result : 132 for key in result :
133 line = [column_dict[key]] 133 line = result[key]
134 line.extend(result[key])
135 if len(line) < nb_lines_max : 134 if len(line) < nb_lines_max :
136 line.extend(['NA']*(nb_lines_max-len(line))) 135 line.extend(['NA']*(nb_lines_max-len(line)))
136 line = [column_dict[key]] + line #add header
137 lines.append(line) 137 lines.append(line)
138 #transpose tsv 138 #transpose tsv
139 lines=zip(*lines) 139 lines=zip(*lines)
140 140
141 with open("venn_diagram_text_output.tsv", "w") as output: 141 with open("venn_diagram_text_output.tsv", "w") as output: