ying14 / yingtools2

Ying's tools for analysis, with particular focus on microbiome data
41 stars 7 forks source link

Lefse in R issue with rpy2 and rpy2.robjects #18

Closed BVilanova closed 4 years ago

BVilanova commented 4 years ago

Hi, I am having trouble running the lefse.tbl function due to an error presented in R that reads as follows:

lefse.tbl <- lefse2(physeq, class="HPV_Status") Traceback (most recent call last): File "runlefse.py", line 4, in from lefse import * File "/Users/brayanvilanova/Desktop/nsegata-lefse-9adc3a62460e/lefse.py", line 3, in import rpy2.robjects as robjects ImportError: No module named rpy2.robjects [1] "Wrote lefse.res" Error in file(file, "rt") : cannot open the connection In addition: Warning messages: 1: select() is deprecated. Please use select() instead The 'programming' vignette or the tidyeval book can help you to program with select() : https://tidyeval.tidyverse.org This warning is displayed once per session. 2: In file(file, "rt") :

It seems as if the rpy2 wasn't working and although I have updated, and changed the version that does not seem to help. I am running this having python==2.7.15 and rpy2-2.8.2. I would really appreciate the help. Thank You!

AliciaHadingham commented 4 years ago

I have this exact same error! I have been working for over a week to try to solve it :(

fconstancias commented 4 years ago

same here.

NeginValizadegan commented 4 years ago

Same here. Could someone help? I even installed lefse on my computer but still R cannot recognize it when I use lefse(). Do we need to set to specific working directory or something?

kbcn commented 4 years ago

Same issue here. Anyone find a solution?

AliciaHadingham commented 4 years ago

Has anyone got it working yet? If you have please post how you did it!

ying14 commented 4 years ago

Can you confirm that rpy2 is actually installed on Python 2.7, and that you are running that within the function? Perhaps you only have it installed on Python 3. You should be able to run python in command line, get 2.7.x as version, and be able to type import rpy2 without error.

BTW, Lefse is getting really old and it is becoming more and more difficult to support this wrapper function, given its reliance on Py2.7 and old packages. In the future, it might be easier to run this from a container such as Docker.

fionarhuang commented 4 years ago

I got similar error when running my R script in my Mac, and saw this issue page when google for a solution. Finally, my issue was able to solve with the post here https://stackoverflow.com/questions/52361732/installing-rpy2-on-macos

Not sure whether it would be helpful for the issue here... Just in case someone want to try it.