How to use LEfSe locally with conda?

I would like to run lefse locally with conda. I have followed the tutorial, but when I run this line from the tutorial example,
$ lefse_format_input.py hmp_aerobiosis_small.txt hmp_aerobiosis_small.in -c 1 -s 2 -u 3 -o 1000000
only a txt file opens with the following:

#!/bin/sh
'''exec' C:/Users/Peter/anaconda3/envs/biobakery_env/bin/python "$0" "$@"
' '''
# -*- coding: utf-8 -*-
import re
import sys
from lefse.lefse_format_input import format_input
if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
    sys.exit(format_input())

What could be the problem? I couldn’t find any topic with a similar issue on the forum. I am working on windows with python 3.10.6.

Hi there,
Sorry to hear you’ve been having issues–this made me realize we need to update our tutorial text re: installation, since currently the most updated version of LEfSe is found on PyPi, not conda or docker: lefse · PyPI
Try installing from there and running the tutorial again, and let me know if you’re still seeing issues after that.
Thanks,
Meg

1 Like

Getting the same error as this post. Is there a workaround for this?

Shwetha

I didn’t have this specific issue, but maybe referring to these steps might help?

Thank you, I followed the steps but this is a new error. I am following the tutorial lefse · biobakery/biobakery Wiki · GitHub

(lefse) C:\Users\shwet\Desktop\BCM_Projects\CRC_integromics\Analysis\Data\Deblur\99_other\lefse>lefse_format_input.py hmp_aerobiosis_small.txt hmp_aerobiosis_small.in -c 1 -s 2 -u 3 -o 1000000
usage: lefse_format_input.py [-h] [–output_table OUTPUT_TABLE] [-f {c,r}] [-c [1…n_feats]] [-s [1…n_feats]]
[-o float] [-u [1…n_feats]] [-m {f,s}] [-n int] [-biom_c BIOM_CLASS]
[-biom_s BIOM_SUBCLASS]
INPUT_FILE OUTPUT_FILE
lefse_format_input.py: error: the following arguments are required: INPUT_FILE, OUTPUT_FILE

Unfortunately, I am not sure how to help with this error. Sorry. I do hope you find a solution.

Hi @Shwetha_Kumar,

I’m not exactly sure what is going wrong with this. Can you give me some additional information? Can you send me the LEfSe version that you are working with and the code you ran instead of the error? The error itself looks like LEfSe doesn’t know or can’t find your input file and output location - but that can be a general error as well.

Best,
Kelsey