dayzerodx / counterr

GNU General Public License v3.0
30 stars 4 forks source link

Matplotlib error #9

Open peterdeheer opened 3 years ago

peterdeheer commented 3 years ago

got the following error:

lib/python3.9/site-packages/matplotlib/artist.py", line 1062, in update raise AttributeError(f"{type(self).name!r} object " AttributeError: 'Polygon' object has no property 'normed'

Apparently the latest matplotlib version 4.10.1 deprecated "normed" and you should use "density" and that creates the above error.

replacing all the "normed" for "density" in plots.py and re-installing solved the problem for me.

JulianMohr commented 2 years ago

Hello community,

I was facing the same issue and the above solution worked for me, too. Since the package does not seem to be functional due to this bug, it would be necessary to update the plots.py file in order to solve the issue.


Brief information about my installation and environment:

In my case, the installation requirements were solved by using a conda environment created with the following YAML file:

channels:
        - bioconda
        - conda-forge
        - anaconda
dependencies:
        - pysam>=0.14.1
        - seaborn>=0.9.0
        - matplotlib>=2.2.3
        - numpy>=1.15.4
        - pandas>=0.23.4

Then, I activated the environment and installed counterr as suggested in the installation instructions.

About my conda env:

# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                 conda_forge    conda-forge
_openmp_mutex             4.5                       1_gnu    conda-forge
alsa-lib                  1.2.3                h516909a_0    conda-forge
bzip2                     1.0.8                h7f98852_4    conda-forge
c-ares                    1.18.1               h7f98852_0    conda-forge
ca-certificates           2021.10.8            ha878542_0    conda-forge
certifi                   2021.10.8        py39hf3d152e_1    conda-forge
cycler                    0.11.0             pyhd8ed1ab_0    conda-forge
dbus                      1.13.6               h48d8840_2    conda-forge
expat                     2.4.1                h9c3ff4c_0    conda-forge
fontconfig                2.13.1            hba837de_1005    conda-forge
freetype                  2.10.4               h0708190_1    conda-forge
gettext                   0.19.8.1          h73d1719_1008    conda-forge
glib                      2.70.0               h780b84a_1    conda-forge
glib-tools                2.70.0               h780b84a_1    conda-forge
gst-plugins-base          1.18.5               hf529b03_1    conda-forge
gstreamer                 1.18.5               h9f60fe5_1    conda-forge
icu                       68.2                 h9c3ff4c_0    conda-forge
jbig                      2.1               h7f98852_2003    conda-forge
jpeg                      9d                   h36c2ea0_0    conda-forge
kiwisolver                1.3.2            py39h1a9c180_1    conda-forge
krb5                      1.19.2               hcc1bbae_2    conda-forge
lcms2                     2.12                 hddcbb42_0    conda-forge
ld_impl_linux-64          2.36.1               hea4e1c9_2    conda-forge
lerc                      2.2.1                h9c3ff4c_0    conda-forge
libblas                   3.9.0           12_linux64_openblas    conda-forge
libcblas                  3.9.0           12_linux64_openblas    conda-forge
libclang                  11.1.0          default_ha53f305_1    conda-forge
libcurl                   7.79.1               h2574ce0_1    conda-forge
libdeflate                1.7                  h7f98852_5    conda-forge
libedit                   3.1.20191231         he28a2e2_2    conda-forge
libev                     4.33                 h516909a_1    conda-forge
libevent                  2.1.10               h9b69904_4    conda-forge
libffi                    3.4.2                h9c3ff4c_4    conda-forge
libgcc-ng                 11.2.0              h1d223b6_11    conda-forge
libgfortran-ng            11.2.0              h69a702a_11    conda-forge
libgfortran5              11.2.0              h5c6108e_11    conda-forge
libglib                   2.70.0               h174f98d_1    conda-forge
libgomp                   11.2.0              h1d223b6_11    conda-forge
libiconv                  1.16                 h516909a_0    conda-forge
liblapack                 3.9.0           12_linux64_openblas    conda-forge
libllvm11                 11.1.0               hf817b99_2    conda-forge
libnghttp2                1.43.0               h812cca2_1    conda-forge
libogg                    1.3.4                h7f98852_1    conda-forge
libopenblas               0.3.18          pthreads_h8fe5266_0    conda-forge
libopus                   1.3.1                h7f98852_1    conda-forge
libpng                    1.6.37               h21135ba_2    conda-forge
libpq                     13.3                 hd57d9b9_2    conda-forge
libssh2                   1.10.0               ha56f1ee_2    conda-forge
libstdcxx-ng              11.2.0              he4da1e4_11    conda-forge
libtiff                   4.3.0                hf544144_1    conda-forge
libuuid                   2.32.1            h7f98852_1000    conda-forge
libvorbis                 1.3.7                h9c3ff4c_0    conda-forge
libwebp-base              1.2.1                h7f98852_0    conda-forge
libxcb                    1.13              h7f98852_1003    conda-forge
libxkbcommon              1.0.3                he3ba5ed_0    conda-forge
libxml2                   2.9.12               h72842e0_0    conda-forge
libzlib                   1.2.11            h36c2ea0_1013    conda-forge
lz4-c                     1.9.3                h9c3ff4c_1    conda-forge
matplotlib                3.4.3            py39hf3d152e_1    conda-forge
matplotlib-base           3.4.3            py39h2fa2bec_1    conda-forge
mysql-common              8.0.27               ha770c72_1    conda-forge
mysql-libs                8.0.27               hfa10184_1    conda-forge
ncurses                   6.2                  h58526e2_4    conda-forge
nspr                      4.32                 h9c3ff4c_0    conda-forge
nss                       3.71                 hb5efdd6_0    conda-forge
numpy                     1.21.3           py39hdbf815f_0    conda-forge
olefile                   0.46               pyh9f0ad1d_1    conda-forge
openjpeg                  2.4.0                hb52868f_1    conda-forge
openssl                   1.1.1l               h7f98852_0    conda-forge
pandas                    1.3.4            py39hde0f152_0    conda-forge
patsy                     0.5.2              pyhd8ed1ab_0    conda-forge
pcre                      8.45                 h9c3ff4c_0    conda-forge
pillow                    8.3.2            py39ha612740_0    conda-forge
pip                       21.3.1             pyhd8ed1ab_0    conda-forge
pthread-stubs             0.4               h36c2ea0_1001    conda-forge
pyparsing                 3.0.4              pyhd8ed1ab_0    conda-forge
pyqt                      5.12.3           py39hf3d152e_7    conda-forge
pyqt-impl                 5.12.3           py39h0fcd23e_7    conda-forge
pyqt5-sip                 4.19.18          py39he80948d_7    conda-forge
pyqtchart                 5.12             py39h0fcd23e_7    conda-forge
pyqtwebengine             5.12.1           py39h0fcd23e_7    conda-forge
pysam                     0.17.0           py39h051187c_0    bioconda
python                    3.9.7           hb7a2778_3_cpython    conda-forge
python-dateutil           2.8.2              pyhd8ed1ab_0    conda-forge
python_abi                3.9                      2_cp39    conda-forge
pytz                      2021.3             pyhd8ed1ab_0    conda-forge
qt                        5.12.9               hda022c4_4    conda-forge
readline                  8.1                  h46c0cb4_0    conda-forge
scipy                     1.7.1            py39hee8e79c_0    conda-forge
seaborn                   0.11.2               hd8ed1ab_0    conda-forge
seaborn-base              0.11.2             pyhd8ed1ab_0    conda-forge
setuptools                58.4.0           py39hf3d152e_1    conda-forge
six                       1.16.0             pyh6c4a22f_0    conda-forge
sqlite                    3.36.0               h9cd32fc_2    conda-forge
statsmodels               0.13.0           py39hce5d2b2_0    conda-forge
tk                        8.6.11               h27826a3_1    conda-forge
tornado                   6.1              py39h3811e60_2    conda-forge
tzdata                    2021e                he74cb21_0    conda-forge
wheel                     0.37.0             pyhd8ed1ab_1    conda-forge
xorg-libxau               1.0.9                h7f98852_0    conda-forge
xorg-libxdmcp             1.1.3                h7f98852_0    conda-forge
xz                        5.2.5                h516909a_1    conda-forge
zlib                      1.2.11            h36c2ea0_1013    conda-forge
zstd                      1.5.0                ha95c52a_0    conda-forge
Rohit-Satyam commented 1 month ago

I followed your way of installation @JulianMohr but then I encountered the following error after installing revised code from counterr from @BjoernUsadel github. You will also be required to replace legendHandles with legend_handles otherwise the matplot will complaint.

The output directory is not empty. Files will be overwritten.
Traceback (most recent call last):
  File "/home/satyamr/miniconda3/envs/counterr/bin/counterr", line 33, in <module>
    sys.exit(load_entry_point('counterr==0.1', 'console_scripts', 'counterr')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/satyamr/miniconda3/envs/counterr/lib/python3.12/site-packages/counterr-0.1-py3.12.egg/counterr/counterr.py", line 108, in main
  File "/home/satyamr/miniconda3/envs/counterr/lib/python3.12/site-packages/counterr-0.1-py3.12.egg/counterr/plots.py", line 87, in plot_per_read_Q_stats
AttributeError: 'Legend' object has no attribute 'legendHandles'. Did you mean: 'legend_handles'?
BjoernUsadel commented 1 month ago

yup correct seems to be another API change in - I think MatPlotlib 3.9.0 and later.