Skip to content

Commit

Permalink
fixed lshbuilder and flags
Browse files Browse the repository at this point in the history
  • Loading branch information
cactuskid committed Nov 7, 2023
1 parent a6f4536 commit 929bbb7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/HogProf/lshbuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ def main():
parser.add_argument('--outfolder', help='folder for storing hash, db and tree objects' , type = str)
parser.add_argument('--lossonly', help='only compile loss events' , type = bool)
parser.add_argument('--duplonly', help='only compile duplication events' , type = bool)
parser.add_argument('--taxcodes', help='use taxid info in HOGs' , type = bool)
parser.add_argument('--taxcodes', help='use taxid info in HOGs' , type = str)
parser.add_argument('--verbose', help='print verbose output' , type = bool)
dbdict = {
'all': { 'taxfilter': None , 'taxmask': None },
Expand Down Expand Up @@ -475,10 +475,8 @@ def main():
duplonly = args['duplonly']
else:
duplonly = False



if args['taxcodes'] == 'True':

if args['taxcodes']=='True':
taxcodes = True
else:
taxcodes = False
Expand Down
Binary file modified src/HogProf/utils/__pycache__/pyhamutils.cpython-310.pyc
Binary file not shown.
4 changes: 4 additions & 0 deletions src/HogProf/utils/pyhamutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def switch_name_ncbi_id(orthoxml , mapdict = None ):

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 ):
fam, orthoxml = row
if orthoxml:
Expand All @@ -43,11 +44,14 @@ def get_ham_treemap_from_row(row, tree , level = None , swap_ids = True , orthoX
else:
quoted = True
ham_obj = pyham.Ham(tree, orthoxml, type_hog_file="orthoxml" , tree_format = 'newick_string' ,use_internal_name=True, orthoXML_as_string=orthoXML_as_string )

tp = ham_obj.create_tree_profile(hog=ham_obj.get_list_top_level_hogs()[0])
return tp.treemap
except:
print('error' , traceback.format_exc())
return None


def yield_families(h5file, start_fam):
"""
Given a h5file containing OMA server, returns an iterator over the families
Expand Down

0 comments on commit 929bbb7

Please sign in to comment.