Skip to content

Commit

Permalink
Making kreport2krona.py compatible with krakenuniq output files
Browse files Browse the repository at this point in the history
  • Loading branch information
Jennifer Lu committed Nov 16, 2023
1 parent 68b2f75 commit d4a2fbe
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion kreport2krona.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,19 @@ def process_kraken_report(curr_str):
return []
all_reads = int(split_str[1])
lvl_reads = int(split_str[2])
level_type = split_str[-3]

try:
taxid = int(split_str[-3])
level_type = split_str[-2]
map_kuniq = {'species':'S', 'genus':'G', 'family':'F',
'order':'O','class':'C','phylum':'P','superkingdom':'D',
'kingdom':'K'}
if level_type not in map_kuniq:
level_type = '-'
else:
level_type = map_kuniq[level_type]
except ValueError:
level_type = split_str[-3]
type2main = {'superkingdom':'D','phylum':'P',
'class':'C','order':'O','family':'F',
'genus':'G','species':'S'}
Expand Down

0 comments on commit d4a2fbe

Please sign in to comment.