sararselitsky / FastPG

Fast phenograph, CyTOF
Other
25 stars 6 forks source link

Error in initialize(...) : attempt to apply non-function #11

Closed daiyaohara closed 3 years ago

daiyaohara commented 3 years ago

Hi,

I'm analyzing flowcytometory data which contain >1M cells. I installed FastPG using BiocManager like below;

BiocManager::install("sararselitsky/FastPG")

The installation was successful, but the function don't work. This is error message;

out = FastPG::fastCluster(data2,k=45,num_threads=12) Error in initialize(...) : attempt to apply non-function

On the other hands, FastPG worked excellently when I used pre-build Docker-container;
$ docker pull jefferys/fastpg:latest $ docker run -it --rm -v $PWD:$PWD -w $PWD jefferys/fastpg:latest

Why did error message prone when I used FastPG from BiocManager?

All the best, Daiya Ohara

jefferys commented 3 years ago

The local install is quite complicated, we are working to simplify that. It is not just a simple R module install. Did you set up the required backing python modules? and the env variable? The normal R package install process does not install python modules.

daiyaohara commented 3 years ago

Thanks, I used anaconda3 and installed R and python3.9 in the same anaconda virtual environment. I also installed nmslib (python) via anaconda. Then, I tried typing below codes in R.

$ reticulate::use_python(/user/home/anaconda3/envs/env_name/bin/python) $ reticulate::py_discover_config()

As a result, my R environment correctly recognized the path of python in anaconda. However, I got the same error message. ( Error in initialize(...) : attempt to apply non-function ) I also tried adding below code to my bash config file, but same error occurred.

export ENV RETICULATE_PYTHON=/user/home/anaconda3/envs/env_name/bin/python

Sincerely, Daiya Ohara

jefferys commented 3 years ago

Hmm. Haven't tried a local install with a conda environment, that adds a layer of complexity I have had previous problems with. You can try the new python-free version by installing the dev branch version with

BiocManager::install("sararselitsky/FastPG@dev")

I'm going to release this as the latest main version, hopefully later today, your problems have motivated us to make the change. It uses RcppHNSW for the hnsw step internally, instead of nmslibR. Its otherwise the same.

daiyaohara commented 3 years ago

Thanks, the problem was solved!

I tried the dev branch version. It worked correctly!

Sincerely, Daiya Ohara

jefferys commented 3 years ago

Released v0.0.7 to master.