Issue with LEfSe Analysis in QIIME2 – IndexError

Hello,

I am new to QIIME2 and encountering an issue while performing LEfSe analysis. I ran the lefse_format_input.py script but received the following error message:

Traceback (most recent call last):
File "/home/cbbc/miniconda3/bin/lefse_format_input.py", line 10, in
sys.exit(format_input())
File "/home/cbbc/miniconda3/lib/python3.12/site-packages/lefse/lefse_format_input.py", line 437, in format_input
class_sl, subclass_sl, class_hierarchy = get_class_slices(list(zip(cls['class'], cls['subclass'], cls['subject'])))
File "/home/cbbc/miniconda3/lib/python3.12/site-packages/lefse/lefse_format_input.py", line 163, in get_class_slices
previous_class = data[0][0]
IndexError: list index out of range

Could you please help me identify the issue and suggest a solution? Thank you

It appears that you are trying to run dokdo tools. Assuming you installed like so:

conda activate qiime2-amplicon-2024.10
pip install git+https://github.com/sbslee/dokdo

You can then run dokdo cli tools as outlined here.

Basically, you'd run the following command (while in your qiime 2 environment) to read the help text:

dokdo prepare-lefse -h

-Cheers!

1 Like