BojarLab / glycowork

Package for processing and analyzing glycans and their role in biology.
https://Bojarlab.github.io/glycowork
MIT License
56 stars 12 forks source link

00_core.ipynb: ValueError #14

Closed dtchang closed 2 years ago

dtchang commented 2 years ago

characterize_monosaccharide('Xyl', rank = 'Kingdom', focus = 'Plantae', modifications = True) ValueError: cannot set using a list-like indexer with a different length than the value

Bribak commented 2 years ago

Hi, thanks for your comment! But I can't reproduce the error on my end. When I import glycowork and simply run characterize_monosaccharide('Xyl', rank = 'Kingdom', focus = 'Plantae', modifications = True) it works as expected & it also works in the Jupyter notebook for me. Did you run the notebook in the right order? Otherwise I'd recommend installing/import glycowork as a package in your favorite Python environment and using it there, that should work.

dtchang commented 2 years ago

I installed glycowork (v0.4.0) using pip and ran the notebook in JupyterLab from Anaconda. I ran the notebook in the right order and all cells ran fine up to and including make_heatmap().

Both characterize_monosaccharide() calls produced the ValueError. They came from (motif) analysis.py -> Seaborn -> Pandas. The errors are reproducible.

Bribak commented 2 years ago

Okay, thanks! I've tested it some more and I've spotted the issue: it's the 0.11.2 seaborn update. I have to see how to fix it in the code but, for now, if you downgrade seaborn to 0.11.1 everything should run as expected (at least I tried switching back and forth and it worked).

Bribak commented 2 years ago

It's now also fixed for seaborn 0.11.2 on the dev branch (not in the regular pip install), which you can get via: pip install git+https://github.com/BojarLab/glycowork.git@dev It will be merged into the stable release with the v0.5 update (except if we do a v0.4.1 update in between). Let me know if anything unexpected pops up; thanks for your feedback!

dtchang commented 2 years ago

I did a pip uninstall then installed from the dev branch. But, somehow the fix is not there. No problem, I'll wait for v0.5. Thanks for the prompt fix.