R integration TypeError: object of type 'generator' has no len()
Closed this issue · 1 comments
Liz-m57 commented
Hi,
I 'm getting an error when I use the R integration part. The vesion is 1.5.7.
after I run transcript_py <- cc$get_transcriptomics()
:
Error in py_call_impl(callable, call_args$unnamed, call_args$named) : TypeError: object of type 'generator' has no len() Run reticulate::py_last_error() for details.
Details goes as below:
── Python Exception Message ───────────────────────────────
Traceback (most recent call last):
File "/home/maolz/anaconda3/envs/CPTAC/lib/python3.9/site-packages/cptac/cancers/cancer.py", line 188, in get_transcriptomics
return self.get_dataframe("transcriptomics", source, tissue_type, imputed=imputed)
File "/home/maolz/anaconda3/envs/CPTAC/lib/python3.9/site-packages/cptac/cancers/cancer.py", line 682, in get_dataframe
if len(sources_for_data) == 1:
TypeError: object of type 'generator' has no len()
── R Traceback ────────────────────────────────────────────
▆
1. └─cc$get_transcriptomics()
2. └─reticulate:::py_call_impl(callable, call_args$unnamed, call_args$named)
Thanks for your help in advance.
sabmel commented
Hello! We are working on uploading a new R tutorial very soon since the current one is outdated. In this case, you will want to put in a source parameter in get_transcriptomics. For example: transcript_py <- cc$get_transcriptomics('bcm')