comparison bigwig_outlier_bed.py @ 8:032e930ef6a1 draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/bigwig_outlier_bed commit 7eac2f224d3126002edd2c02d1133b23ac1a4881
author fubar
date Wed, 24 Jul 2024 09:19:08 +0000
parents c8e22efcaeda
children
comparison
equal deleted inserted replaced
7:c8e22efcaeda 8:032e930ef6a1
212 else: 212 else:
213 last10 = range(nvalues-10, nvalues) 213 last10 = range(nvalues-10, nvalues)
214 first_few = ['%.2f\t%d' % (values[x],counts[x]) for x in range(10)] 214 first_few = ['%.2f\t%d' % (values[x],counts[x]) for x in range(10)]
215 first_few += ['%.2f\t%d' % (values[x],counts[x]) for x in last10] 215 first_few += ['%.2f\t%d' % (values[x],counts[x]) for x in last10]
216 first_few.insert(0,'First/Last 10 value counts\nValue\tCount') 216 first_few.insert(0,'First/Last 10 value counts\nValue\tCount')
217 ha = asciihist(data=bw, bins=20, str_tag=chr) 217 ha = asciihist(data=bw, bins=20, str_tag='%s_%s' % (bwlabel,chr))
218 histo = ha.draw() 218 histo = ha.draw()
219 histo = '\n'.join(first_few) + '\nHistogram of bigwig values\n' + histo 219 histo = '\n'.join(first_few) + '\nHistogram of %s bigwig values\n' % bwlabel + histo
220 bw = bw[~np.isnan(bw)] # some have NaN if parts of a contig not covered 220 bw = bw[~np.isnan(bw)] # some have NaN if parts of a contig not covered
221 if self.qhi is not None: 221 if self.qhi is not None:
222 self.bwtop = np.quantile(bw, self.qhi) 222 self.bwtop = np.quantile(bw, self.qhi)
223 bwhi = self.processVals(bw, isTop=True) 223 bwhi = self.processVals(bw, isTop=True)
224 for j, seg in enumerate(bwhi): 224 for j, seg in enumerate(bwhi):