Re: Errors using conda to install LEfSe

972 views
Skip to first unread message

Jamie FitzG

unread,
Oct 31, 2017, 10:48:11 AM10/31/17
to kyli...@gmail.com, LEfSe-users
Hey Tobi, Kylin,

Short:
 I forked the original run.sh to include changes for running LEfSe through bioconda: try running this link/attached file and see it that helps. 

Long:
   I sadly(?) could not reproduce your error but found an issue. I did the following:
./lefse_test.sh: 17: ./lefse_test.sh: ../format_input.py: not found
./lefse_test.sh: 24: ./lefse_test.sh: ../run_lefse.py: not found
./lefse_test.sh: 30: ./lefse_test.sh: ../plot_res.py: not found
./lefse_test.sh: 39: ./lefse_test.sh: ../plot_cladogram.py: not found
./lefse_test.sh: 49: ./lefse_test.sh: ../plot_features.py: not found

  • this means LEfSe doesn't know how to run from this location as-per the script (probably the script was written before conda setups)
  • check where scripte.g. run_lefse actually is (my typing is in blue):
(lefse) jfg@jfg[lefse-dir] which run_lefse.py
/home/jfg/miniconda3/envs/lefse/bin/run_lefse.py
  • so we check that directory to see if those scripts are present (above we're told they are 'not found')
(lefse) jfg@jfg[lefse_sandbox] ls -l /home/jfg/miniconda3/envs/lefse/bin/
...
... [lots of output!]
...
-rwxr-xr-x 2 eri eri  176155 Jun 13  2016 ksu
-rwxr-xr-x 2 eri eri   18763 Jun 13  2016 kswitch
-rwxr-xr-x 2 eri eri  112222 Jun 13  2016 ktutil
-rwxr-xr-x 2 eri eri   34792 Jun 13  2016 kvno
-rwxrwxr-x 2 eri eri  282408 Jun  7 13:32 lconvert
lrwxrwxrwx 1 eri eri      47 Oct 31 11:41 lefse2circlader.py -> ../share/lefse-1.0.8.post1-0/lefse2circlader.py
lrwxrwxrwx 1 eri eri      44 Oct 31 11:41 lefse-format_input.py -> ../share/lefse-1.0.8.post1-0/format_input.py
lrwxrwxrwx 1 eri eri      46 Oct 31 11:41 lefse-plot_cladogram.py -> ../share/lefse-1.0.8.post1-0/plot_cladogram.py
lrwxrwxrwx 1 eri eri      45 Oct 31 11:41 lefse-plot_features.py -> ../share/lefse-1.0.8.post1-0/plot_features.py
lrwxrwxrwx 1 eri eri      40 Oct 31 11:41 lefse-plot_res.py -> ../share/lefse-1.0.8.post1-0/plot_res.py
-rwxrwxr-x 1 eri eri    2348 Oct 31 11:41 libpng16-config
lrwxrwxrwx 1 eri eri      15 Oct 31 11:41 libpng-config -> libpng16-config
-rwxrwxr-x 2 eri eri 1370920 Jun  7 13:32 linguist
-rwxrwxr-x 2 eri eri  489296 Jun  7 13:32 lrelease
...
... [more output!]
...
lrwxrwxrwx 1 eri eri      41 Oct 31 11:41 run_lefse.py -> ../share/lefse-1.0.8.post1-0/run_lefse.py
...
... [yet more output]
...

  • note how most scripts are there but have their names changed (in bold), probably so that you can tell what program they belong to. Note also, they are not in the expected folder as the one you are doing the example_run.sh in, so the command '../lefse_command.py' (i.e. look in the next folder up for this file) is wrong: it should just read 'lefse_command.py', which tells the computer to look in 'all the usual places you keep scripts' (i.e. the path). You need to change the names of the commands, and where the script says theya re located. 
  • Running the following works for me just fine - note name change and location fix (removal of the '../') : 
(lefse) jfg@jfg[lefse_sandbox] lefse-format_input.py hmp_aerobiosis_small.txt hmp_aerobiosis_small.in -c 1 -s 2 -u 3 -o 1000000



hope this helps
jfg



  -  -  -  -  -
PhD guy, Bioenergy & Biofuels Research Group
412a School of Microbiology
University College Cork
p :: 086 349 1828

On Fri, Oct 27, 2017 at 4:08 PM, <kyli...@gmail.com> wrote:
I'm having the same problem. I created an environment for lefse using conda, and also tried to install r-survival in that environment. But the error is still there.


On Friday, October 27, 2017 at 9:00:02 AM UTC-4, Tobi wrote:
Hi everyone,

i tried to install LEfSe using conda in a completely new conda environment.

conda create -n lefse lefse python=2.7

Using the run.sh script from the Bitbucket Repo I wanted to test the installation. Therefore I changed the script so that the installed commands can be found correctly.

Sadly, running the script gives me the following error:

./run.sh: line 24: 12622 Segmentation fault      (core dumped) run_lefse.py hmp_aerobiosis_small.in hmp_aerobiosis_small.res

I tried installing rpy2 2.4.2 as suggested here using pip since conda does not provide the old version of rpy2. Running the script again now leads to the following error:

Traceback (most recent call last):
  File "/working2/tuem/miniconda3/envs/lefse/bin/run_lefse.py", line 4, in <module>
    from lefse import *
  File "/working2/tuem/miniconda3/envs/lefse/share/lefse-1.0.8.post1-0/lefse.py", line 3, in <module>
    import rpy2.robjects as robjects
  File "/working2/tuem/miniconda3/envs/lefse/lib/python2.7/site-packages/rpy2/robjects/__init__.py", line 15, in <module>
    import rpy2.rinterface as rinterface
  File "/working2/tuem/miniconda3/envs/lefse/lib/python2.7/site-packages/rpy2/rinterface/__init__.py", line 101, in <module>
    from rpy2.rinterface._rinterface import *
ImportError: libicui18n.so.58: cannot open shared object file: No such file or directory

This error seemed to be related to this, so I added a .condarc file with tho following content:

channels:
  - bioconda
  - r
  - conda-forge
  - defaults

Next, I updated the whole environment using
conda update -all and tried running the script again.

Now I get the following error:

/working2/tuem/miniconda3/envs/lefse/lib/python2.7/site-packages/rpy2/robjects/functions.py:106: UserWarning: Error : Function found when exporting methods from the namespace ‘Matrix’ which is not S4 generic: ‘as.vector’

  res = super(Function, self).__call__(*new_args, **new_kwargs)
/working2/tuem/miniconda3/envs/lefse/lib/python2.7/site-packages/rpy2/robjects/functions.py:106: UserWarning: In addition:
  res = super(Function, self).__call__(*new_args, **new_kwargs)
/working2/tuem/miniconda3/envs/lefse/lib/python2.7/site-packages/rpy2/robjects/functions.py:106: UserWarning: Warning message:

  res = super(Function, self).__call__(*new_args, **new_kwargs)
/working2/tuem/miniconda3/envs/lefse/lib/python2.7/site-packages/rpy2/robjects/functions.py:106: UserWarning: package ‘survival’ was built under R version 3.4.2

  res = super(Function, self).__call__(*new_args, **new_kwargs)
/working2/tuem/miniconda3/envs/lefse/lib/python2.7/site-packages/rpy2/robjects/functions.py:106: UserWarning: Error: package or namespace load failed for ‘survival’

  res = super(Function, self).__call__(*new_args, **new_kwargs)
Traceback (most recent call last):
  File "/working2/tuem/miniconda3/envs/lefse/bin/run_lefse.py", line 56, in <module>
    init()
  File "/working2/tuem/miniconda3/envs/lefse/share/lefse-1.0.7-1/lefse.py", line 12, in init
    robjects.r('library(survival)')
  File "/working2/tuem/miniconda3/envs/lefse/lib/python2.7/site-packages/rpy2/robjects/__init__.py", line 321, in __call__
    res = self.eval(p)
  File "/working2/tuem/miniconda3/envs/lefse/lib/python2.7/site-packages/rpy2/robjects/functions.py", line 178, in __call__
    return super(SignatureTranslatedFunction, self).__call__(*args, **kwargs)
  File "/working2/tuem/miniconda3/envs/lefse/lib/python2.7/site-packages/rpy2/robjects/functions.py", line 106, in __call__
    res = super(Function, self).__call__(*new_args, **new_kwargs)
rpy2.rinterface.RRuntimeError: Error: package or namespace load failed for ‘survival’

I could not find a way to solve this error.

Is there anything I need to change in my installation process to get LEfSe to work on my machine? Any help is appreciated!

Best wishes,
Tobi


conda_lefse_run.sh
Reply all
Reply to author
Forward
0 new messages