KrishnaswamyLab / phateR

PHATE dimensionality reduction method implemented in R
GNU General Public License v2.0
77 stars 9 forks source link

Error with phateR after update #32

Closed julierodor closed 5 years ago

julierodor commented 5 years ago

Hi, I have been using phateR through Seurat command RunPHATE. I have been successful before but now the same command gives me some error (see below). I am not sure if it's due to some updates and how to fix it. Any help would be appreciated. Thanks The command I am using is RunPHATE(Phate_Cluster6,genes.use = Phate_Cluster6@var.genes,max.dim = 2,reduction.name = "phate2d")

error Argument k is deprecated. Using knn instead. Argument alpha is deprecated. Using decay instead. Calculating PHATE... Running PHATE on 3962 cells and 1446 genes. Calculating graph and diffusion operator... Calculating PCA... Calculated PCA in 13.30 seconds. Calculating KNN search... Calculated KNN search in 1.84 seconds. Calculating affinities... Calculated affinities in 1.47 seconds. Error in py_call_impl(callable, dots$args, dots$keywords) : TypeError: init() got an unexpected keyword argument 'use.alpha'

Detailed traceback: File "/home/jrodor/.local/lib/python3.6/site-packages/phate/phate.py", line 808, in fit_transform self.fit(X) File "/home/jrodor/.local/lib/python3.6/site-packages/phate/phate.py", line 715, in fit (self.kwargs)) File "/home/jrodor/.local/lib/python3.6/site-packages/graphtools/api.py", line 248, in Graph return Graph(params) File "/home/jrodor/.local/lib/python3.6/site-packages/graphtools/graphs.py", line 102, in init super().init(data, n_pca=n_pca, kwargs) File "/home/jrodor/.local/lib/python3.6/site-packages/graphtools/graphs.py", line 473, in init super().init(data, kwargs) File "/home/jrodor/.local/lib/python3.6/site-packages/graphtools/base.py", line 750, in init super().init(data, kwargs) File "/home/jrodor/.local/lib/python3.6/site-packages/graphtools/base.py", line 135, in init super().init(kwa

scottgigante commented 5 years ago

Hi @julierodor , thanks for the error report. I've made a change which should hopefully fix your problem. If you're willing to install from github to check for me before I push the fix to CRAN, I'd appreciate it.

devtools::install_github("KrishnaswamyLab/phateR", ref="dev")
julierodor commented 5 years ago

Hi, I tried the command you suggested. The installation seems to work (see below - #Installation). But I still have errors when running phateR through RunPHATE command (see below # running phate with RunPHATE) Phate_Cluster6 <- RunPHATE(Phate_Cluster6,genes.use = Phate_Cluster6@var.genes,max.dim = 2,reduction.name = "phate2d")

Installation

✔ checking for file ‘/tmp/RtmpfkBhI9/remotes1be74f68ac60/KrishnaswamyLab-phateR-ed36e16/DESCRIPTION’ ... ─ preparing ‘phateR’: ✔ checking DESCRIPTION meta-information ... ─ checking for LF line-endings in source and make files and shell scripts ─ checking for empty or unneeded directories ─ looking to see if a ‘data/datalist’ file should be added ─ building ‘phateR_0.4.0.9999.tar.gz’

Installing package into ‘/home/jrodor/R/x86_64-pc-linux-gnu-library/3.5’ (as ‘lib’ is unspecified)

running phate with RunPHATE

Error in py_module_import(module, convert = convert) : AttributeError: module 'pandas' has no attribute 'core'

Detailed traceback: File "/home/jrodor/.local/lib/python3.6/site-packages/phate/init.py", line 5, in import phate.io File "/home/jrodor/.local/lib/python3.6/site-packages/phate/io.py", line 6, in import scprep File "/home/jrodor/.local/lib/python3.6/site-packages/scprep/init.py", line 5, in import scprep.io File "/home/jrodor/.local/lib/python3.6/site-packages/scprep/io/init.py", line 4, in from .csv import load_csv, load_tsv File "/home/jrodor/.local/lib/python3.6/site-packages/scprep/io/csv.py", line 4, in import pandas as pd File "/home/jrodor/.local/lib/python3.6/site-packages/pandas/init.py", line 42, in from pandas.core.api import * File "/home/jrodor/.local/lib/python3.6/site-packages/pandas/core/api.py", line 10, in from pandas.core.groupby.groupby import Grouper File "/home/jrodor/.local/lib/python3.6/site-packages/pandas/core/groupby/init.py", line 2, in from pandas.core.groupby.groupby import ( File "/home/jrodor/.local/lib/python3.6/site-packages/pandas/core/groupby/groupby.py", line 49, in from pandas.core.frame import DataFrame File "/home/jrodor/.local/lib/python3.6/site-packages/pandas/core/frame.py", line 66, in from pandas.core.generic import NDFrame, _shared_docs File "/home/jrodor/.local/lib/python3.6/site-packages/pandas/core/generic.py", line 40, in import pandas.core.indexing as indexing

Argument k is deprecated. Using knn instead. Argument alpha is deprecated. Using decay instead. Argument use.alpha is deprecated. Alpha-decay is on by default. Error loading Python module phate AttributeError: module 'pandas' has no attribute 'core'

Detailed traceback: File "/home/jrodor/.local/lib/python3.6/site-packages/phate/init.py", line 5, in import phate.io File "/home/jrodor/.local/lib/python3.6/site-packages/phate/io.py", line 6, in import scprep File "/home/jrodor/.local/lib/python3.6/site-packages/scprep/init.py", line 5, in import scprep.io File "/home/jrodor/.local/lib/python3.6/site-packages/scprep/io/init.py", line 4, in from .csv import load_csv, load_tsv File "/home/jrodor/.local/lib/python3.6/site-packages/scprep/io/csv.py", line 4, in import pandas as pd File "/home/jrodor/.local/lib/python3.6/site-packages/pandas/init.py", line 42, in from pandas.core.api import * File "/home/jrodor/.local/lib/python3.6/site-packages/pandas/core/api.py", line 10, in from pandas.core.groupby.groupby import Grouper File "/home/jrodor/.local/lib/python3.6/site-packages/pandas/core/groupby/init.py", line 2, in from pandas.core.groupby.groupby import ( File "/home/jrodor/.local/lib/python3.6/site-packages/pandas/core/groupby/groupby.py", line 49, in from pandas.core.frame import DataFrame File "/home/jrodor/.local/lib/python3.6/site-packages/pandas/core/frame.py", line 66, in from pandas.core.generic import NDFrame, _shared_docs File "/home/jrodor/.local/lib/python3.6/site-packages/pandas/core/generic.py", line 40, in import pandas.core.indexing as indexing Error: Error loading Python module phate

scottgigante commented 5 years ago

Hi @julierodor , thanks for the detailed traceback. Looks like the issue with phateR is resolved, but your python environment has a separate issue. Could you please run the following from a terminal?

pip uninstall pandas
pip uninstall phate
pip install --user phate

and then try again?

julierodor commented 5 years ago

Hi, Thanks. It seems to work now (see below). I am guessing the messages about the argument deprecated refer to the update. Is that correct? I am trying to reproduce data from someone else. I have the script but not sure which version of phate they have been using. I will check if the downstream analysis differs from the previous results but which differences should I expect between this version and the previous ones? Julie

Argument k is deprecated. Using knn instead. Argument alpha is deprecated. Using decay instead. Argument use.alpha is deprecated. Alpha-decay is on by default. Calculating PHATE... Running PHATE on 3962 cells and 1446 genes. Calculating graph and diffusion operator... Calculating PCA... Calculated PCA in 12.98 seconds. Calculating KNN search... Calculated KNN search in 1.80 seconds. Calculating affinities... Calculated affinities in 1.50 seconds. Calculated graph and diffusion operator in 16.31 seconds. Calculating landmark operator... Calculating SVD... Calculated SVD in 4.09 seconds. Calculating KMeans... Calculated KMeans in 82.60 seconds. Calculated landmark operator in 88.02 seconds. Calculating optimal t... Automatically selected t = 10 Calculated optimal t in 19.66 seconds. Calculating diffusion potential... Calculated diffusion potential in 21.06 seconds. Calculating metric MDS... Calculated metric MDS in 21.99 seconds. Calculated PHATE in 167.04 seconds.

scottgigante commented 5 years ago

Great! Yes, the deprecation arguments are due to the update - no change in functionality there, just some argument names have changed. Glad to hear it's working!