KrishnaswamyLab / phateR

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

Getting keyword argument error #73

Open sameet opened 7 months ago

sameet commented 7 months ago

Describe the bug Getting `TypeError: Base.init() got an unexpected keyword argument 'mds_solver'.

To Reproduce The tmp_data object was obtained using GetAssayData(sce, assay = "SCT", layer = "scale.data") in Suerat 5.0.

   > tmp1 <- phate(t(tmp_data)) 
    Calculating PHATE...
    Running PHATE on 3000 cells and 10959 genes.
    Calculating graph and diffusion operator...
     Calculating PCA...
     Calculated PCA in 2.32 seconds.
     Calculating KNN search...
     Calculated KNN search in 0.68 seconds.
     Calculating affinities...
     Calculated affinities in 0.01 seconds.
   Calculated graph and diffusion operator in 3.02 seconds.
 Calculated PHATE in 3.02 seconds. 
 Error in py_call_impl(callable, call_args$unnamed, call_args$named) : 
   TypeError: Base.__init__() got an unexpected keyword argument 'mds_solver'
 Run `reticulate::py_last_error()` for details.

  > reticulate::py_last_error()

  ── Python Exception Message ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
  Traceback (most recent call last):
    File "/opt/homebrew/Caskroom/miniconda/base/envs/phate/lib/python3.11/site-packages/phate/phate.py", line 835, in fit_transform
      self.fit(X)
    File "/opt/homebrew/Caskroom/miniconda/base/envs/phate/lib/python3.11/site-packages/phate/phate.py", line 730, in fit
      self.graph = graphtools.Graph(
                 ^^^^^^^^^^^^^^^^^
    File "/opt/homebrew/Caskroom/miniconda/base/envs/phate/lib/python3.11/site-packages/graphtools/api.py", line 289, in Graph
    return Graph(**params)
           ^^^^^^^^^^^^^^^
  File "/opt/homebrew/Caskroom/miniconda/base/envs/phate/lib/python3.11/site-packages/graphtools/graphs.py", line 136, in __init__
      super().__init__(data, n_pca=n_pca, **kwargs)
    File "/opt/homebrew/Caskroom/miniconda/base/envs/phate/lib/python3.11/site-packages/graphtools/graphs.py", line 527, in __init__
      super().__init__(data, **kwargs)
    File "/opt/homebrew/Caskroom/miniconda/base/envs/phate/lib/python3.11/site-packages/graphtools/base.py", line 1019, in __init__
      super().__init__(data, **kwargs)
    File "/opt/homebrew/Caskroom/miniconda/base/envs/phate/lib/python3.11/site-packages/graphtools/base.py", line 137, in __init__
      super().__init__(**kwargs)
    File "/opt/homebrew/Caskroom/miniconda/base/envs/phate/lib/python3.11/site-packages/graphtools/base.py", line 506, in __init__
      super().__init__(**kwargs)
  TypeError: Base.__init__() got an unexpected keyword argument 'mds_solver'

── R Traceback ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
    ▆
 1. └─phateR::phate(t(tmp_data))
 2.   └─operator$fit_transform(data, t_max = t.max)
 3.     └─reticulate:::py_call_impl(callable, call_args$unnamed, call_args$named)

Expected behavior Should get back a phate object with embeddings.

Actual behavior Please include the full traceback of any errors

System information:

Output of phate.__version__: 0.4.5

Please run phate.__version__ and paste the results here.

You can do this with `python -c 'import phate; print(phate.__version__)'`

Output of pd.show_versions():

INSTALLED VERSIONS
------------------
commit                : bdc79c146c2e32f2cab629be240f01658cfb6cc2
python                : 3.11.5.final.0
python-bits           : 64
OS                    : Darwin
OS-release            : 23.3.0
Version               : Darwin Kernel Version 23.3.0: Wed Dec 20 21:30:27 PST 2023; root:xnu-10002.81.5~7/RELEASE_ARM64_T8103
machine               : arm64
processor             : arm
byteorder             : little
LC_ALL                : None
LANG                  : en_US.UTF-8
LOCALE                : en_US.UTF-8

pandas                : 2.2.1
numpy                 : 1.23.5
pytz                  : 2024.1
dateutil              : 2.9.0
setuptools            : 68.2.2
pip                   : 23.3.1
Cython                : None
pytest                : None
hypothesis            : None
sphinx                : None
blosc                 : None
feather               : None
xlsxwriter            : None
lxml.etree            : None
html5lib              : None
pymysql               : None
psycopg2              : None
jinja2                : None
IPython               : None
pandas_datareader     : None
adbc-driver-postgresql: None
adbc-driver-sqlite    : None
bs4                   : None
bottleneck            : 1.3.7
dataframe-api-compat  : None
fastparquet           : None
fsspec                : None
gcsfs                 : None
matplotlib            : 3.8.0
numba                 : None
numexpr               : 2.8.7
odfpy                 : None
openpyxl              : None
pandas_gbq            : None
pyarrow               : None
pyreadstat            : None
python-calamine       : None
pyxlsb                : None
s3fs                  : None
scipy                 : 1.11.4
sqlalchemy            : None
tables                : None
tabulate              : None
xarray                : None
xlrd                  : None
zstandard             : None
tzdata                : 2024.1
qtpy                  : None
pyqt5                 : None

Output of sessionInfo():

``` R version 4.3.2 (2023-10-31) Platform: aarch64-apple-darwin20 (64-bit) Running under: macOS Sonoma 14.3.1 Matrix products: default BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib LAPACK: /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/lib/libRlapack.dylib; LAPACK version 3.11.0 locale: [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8 time zone: America/New_York tzcode source: internal attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] phateR_1.0.7 Matrix_1.6-5 ggtext_0.1.2 patchwork_1.2.0 lubridate_1.9.3 forcats_1.0.0 stringr_1.5.1 [8] dplyr_1.1.4 purrr_1.0.2 readr_2.1.5 tidyr_1.3.1 tibble_3.2.1 ggplot2_3.5.0 tidyverse_2.0.0 [15] Seurat_5.0.2 SeuratObject_5.0.1 sp_2.1-3 loaded via a namespace (and not attached): [1] RColorBrewer_1.1-3 rstudioapi_0.15.0 jsonlite_1.8.8 magrittr_2.0.3 spatstat.utils_3.0-4 vctrs_0.6.5 [7] ROCR_1.0-11 memoise_2.0.1 spatstat.explore_3.2-6 htmltools_0.5.7 sctransform_0.4.1 parallelly_1.37.1 [13] KernSmooth_2.23-22 htmlwidgets_1.6.4 ica_1.0-3 plyr_1.8.9 plotly_4.10.4 zoo_1.8-12 [19] cachem_1.0.8 igraph_2.0.3 mime_0.12 lifecycle_1.0.4 pkgconfig_2.0.3 R6_2.5.1 [25] fastmap_1.1.1 fitdistrplus_1.1-11 future_1.33.1 shiny_1.8.0 digest_0.6.35 colorspace_2.1-0 [31] tensor_1.5 RSpectra_0.16-1 irlba_2.3.5.1 progressr_0.14.0 fansi_1.0.6 spatstat.sparse_3.0-3 [37] timechange_0.3.0 httr_1.4.7 polyclip_1.10-6 abind_1.4-5 compiler_4.3.2 withr_3.0.0 [43] fastDummies_1.7.3 MASS_7.3-60.0.1 tools_4.3.2 lmtest_0.9-40 httpuv_1.6.14 future.apply_1.11.1 [49] goftest_1.2-3 glue_1.7.0 nlme_3.1-164 promises_1.2.1 gridtext_0.1.5 grid_4.3.2 [55] Rtsne_0.17 cluster_2.1.6 reshape2_1.4.4 generics_0.1.3 gtable_0.3.4 spatstat.data_3.0-4 [61] tzdb_0.4.0 data.table_1.15.2 hms_1.1.3 xml2_1.3.6 utf8_1.2.4 spatstat.geom_3.2-9 [67] RcppAnnoy_0.0.22 ggrepel_0.9.5 RANN_2.6.1 pillar_1.9.0 spam_2.10-0 RcppHNSW_0.6.0 [73] later_1.3.2 splines_4.3.2 lattice_0.22-5 survival_3.5-8 deldir_2.0-4 tidyselect_1.2.1 [79] miniUI_0.1.1.1 pbapply_1.7-2 knitr_1.45 gridExtra_2.3 scattermore_1.2 xfun_0.42 [85] matrixStats_1.2.0 stringi_1.8.3 lazyeval_0.2.2 yaml_2.3.8 codetools_0.2-19 cli_3.6.2 [91] uwot_0.1.16 xtable_1.8-4 reticulate_1.35.0 munsell_0.5.0 Rcpp_1.0.12 globals_0.16.3 [97] spatstat.random_3.2-3 png_0.1-8 parallel_4.3.2 ellipsis_0.3.2 dotCall64_1.1-1 listenv_0.9.1 [103] viridisLite_0.4.2 scales_1.3.0 ggridges_0.5.6 leiden_0.4.3.1 rlang_1.1.3 cowplot_1.1.3 ```

Output of reticulate::py_discover_config(required_module = "phate"):

``` Please run `reticulate::py_discover_config(required_module = "phate")` and paste the results here. You can do this with `R -e 'reticulate::py_discover_config(required_module = "phate")'` ```

Output of phateR::check_pyphate_version():

``` Please run `phateR::check_pyphate_version()` and paste the results here. You can do this with `R -e 'phateR::check_pyphate_version()'` ```

Additional context Add any other context about the problem here.