Closed AndrewSkelton closed 4 years ago
You'll want to load the data with the builtin data
function.
> library(phateR)
> data("tree.data.small")
> X <- tree.data.small$data
Though looking in more detail this may not be the issue. There should be more error text than just what you pasted -- can you paste the full log from the commands you ran?
Also, you haven't run the diagnostics for the PHATE python package. Can you paste the output of phate.__version__
and pd.show_versions()
?
Sure, Thanks for the response.
Full Command Log:
> library(phateR)
> data("tree.data.small")
> X <- tree.data.small$data
> X_phate <- phate(X)
Error: $ operator is invalid for atomic vectors
>
Noteworthy that the data imports correctly:
> X[1:5,1:5]
[,1] [,2] [,3] [,4] [,5]
[1,] 8.132258 3.488540 -0.4705138 2.3645012 -0.2709322
[2,] 1.195481 -2.998776 -5.0235553 0.7382647 -1.2045404
[3,] 9.982471 7.553401 -5.4184183 3.7043284 9.5906120
[4,] -1.682318 -6.412553 -0.4101279 5.2041908 -1.0131886
[5,] 1.283608 -3.722553 3.3639010 -5.5879818 7.6889156
Python Stuff:
% python
Python 3.7.4 (default, Aug 13 2019, 15:17:50)
[Clang 4.0.1 (tags/RELEASE_401/final)] :: Anaconda, Inc. on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import phate
>>> import pandas as pd
>>> phate.__version__
'1.0.4'
>>> pd.show_versions()
INSTALLED VERSIONS
------------------
commit : None
python : 3.7.4.final.0
python-bits : 64
OS : Darwin
OS-release : 19.5.0
machine : x86_64
processor : i386
byteorder : little
LC_ALL : None
LANG : en_GB.UTF-8
LOCALE : en_GB.UTF-8
pandas : 0.25.1
numpy : 1.17.2
pytz : 2019.3
dateutil : 2.8.0
pip : 19.2.3
setuptools : 41.4.0
Cython : 0.29.13
pytest : 5.2.1
hypothesis : None
sphinx : 2.2.0
blosc : None
feather : None
xlsxwriter : 1.2.1
lxml.etree : 4.4.1
html5lib : 1.0.1
pymysql : None
psycopg2 : None
jinja2 : 2.10.3
IPython : 7.8.0
pandas_datareader: None
bs4 : 4.8.0
bottleneck : 1.2.1
fastparquet : None
gcsfs : None
lxml.etree : 4.4.1
matplotlib : 3.1.1
numexpr : 2.7.0
odfpy : None
openpyxl : 3.0.0
pandas_gbq : None
pyarrow : None
pytables : None
s3fs : None
scipy : 1.3.1
sqlalchemy : 1.3.9
tables : 3.5.2
xarray : None
xlrd : 1.2.0
xlwt : 1.3.0
xlsxwriter : 1.2.1
>>>
Hope that helps narrow the issue. Happy to provide more information
Note that in the reticulate config you are running python 3.6.10 but the version you showed PHATE installed in is 3.7.4. You can either remove the r-reticulate
env altogether (/Users/andrewskelton/Library/r-miniconda/envs/r-reticulate/
) and tell reticulate to use your default python (which python
in bash will tell you where) or you can install PHATE in the reticulate env with
/Users/andrewskelton/Library/r-miniconda/envs/r-reticulate/bin/python -m pip install phate
I'll look into why the error message is uninformative.
Sorry in advance that my Python knowledge is pretty weak in terms of package management. Thanks for the pointer in versions... As far as I was aware, apart from system python, the conda python version was all that was on my system. I'd already pip installed phate without issue, however I kept getting non-specific conda conflict errors when installing, even in a new conda environment. Running pip3 install phate
, "fixed" it and Phate runs in R now. I'd guess that something is messed up in my Python setup.
No problem, you're not the only one! https://xkcd.com/1987/
Closing this now as it seems to be resolved. Feel free to reopen if you run into further issues.
Hi, If it helps, I get the same error, having installed phate through reticulate:
> reticulate::py_discover_config("phate")
python: /Users/xxx/Library/r-miniconda/envs/r-reticulate/bin/python
libpython: /Users/xxx/Library/r-miniconda/envs/r-reticulate/lib/libpython3.6m.dylib
pythonhome: /Users/xxx/Library/r-miniconda/envs/r-reticulate:/Users/xxx/Library/r-miniconda/envs/r-reticulate
version: 3.6.11 | packaged by conda-forge | (default, Nov 27 2020, 18:51:43) [GCC Clang 11.0.0]
numpy: /Users/xxx/Library/r-miniconda/envs/r-reticulate/lib/python3.6/site-packages/numpy
numpy_version: 1.19.4
> data("tree.data.small")
> X <- tree.data.small$data
> X_phate <- phate(X)
Error: $ operator is invalid for atomic vectors
> is.atomic(X)
[1] TRUE
> is.recursive(X)
[1] FALSE
@matthpich can you please make sure your phateR version is up to date?
It works like a charm. Sorry for the false alarm and thanks a lot for your prompt help.
Hi There!
I have the same error, and I installed it by using pip3 did not work to correct the issue. By the way, the phate version installed is 1.0.11.
phate <- phateR::phate(t(GetAssayData(seurat_integratedObj,assay = "RNA",slot = "data")))
Error: $ operator is invalid for atomic vectors
I also teste in the example above, and it generated the same error
data("tree.data.small")
X <- tree.data.small$data
X_phate <- phate(X)
Error: $ operator is invalid for atomic vectors
Can someone help to figure out what it is going on?
Thanks, Paola
Your version of phateR is out of date. Please run update.packages("phateR")
. If you are still having issues, please open a new issue and fill in the issue template.
Hi There
Thank you for your quickly answer. It works now.
Thank you, Paola
Describe the bug
To Reproduce
Expected behavior Phate to Run without error
Actual behavior The phate function produces the above error, and unfortunately I can't figure out where the root issue is.
System information:
Output of
phate.__version__
:Output of
pd.show_versions()
:Output of
sessionInfo()
:Output of
reticulate::py_discover_config(required_module = "phate")
:Output of
phateR::check_pyphate_version()
:Additional context Add any other context about the problem here.