-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError: astype() got an unexpected keyword argument 'copy' #312
Comments
That is really strange -- I've never seen this error before.
First off, could you check the pandas version in your conda environment? My
guess is that something is broken with pandas here, since that's where
things seem to go wrong in the error traceback. Qurro needs a pandas
version of at least 0.24.0 and less than 1.0 -- I think conda should
install a suitable version when installing Qurro, but there's a fair chance
it got messed up somehow.
If your pandas version seems ok, then you might want to check the numpy
version. I googled this error message and found this thread regarding a
similar-looking error:
https://stackoverflow.com/questions/37952128/pandas-astype-categories-not-working
-- from the comments it looks like it might be a numpy issue. Not sure what
version in particular would fix this, though (if it's a recently introduced
error, then maybe a version from a few months ago might work...?)
The warning about missing features is as expected, I think; if I remember
correctly there are some parameters DEICODE has which (in their default
settings) filter out certain rare features. It might be nice to update the
tutorial there if it doesn't mention these; I'll make a note to look in to
that.
…On Sat, Aug 29, 2020, 1:05 AM johannesbjork ***@***.***> wrote:
Running the stand-alone version of qurro on results generated by DEICODE
on the qiime2-moving-pictures-tutorial I first get a warning saying that 228
feature(s) in the BIOM table were not present in the feature rankings.
These feature(s) have been removed from the visualization.--I guess these
got filtered out by DEICODE (this is not, I think mentioned in the
tutorial?)
But the focal error message as seen below is TypeError: astype() got an
unexpected keyword argument 'copy'.
Any idea what this points to?
Thanks!
(qurro) ***@***.*** qiime2-moving-pictures-tutorial % qurro \
--ranks standalone-cli/ordination.txt \
--table table.biom \
--sample-metadata sample-metadata.tsv \
--feature-metadata taxonomy.tsv \
--output-dir qurro-standalone
228 feature(s) in the BIOM table were not present in the feature rankings.
These feature(s) have been removed from the visualization.
Traceback (most recent call last):
File "/Users/user/python/miniconda3/envs/qurro/bin/qurro", line 11, in <module>
sys.exit(plot())
File "/Users/user/python/miniconda3/envs/qurro/lib/python3.6/site-packages/click/core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "/Users/user/python/miniconda3/envs/qurro/lib/python3.6/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/Users/user/python/miniconda3/envs/qurro/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/Users/user/python/miniconda3/envs/qurro/lib/python3.6/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/Users/user/python/miniconda3/envs/qurro/lib/python3.6/site-packages/qurro/scripts/_plot.py", line 100, in plot
extreme_feature_count,
File "/Users/user/python/miniconda3/envs/qurro/lib/python3.6/site-packages/qurro/generate.py", line 66, in process_and_generate
output_dir,
File "/Users/user/python/miniconda3/envs/qurro/lib/python3.6/site-packages/qurro/generate.py", line 470, in gen_visualization
V, rank_type, ranking_ids, feature_metadata_cols, processed_table
File "/Users/user/python/miniconda3/envs/qurro/lib/python3.6/site-packages/qurro/generate.py", line 260, in gen_rank_plot
rank_data = add_sample_presence_count(rank_data, table_sdf)
File "/Users/user/python/miniconda3/envs/qurro/lib/python3.6/site-packages/qurro/_df_utils.py", line 516, in add_sample_presence_count
table_pa = table_sdf.mask(table_sdf > 0, 1)
File "/Users/user/python/miniconda3/envs/qurro/lib/python3.6/site-packages/pandas/core/generic.py", line 6154, in mask
errors=errors)
File "/Users/user/python/miniconda3/envs/qurro/lib/python3.6/site-packages/pandas/core/generic.py", line 6130, in where
errors=errors, try_cast=try_cast)
File "/Users/user/python/miniconda3/envs/qurro/lib/python3.6/site-packages/pandas/core/generic.py", line 5893, in _where
cond = cond.astype(bool, copy=False)
TypeError: astype() got an unexpected keyword argument 'copy'
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#312>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA736P3GPL4XYRUOZN2XEWLSDCZETANCNFSM4QO3GCLQ>
.
|
So changing the python version to
|
Glad things worked out! Not sure why Python 3.6 was breaking things, but it's very useful to know that the problem can be avoided by using a newer Python version. Thanks for reporting the solution. The warnings are unfortunately as expected -- they are a symptom of #258. (Qurro and a lot of related software (e.g. biocore/biom-format#838) have not yet been updated to handle the pandas v1 versions of sparse data structures; so many parts of Qurro that explicitly use the "old" sparse data structures trigger warnings, annoyingly.) Lastly, I checked the DEICODE tutorials (standalone, QIIME 2) and it looks like they both mention the filtering parameters -- It seems like things are resolved for now, so I'm going to close this -- but please feel free to reopen (or to open a new issue) if you have any further questions :) |
Running the stand-alone version of qurro on results generated by
DEICODE
on theqiime2-moving-pictures-tutorial
I first get a warning saying that228 feature(s) in the BIOM table were not present in the feature rankings. These feature(s) have been removed from the visualization.
--I guess these got filtered out byDEICODE
(this is not, I think mentioned in the tutorial?)But the focal error message as seen below is
TypeError: astype() got an unexpected keyword argument 'copy'
.Any idea what this points to?
Thanks!
The text was updated successfully, but these errors were encountered: