jenniferlu717/KrakenTools

"other entries", "other sequences" raise AttributeError when using --include-children

yeemey opened this issue · 0 comments

yeemey commented

Hello,
When I run extract_kraken_reads.py with --include-children on a kraken2 report that includes "other entries" and "other sequences," I get the following error:

Traceback (most recent call last):
  File "/bin/KrakenTools/extract_kraken_reads.py", line 447, in <module>
    main()
  File "/bin/KrakenTools/extract_kraken_reads.py", line 237, in main
    while level_num != (prev_node.level_num + 1):
                        ^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'level_num'

I used print(report_vals) here and traced the error to having "other entries" and "other sequences" lines in the report in between other taxonomic groups. When I move both "other entries" and "other sequences" to the end of the report, extract_kraken_reads.py runs to completion without errors. I still have to check however, if I've messed up the read extraction by doing that.