Skip to content

Commit

Permalink
fixing get_class_slices call depending on the different subclass/subj…
Browse files Browse the repository at this point in the history
…ect provided
  • Loading branch information
fasnicar committed Feb 15, 2022
1 parent 77283af commit f7ea1cd
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lefse/lefse_format_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,13 @@ def format_input():

cls['subclass'] = rename_same_subcl(cls['class'],cls['subclass'])
# if 'subclass' in cls.keys(): cls = group_small_subclasses(cls,params['subcl_min_card'])
class_sl,subclass_sl,class_hierarchy = get_class_slices(list(zip(cls['class'], cls['subclass'], cls['subject'])))

if ('subclass' in cls.keys()) and ('subject' in cls.keys()):
class_sl, subclass_sl, class_hierarchy = get_class_slices(list(zip(cls['class'], cls['subclass'], cls['subject'])))
elif ('subclass' in cls.keys()) and ('subject' not in cls.keys()):
class_sl, subclass_sl, class_hierarchy = get_class_slices(list(zip(cls['class'], cls['subclass'])))
elif ('subclass' not in cls.keys()) and ('subject' in cls.keys()):
class_sl, subclass_sl, class_hierarchy = get_class_slices(list(zip(cls['class'], cls['subject'])))

feats = dict([(d[0],d[1:]) for d in data])

Expand All @@ -461,4 +467,4 @@ def format_input():


if __name__ == '__main__':
format_input()
format_input()

0 comments on commit f7ea1cd

Please sign in to comment.