Skip to content

Commit 8c55b76

Browse files
author
Mark Fiers
committed
minor fixes
1 parent 40dd823 commit 8c55b76

File tree

3 files changed

+33
-21
lines changed

3 files changed

+33
-21
lines changed

hagfish_blockcompplot

+6-13
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ parser.remove_option('-Y')
2525
parser.remove_option('--ymax')
2626
parser.remove_option('-Q')
2727

28+
29+
parser.add_option('-L', dest='library2', action='append',
30+
help='Library to compare to')
31+
2832
options, args = parser.parse_args()
2933

3034
options.ymax = 2
@@ -36,21 +40,10 @@ l.info("starting %s" % sys.argv[0])
3640

3741
seqId = args[0]
3842

39-
indir1 = args[1]
40-
indir2 = args[2]
41-
42-
infile1 = os.path.join(
43-
indir1, 'combined',
44-
'%s.combined.coverage.npz' % seqId)
45-
l.info("input file 1: %s" % infile1)
46-
infile2 = os.path.join(
47-
indir2, 'combined',
48-
'%s.combined.coverage.npz' % seqId)
49-
l.info("input file 2: %s" % infile2)
5043

5144
#load the coverage plots
52-
data = hagfishData(options, args, inputFile = infile1)
53-
data2 = hagfishData(options, args, inputFile = infile2)
45+
data = hagfishData(options, args)
46+
data2 = hagfishData(options, args, libraries=options.library2)
5447

5548
#prepare the plot
5649
plot = hagfishPlot(options, data, data2=data2)

hagfish_blockcompplot2

+20-1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ seqId = args[0]
4343
data = hagfishData(options, args)
4444
data2 = hagfishData(options, args, libraries=options.library2)
4545

46+
title1 = "_".join(options.library)
47+
title2 = "_".join(options.library2)
48+
4649
#prepare the plot
4750
plot = hagfishPlot(options, data, data2=data2, tag='blockcomp')
4851

@@ -78,6 +81,22 @@ class plotter(hagfishPlotBand):
7881
extent=[0 , len(self.locx),
7982
self.bandBottom + spacer, self.bandTop]
8083
)
84+
85+
86+
if self.__dict__.has_key('nns'):
87+
self.l.info("plotting N band")
88+
self.l.info("maxY %s" % self.plot.maxY)
89+
self.l.info("max min nns %s %s " % (np.max(self.nns), np.min(self.nns)))
90+
self.l.info("bandbot, bandtop %s %s " % (self.bandBottom, self.bandTop))
91+
92+
93+
self.ax.fill_between(
94+
self.locx,
95+
yc + (self.plot.maxY * self.nns * 0.25),
96+
yc - (self.plot.maxY * self.nns * 0.25),
97+
linewidth=0, zorder=220,
98+
color=COLLIGHTYELLOW)
99+
81100

82101
def setYticks2(self):
83102
pass
@@ -94,6 +113,6 @@ cb.set_ticklabels(['resembles "%s"' % ", ".join(options.library) ,
94113
'resembles "%s"' % ", ".join(options.library2)])
95114
# 0, -1],
96115
#3 aspect=80,
97-
plot.save()
116+
plot.save(libname='%s.%s' % (title1,title2))
98117

99118

hagfish_compplot2

+7-7
Original file line numberDiff line numberDiff line change
@@ -173,22 +173,22 @@ class plotter(hagfishPlotBand):
173173

174174

175175
def setYticks2(self):
176-
self.plot.yTicks2.append(self.yCorrection - self.data.medianH)
176+
self.plot.yTicks2.append(self.yCorrection - self.data.median)
177177
self.plot.yTicks2.append(self.yCorrection)
178-
self.plot.yTicks2.append(self.yCorrection + self.data.medianH)
179-
self.plot.yTickLabels2.append("%s" % -self.data.medianH)
178+
self.plot.yTicks2.append(self.yCorrection + self.data.median)
179+
self.plot.yTickLabels2.append("%s" % -self.data.median)
180180
self.plot.yTickLabels2.append("0")
181-
self.plot.yTickLabels2.append("%s" % self.data.medianH)
181+
self.plot.yTickLabels2.append("%s" % self.data.median)
182182
self.ax.axhline(
183-
self.yCorrection - self.data.medianH,
183+
self.yCorrection - self.data.median,
184184
alpha=0.3,
185185
color='black')
186186
self.ax.axhline(
187-
self.yCorrection + self.data.medianH,
187+
self.yCorrection + self.data.median,
188188
alpha=0.3,
189189
color='black')
190190

191191
plot.plotBands(plotter)
192-
plot.save(tag='%s.%s.comp' % (title1,title2))
192+
plot.save(tag='%s.%s.compplot2' % (title1,title2))
193193

194194

0 commit comments

Comments
 (0)