comparison process-cytogenetic-bands.py @ 13:c4bde687c846 draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/circos commit 0cfd88d16b0b20a66d4b21b037ddee6a8c440d88
author iuc
date Wed, 12 Apr 2023 15:09:05 +0000
parents 014a21767ac4
children
comparison
equal deleted inserted replaced
12:290a11559985 13:c4bde687c846
27 with open(sys.argv[1], "r") as handle: 27 with open(sys.argv[1], "r") as handle:
28 for line in handle: 28 for line in handle:
29 if line.startswith("#"): 29 if line.startswith("#"):
30 continue 30 continue
31 31
32 lineData = dict(zip(COLS, line.split())) 32 lineData = dict(list(zip(COLS, line.split())))
33 color = lineData.get("itemRgb", "gpos50") 33 color = lineData.get("itemRgb", "gpos50")
34 34
35 if color not in colormap: 35 if color not in colormap:
36 # Color MUST be an RGB triplet 36 # Color MUST be an RGB triplet
37 if color.count(",") != 2: 37 if color.count(",") != 2:
45 int(tmp) 45 int(tmp)
46 except ValueError: 46 except ValueError:
47 # Does not look like an int 47 # Does not look like an int
48 continue 48 continue
49 49
50 colormap[color] = "gx-karyotype-%s" % len(colormap.keys()) 50 colormap[color] = "gx-karyotype-%s" % len(list(colormap.keys()))
51 51
52 sys.stderr.write( 52 sys.stderr.write(
53 "{colorName} = {color}\n".format(colorName=colormap[color], color=color) 53 "{colorName} = {color}\n".format(colorName=colormap[color], color=color)
54 ) 54 )
55 55