comparison unified-histogram.py @ 3:b56f47c58779 draft

planemo upload for repository https://github.com/TAMU-CPT/galaxy-circos-tool commit 4503a4ca99e65aa821e2c953f2f18eaadeed170a
author eric-rasche
date Wed, 01 Mar 2017 23:56:56 -0500
parents e8475d0195fe
children 4ff5ff4c84fa
comparison
equal deleted inserted replaced
2:dc4c9490fac8 3:b56f47c58779
113 region_end = position 113 region_end = position
114 else: 114 else:
115 if MODE == 'histogram': 115 if MODE == 'histogram':
116 # histogram 116 # histogram
117 # hs4 0 1999999 5.0000,3.0000,1.0000,19.0000 117 # hs4 0 1999999 5.0000,3.0000,1.0000,19.0000
118 print genome, region_start, region_end, ','.join(values) 118 sys.stdout.write(' '.join(
119 (genome, region_start, region_end, ','.join(values))
120 ) + '\n')
119 elif MODE == 'heatmap': 121 elif MODE == 'heatmap':
120 # heatmap 122 # heatmap
121 # hs1 2000000 3999999 0.0000 id=hs4 123 # hs1 2000000 3999999 0.0000 id=hs4
122 # hs1 4000000 5999999 2.0000 id=hs1 124 # hs1 4000000 5999999 2.0000 id=hs1
123 # hs1 4000000 5999999 0.0000 id=hs2 125 # hs1 4000000 5999999 0.0000 id=hs2
124 # hs1 4000000 5999999 0.0000 id=hs3 126 # hs1 4000000 5999999 0.0000 id=hs3
125 # hs1 4000000 5999999 0.0000 id=hs4 127 # hs1 4000000 5999999 0.0000 id=hs4
126 # hs1 6000000 7999999 4.0000 id=hs2 128 # hs1 6000000 7999999 4.0000 id=hs2
127 for x in max_idx: 129 for x in max_idx:
128 if x in data[genome][position]: 130 if x in data[genome][position]:
129 print genome, region_start, region_end, data[genome][position][x], 'id=hm%s' % x 131 sys.stdout.write(' '.join(
132 (genome, region_start, region_end, data[genome][position][x], 'id=hm%s' % x)
133 ) + '\n')
130 else: 134 else:
131 print genome, region_start, region_end, 0.0, 'id=hm%s' % x 135 sys.stdout.write(' '.join(
136 (genome, region_start, region_end, 0.0, 'id=hm%s' % x)
137 ) + '\n')
132 elif MODE == 'line': 138 elif MODE == 'line':
133 # multiple=False 139 # multiple=False
134 print genome, region_start, region_end, data[genome][position][0] 140 sys.stdout.write(' '.join(
141 (genome, region_start, region_end, data[genome][position][0])
142 ) + '\n')
135 elif MODE == 'scatter': 143 elif MODE == 'scatter':
136 # multiple=False 144 # multiple=False
137 print genome, region_start, region_end, data[genome][position][0] 145 sys.stdout.write(' '.join(
146 (genome, region_start, region_end, data[genome][position][0])
147 ) + '\n')
138 148
139 # Update start of next array 149 # Update start of next array
140 region_start = position 150 region_start = position
141 region_end = position 151 region_end = position
142 # And update with new array 152 # And update with new array