KarchinLab / 2020plus

Classifies genes as an oncogene, tumor suppressor gene, or as a non-driver gene by using Random Forests
http://2020plus.readthedocs.org
Apache License 2.0
48 stars 17 forks source link

rpy2 may need a specified version #13

Closed Jonathanyu2014 closed 4 years ago

Jonathanyu2014 commented 4 years ago

When I ran 'python 2020plus.py classify', the error showed as follows:

Type: <class 'AttributeError'> Exception: module 'rpy2.robjects.pandas2ri' has no attribute 'py2ri'

I used rpy2 v3.1.0. I suggested the author specified a rpy2 version that could solve this problem. Thanks.

ctokheim commented 4 years ago

I was unaware of this problem as continuous integration (CI) hasn't yet indicated this error. My CI testing suggests rpy2 version 2.9.4 should be fine. My guess is that api changes from rpy2 version 2 to version 3 broke the code.

Jonathanyu2014 commented 4 years ago

Thanks for reply. I install rpy2 v2.9.4, however, there still was something wrong. I used 2020plus v1.2.3. The command line is "python 2020plus.py --out-dir=result_compare classify -f test.features.txt" . The error is as follows:

Running Random forest . . .


AN ERROR HAS OCCURRED: check the log file


Type: <class 'ValueError'> Exception: Buffer for this type not yet supported. Traceback: File "2020plus.py", line 275, in args.func() # run function corresponding to user's command File "2020plus.py", line 37, in _classify src.classify.python.classifier.main(opts) # run code .... ....

The python modules I used were : numpy==1.17.2 pandas==0.25.2 scipy==1.3.1 scikit-learn==0.19.2 matplotlib==3.1.1 PyYAML==5.1.2 pysam==0.15.3 rpy2==2.9.4 tzlocal==2.0.0 probabilistic2020==1.2.3 snakemake==5.7.4

ctokheim commented 4 years ago

This is actually a bug in rpy2 itself (see https://github.com/conda-forge/rpy2-feedstock/issues/28). Apparently, rpy2 2.9.x does not work with numpy 1.17.

Here are some version numbers that worked in a clean install environment: scipy-0.19.1 pandas-0.25.2 python-3.6.9 matplotlib-3.1.1 numpy-1.15.4 pysam-0.15.3

Jonathanyu2014 commented 4 years ago

Many thanks! Finally it worked for me. I reinstalled scipy-0.19.1 and numpy-1.15.4.