@@ -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 ):
0 commit comments