@@ -57,7 +57,9 @@ def view(self, **kwargs):
57
57
tax_lib_names = [taxLib for taxLib in sorted (self .hitLibs )]
58
58
lineages = self .lineages
59
59
# setup
60
+
60
61
for viewObj in viewObjs :
62
+ #print("in view:", viewObj.name)
61
63
if viewObj .name == 'table' :
62
64
viewObj .header = self .getTableHeader (taxrule , ranks , hits_flag , cov_lib_names )
63
65
if viewObj .name == 'concoct_cov' :
@@ -100,6 +102,7 @@ def view(self, **kwargs):
100
102
viewObj .body .append (self .getCovLine (blob , cov_lib_names ))
101
103
pbar .update ()
102
104
for viewObj in viewObjs :
105
+ #print(viewObj.name)
103
106
viewObj .output ()
104
107
105
108
def getCovHeader (self , cov_lib_names ):
@@ -763,8 +766,8 @@ def get_meta(self):
763
766
cov_names = filter (lambda name : name != "covsum" ,self .covs )
764
767
for taxrule in self .tax :
765
768
self .tax_scores [taxrule ] = defaultdict (lambda : {'score' :[],'c_index' :[]})
766
- for id in self .blobDb .order_of_blobs :
767
- blob = self .blobDb .dict_of_blobs [id ]
769
+ for _id in self .blobDb .order_of_blobs :
770
+ blob = self .blobDb .dict_of_blobs [_id ]
768
771
self .read_covs ['covsum' ].append (0 )
769
772
for cov_name in cov_names :
770
773
self .read_covs [cov_name ].append (blob ['read_cov' ][cov_name ])
@@ -781,11 +784,11 @@ def get_meta(self):
781
784
cov_libs = []
782
785
for cov_name in self .covs :
783
786
name = self ._remove_cov_suffix (cov_name ,self .blobDb .covLibs )
784
- id = "%s_%s" % (name ,cov )
785
- cov_lib_meta = {"id" :id , "name" :name }
787
+ _id = "%s_%s" % (name ,cov )
788
+ cov_lib_meta = {"id" : _id , "name" :name }
786
789
if cov_name == "cov0" and cov == "cov" :
787
790
cov_lib_meta ["preload" ] = True
788
- meta ['plot' ]['y' ] = id
791
+ meta ['plot' ]['y' ] = _id
789
792
cov_libs .append (cov_lib_meta )
790
793
cov_meta = {"id" :"%s" % cov , "name" :"Coverage" , "type" :"variable" , "datatype" :"float" , "scale" :"scaleLog" , "range" :self ._format_float ([0.02 ,max (self .covs ["covsum" ])])}
791
794
if cov == 'read_cov' :
@@ -799,14 +802,14 @@ def get_meta(self):
799
802
for taxrule in self .tax :
800
803
taxrule_meta = {"id" :taxrule , "name" :taxrule , "children" :[] }
801
804
for rank in self .tax [taxrule ]:
802
- id = "%s_%s" % (taxrule ,rank )
805
+ _id = "%s_%s" % (taxrule ,rank )
803
806
tax_rank_data = []
804
- tax_rank_data .append ({ "id" :"%s_score" % id , "name" :"%s score" % id , "type" :"variable" , "datatype" :"float" , "scale" :"scaleLog" , "range" :[0.2 ,max (self .tax_scores [taxrule ][rank ]['score' ])], "preload" :False , "active" :False })
805
- tax_rank_data .append ({ "id" :"%s_cindex" % id , "name" :"%s c-index" % id , "type" :"variable" , "datatype" :"integer" , "scale" :"scaleLinear" , "range" :[0 ,max (self .tax_scores [taxrule ][rank ]['c_index' ])], "preload" :False , "active" :False })
806
- tax_rank_meta = { "id" :id , "name" :id , "data" : tax_rank_data }
807
+ tax_rank_data .append ({ "id" :"%s_score" % _id , "name" :"%s score" % _id , "type" :"variable" , "datatype" :"float" , "scale" :"scaleLog" , "range" :[0.2 ,max (self .tax_scores [taxrule ][rank ]['score' ])], "preload" :False , "active" :False })
808
+ tax_rank_data .append ({ "id" :"%s_cindex" % _id , "name" :"%s c-index" % _id , "type" :"variable" , "datatype" :"integer" , "scale" :"scaleLinear" , "range" :[0 ,max (self .tax_scores [taxrule ][rank ]['c_index' ])], "preload" :False , "active" :False })
809
+ tax_rank_meta = { "id" :_id , "name" :_id , "data" : tax_rank_data }
807
810
if rank == "phylum" :
808
811
tax_rank_meta ["preload" ] = True
809
- meta ['plot' ]['cat' ] = id
812
+ meta ['plot' ]['cat' ] = _id
810
813
taxrule_meta ['children' ].append (tax_rank_meta )
811
814
tax_rules .append (taxrule_meta )
812
815
tax_meta = {"id" :"taxonomy" , "name" :"Taxonomy" , "type" :"category" , "datatype" :"string" }
@@ -833,7 +836,7 @@ def output(self):
833
836
# meta
834
837
meta = self .get_meta ()
835
838
meta_f = join (self .view_dir , "meta.json" )
836
- BtIO .writeJson (meta , meta_f , indent = 2 )
839
+ BtIO .writeJson (meta , meta_f )
837
840
# gc
838
841
gc_f = join (self .view_dir , "gc.json" )
839
842
print (BtLog .status_d ['13' ] % (gc_f ))
0 commit comments