Skip to content

Commit 8e541e2

Browse files
Dom LaetschDom Laetsch
Dom Laetsch
authored and
Dom Laetsch
committed
Multiplot fix
1 parent 34c5a71 commit 8e541e2

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

blobtools

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ from docopt import docopt
2424
if __name__ == '__main__':
2525
main_dir = join(dirname(__file__), '')
2626
args = docopt(__doc__,
27-
version='version 0.9.4',
27+
version='version 0.9.6',
2828
options_first=True)
2929
#print(args)
3030

lib/BtCore.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,8 @@ def getPlotData(self, rank, min_length, hide_nohits, taxrule, c_index, catcolour
147147
'span_visible' : 0,
148148
}
149149
if len(cov_libs) > 1:
150-
data_dict[group]['covs']['sum'] = []
151-
data_dict[group]['reads_mapped']['sum'] = 0
150+
data_dict[group]['covs']['cov_sum'] = []
151+
data_dict[group]['reads_mapped']['cov_sum'] = 0
152152

153153
if ((hide_nohits) and group == 'no-hit') or length < min_length: # hidden
154154
data_dict[group]['count_hidden'] = data_dict[group].get('count_hidden', 0) + 1
@@ -177,15 +177,20 @@ def getPlotData(self, rank, min_length, hide_nohits, taxrule, c_index, catcolour
177177

178178
if len(cov_libs) > 1:
179179
cov_sum = cov_sum if cov_sum > 0.02 else 0.02
180-
data_dict[group]['covs']['sum'].append(cov_sum)
180+
data_dict[group]['covs']['cov_sum'].append(cov_sum)
181181
if cov > max_cov:
182182
max_cov = cov
183183
if (reads_mapped_sum):
184-
data_dict[group]['reads_mapped']['sum'] += reads_mapped_sum
184+
data_dict[group]['reads_mapped']['cov_sum'] += reads_mapped_sum
185185

186186
data_dict[group]['count'] = data_dict[group].get('count', 0) + 1
187187
data_dict[group]['span'] = data_dict[group].get('span', 0) + int(length)
188188

189+
if len(cov_libs) > 1:
190+
cov_libs.append('cov_sum')
191+
for cov_lib, data in self.covLibs.items():
192+
cov_libs_reads_total['cov_sum'] = cov_libs_reads_total.get('cov_sum', 0) + data['reads_total']
193+
189194
return data_dict, max_cov, cov_libs, cov_libs_reads_total
190195

191196
def addCovLib(self, covLib):

lib/BtPlot.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,6 @@ def write_stats(self):
225225

226226
def compute_stats(self):
227227
stats = {}
228-
229228
for label in self.labels:
230229
stats[label] = {
231230
'gc' : [],

0 commit comments

Comments
 (0)