diff --git a/src/HogProf/lshbuilder.py b/src/HogProf/lshbuilder.py index 018b7a9..b2bf36c 100755 --- a/src/HogProf/lshbuilder.py +++ b/src/HogProf/lshbuilder.py @@ -172,8 +172,7 @@ def __init__(self,h5_oma=None,fileglob = None, taxa=None,masterTree=None, saving else: self.HAM_PIPELINE = functools.partial( pyhamutils.get_ham_treemap_from_row, tree=self.tree_string , swap_ids=self.swap2taxcode , orthoXML_as_string = False , reformat_names = self.reformat_names , use_phyloxml = self.use_phyloxml , orthomapper = self.idmapper ) - - + self.HASH_PIPELINE = functools.partial( hashutils.row2hash , taxaIndex=self.taxaIndex, treeweights=self.treeweights, wmg=wmg , lossonly = lossonly, duplonly = duplonly) if self.h5OMA: @@ -323,7 +322,7 @@ def saver(self, i, q, retq, matq, l ): h5hashes[taxstr][fam, :] = hashes[fam].hashvalues.ravel() count += 1 if self.fileglob: - if not savedf: + if savedf is not None: savedf = this_dataframe[['Fam', 'ortho']] else: savedf = savedf.append(this_dataframe[['Fam', 'ortho']]) @@ -343,9 +342,6 @@ def saver(self, i, q, retq, matq, l ): print(savedf) savedf.to_csv(self.saving_path + 'fam2orthoxml.csv') save_start = t.time() - - - else: print(this_dataframe) else: diff --git a/src/HogProf/utils/pyhamutils.py b/src/HogProf/utils/pyhamutils.py index 95ce286..8ced44a 100755 --- a/src/HogProf/utils/pyhamutils.py +++ b/src/HogProf/utils/pyhamutils.py @@ -83,7 +83,9 @@ def orthoxml2numerical(orthoxml , mapper): orthoxml = ET.tostring(root, encoding='unicode', method='xml') return orthoxml -def get_ham_treemap_from_row(row, tree , level = None , swap_ids = True , orthoXML_as_string = True , use_phyloxml = False , use_internal_name = True ,reformat_names= False, orthomapper = None ): + + +def get_ham_treemap_from_row(row, tree , level = None , swap_ids = True , orthoXML_as_string = True , use_phyloxml = False , use_internal_name = True ,reformat_names= False, orthomapper = None ): fam, orthoxml = row format = 'newick_string' if use_phyloxml: