Mercurial > repos > proteore > proteore_venn_diagram
comparison venn_diagram.py @ 6:95bbe3a6b09f draft
"planemo upload commit d78a9195d250f3d873f3c4ab67d1fa3ae58926f5-dirty"
| author | proteore |
|---|---|
| date | Fri, 10 Jan 2020 08:18:06 +0000 |
| parents | c3bbc688dde2 |
| children | 087011d9e3aa |
comparison
equal
deleted
inserted
replaced
| 5:5f8462a9de89 | 6:95bbe3a6b09f |
|---|---|
| 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: |
