Skip to content

sc.pl.paga_path not working with TypeError #953

Closed

Description

@mbuttner

Hi,
I run scanpy in Python 3.7, matplotlib=3.1.1 - sc.pl.paga_path gives me the following error(s).

import scanpy as sc
adata = sc.datasets.paul15()
sc.pp.pca(adata)
sc.pp.neighbors(adata)
sc.tl.dpt(adata)
sc.tl.paga(adata, groups='paul15_clusters')
sc.pl.paga_path(adata, nodes=['1Ery'], keys=['Gata2', 'Btg2', 'Btg1'])
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-5-a9471349c389> in <module>
----> 1 sc.pl.paga_path(adata, nodes=['1Ery'], keys=['Gata2', 'Btg2', 'Btg1'])

~/Documents/Python/scanpy/scanpy/plotting/_tools/paga.py in paga_path(adata, nodes, keys, use_raw, annotations, color_map, color_maps_annotations, palette_groups, n_avg, groups_key, xlim, title, left_margin, ytick_fontsize, title_fontsize, show_node_names, show_yticks, show_colorbar, legend_fontsize, legend_fontweight, normalize_to_zero_one, as_heatmap, return_data, show, save, ax)
   1057     if as_heatmap:
   1058         img = ax.imshow(
-> 1059             X, aspect='auto', interpolation='nearest', cmap=color_map
   1060         )
   1061         if show_yticks:

~/anaconda3/lib/python3.7/site-packages/matplotlib/__init__.py in inner(ax, data, *args, **kwargs)
   1599     def inner(ax, *args, data=None, **kwargs):
   1600         if data is None:
-> 1601             return func(ax, *map(sanitize_sequence, args), **kwargs)
   1602 
   1603         bound = new_sig.bind(ax, *args, **kwargs)

~/anaconda3/lib/python3.7/site-packages/matplotlib/cbook/deprecation.py in wrapper(*args, **kwargs)
    367                 f"%(removal)s.  If any parameter follows {name!r}, they "
    368                 f"should be pass as keyword, not positionally.")
--> 369         return func(*args, **kwargs)
    370 
    371     return wrapper

~/anaconda3/lib/python3.7/site-packages/matplotlib/cbook/deprecation.py in wrapper(*args, **kwargs)
    367                 f"%(removal)s.  If any parameter follows {name!r}, they "
    368                 f"should be pass as keyword, not positionally.")
--> 369         return func(*args, **kwargs)
    370 
    371     return wrapper

~/anaconda3/lib/python3.7/site-packages/matplotlib/axes/_axes.py in imshow(self, X, cmap, norm, aspect, interpolation, alpha, vmin, vmax, origin, extent, shape, filternorm, filterrad, imlim, resample, url, **kwargs)
   5669                               resample=resample, **kwargs)
   5670 
-> 5671         im.set_data(X)
   5672         im.set_alpha(alpha)
   5673         if im.get_clip_path() is None:

~/anaconda3/lib/python3.7/site-packages/matplotlib/image.py in set_data(self, A)
    688                 or self._A.ndim == 3 and self._A.shape[-1] in [3, 4]):
    689             raise TypeError("Invalid shape {} for image data"
--> 690                             .format(self._A.shape))
    691 
    692         if self._A.ndim == 3:

TypeError: Invalid shape (3, 43, 1) for image data

If I convert the adata.X to sparse matrix format, I have the following error:

adata.X = sci.sparse.csr_matrix(adata.X)
sc.pl.paga_path(adata, nodes=['1Ery'], keys=['Gata2', 'Btg2', 'Btg1'])
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-29-a9471349c389> in <module>
----> 1 sc.pl.paga_path(adata, nodes=['1Ery'], keys=['Gata2', 'Btg2', 'Btg1'])

~/Documents/Python/scanpy/scanpy/plotting/_tools/paga.py in paga_path(adata, nodes, keys, use_raw, annotations, color_map, color_maps_annotations, palette_groups, n_avg, groups_key, xlim, title, left_margin, ytick_fontsize, title_fontsize, show_node_names, show_yticks, show_colorbar, legend_fontsize, legend_fontweight, normalize_to_zero_one, as_heatmap, return_data, show, save, ax)
   1057     if as_heatmap:
   1058         img = ax.imshow(
-> 1059             X, aspect='auto', interpolation='nearest', cmap=color_map
   1060         )
   1061         if show_yticks:

~/anaconda3/lib/python3.7/site-packages/matplotlib/__init__.py in inner(ax, data, *args, **kwargs)
   1599     def inner(ax, *args, data=None, **kwargs):
   1600         if data is None:
-> 1601             return func(ax, *map(sanitize_sequence, args), **kwargs)
   1602 
   1603         bound = new_sig.bind(ax, *args, **kwargs)

~/anaconda3/lib/python3.7/site-packages/matplotlib/cbook/deprecation.py in wrapper(*args, **kwargs)
    367                 f"%(removal)s.  If any parameter follows {name!r}, they "
    368                 f"should be pass as keyword, not positionally.")
--> 369         return func(*args, **kwargs)
    370 
    371     return wrapper

~/anaconda3/lib/python3.7/site-packages/matplotlib/cbook/deprecation.py in wrapper(*args, **kwargs)
    367                 f"%(removal)s.  If any parameter follows {name!r}, they "
    368                 f"should be pass as keyword, not positionally.")
--> 369         return func(*args, **kwargs)
    370 
    371     return wrapper

~/anaconda3/lib/python3.7/site-packages/matplotlib/axes/_axes.py in imshow(self, X, cmap, norm, aspect, interpolation, alpha, vmin, vmax, origin, extent, shape, filternorm, filterrad, imlim, resample, url, **kwargs)
   5669                               resample=resample, **kwargs)
   5670 
-> 5671         im.set_data(X)
   5672         im.set_alpha(alpha)
   5673         if im.get_clip_path() is None:

~/anaconda3/lib/python3.7/site-packages/matplotlib/image.py in set_data(self, A)
    683                 not np.can_cast(self._A.dtype, float, "same_kind")):
    684             raise TypeError("Image data of dtype {} cannot be converted to "
--> 685                             "float".format(self._A.dtype))
    686 
    687         if not (self._A.ndim == 2

TypeError: Image data of dtype object cannot be converted to float

Plotting a heatmap with sc.pl.heatmap works.

Versions:

scanpy==1.4.5.dev137+ge46f89b anndata==0.6.22.post2.dev73+g00b4b91 umap==0.3.8 numpy==1.17.3 scipy==1.2.1 pandas==0.25.2 scikit-learn==0.20.3 statsmodels==0.10.1 python-igraph==0.7.1 louvain==0.6.1

Activity

  1. chris-rands commented on Feb 5, 2020

    @chris-rands
    Contributor

    +1, I still have the same issue (the 2nd traceback)- did you find a solution?

  2. chris-rands commented on Feb 7, 2020

    @chris-rands
    Contributor

    I've found a workaround, when I downgrade to anndata=0.6.22.post1 (still with scanpy==1.4.5.post2), it generates an output with paga_path but also this warning:

    FutureWarning: In anndata v0.7+, arrays contained within an AnnData object will maintain their dimensionality. For example, prior to v0.7 `adata[0, 0].X` returned a scalar and `adata[0, :]` returned a 1d array, post v0.7 they will return two dimensional arrays. If you would like to get a one dimensional array from your AnnData object, consider using the `adata.obs_vector`, `adata.var_vector` methods or accessing the array directly.
    
  3. tkkanno commented on Feb 12, 2020

    @tkkanno

    +1 issue found with scanpy <Version('1.4.5.post3')>

  4. flying-sheep commented on Feb 14, 2020

    @flying-sheep
    Member

    Should be fixed in #1047, please check

  5. mbuttner commented on Feb 14, 2020

    @mbuttner
    ContributorAuthor

    Hi,
    I tested your fix and it works!

    scanpy==1.4.5.2.dev6+gfa408dc7 anndata==0.7.1 
    umap==0.3.10 numpy==1.17.4 scipy==1.3.1 
    pandas==0.25.2 scikit-learn==0.21.3 
    statsmodels==0.10.1 python-igraph==0.7.1 louvain==0.6.1
    

    BTW:
    matplotlib==3.1.3

  6. flying-sheep commented on Feb 14, 2020

    @flying-sheep
    Member

    Cool! Can you also try to run the test that fails in the PR please?

    Should be PYTHONPATH=. pytest scanpy/tests/test_plotting.py::test_paga_path

    I have no idea why it does that, as it works for me. If it fails for you, please attach the failed-diff image and the corresponding plot image in a comment here (they’re in scanpy/tests/figures)

  7. mbuttner commented on Feb 14, 2020

    @mbuttner
    ContributorAuthor

    Ok, I ran the test and was successful.

  8. flying-sheep commented on Feb 15, 2020

    @flying-sheep
    Member

    Damn … it’s going to be hard to find out why the test fails on Travis then, and I don’t feel comfortable not adding a test. Do we have an Amazon web service (AWS) subscription at ICB that we could use to upload failed image tests?

  9. mbuttner commented on Feb 17, 2020

    @mbuttner
    ContributorAuthor
  10. flying-sheep commented on Feb 18, 2020

    @flying-sheep
    Member
  11. esrice commented on Apr 24, 2020

    @esrice
    Contributor

    Getting the same bug. What's the status on merging this fix into a release? Thanks!

  12. mbuttner commented on Apr 24, 2020

    @mbuttner
    ContributorAuthor

    I have a temporary solution, where I created a new conda environment and checked out the scanpy branch with the fix (https://github.com/theislab/scanpy/tree/fix-paga).

  13. esrice commented on Apr 24, 2020

    @esrice
    Contributor

    thanks!

  14. flying-sheep commented on May 1, 2020

    @flying-sheep
    Member

    Can someone at ICB make the S3 bucket happen and give me the login creds? Then I can merge this.

  15. lucygarner commented on Oct 30, 2020

    @lucygarner

    I am also getting a TypeError when I run the following code:
    sc.pl.paga_path(adata, nodes = [0, 5, 1], keys = ['IFNG', 'GZMB'], show = True)

    TypeError: Image data of dtype object cannot be converted to float

    What is the current solution to this issue?

    Many thanks,
    Lucy

    # Name                    Version                   Build  Channel
    alabaster                 0.7.12                     py_0    conda-forge
    anndata                   0.7.4            py38h32f6830_0    conda-forge
    applaunchservices         0.2.1                      py_0    conda-forge
    appnope                   0.1.0           py38h32f6830_1002    conda-forge
    argh                      0.26.2                py38_1001    conda-forge
    astroid                   2.4.2            py38h32f6830_1    conda-forge
    async_generator           1.10                       py_0    conda-forge
    atomicwrites              1.4.0              pyh9f0ad1d_0    conda-forge
    attrs                     20.2.0             pyh9f0ad1d_0    conda-forge
    autopep8                  1.5.4              pyh9f0ad1d_0    conda-forge
    babel                     2.8.0                      py_0    conda-forge
    backcall                  0.2.0              pyh9f0ad1d_0    conda-forge
    backports                 1.0                        py_2    conda-forge
    backports.functools_lru_cache 1.6.1                      py_0    conda-forge
    bleach                    3.2.1              pyh9f0ad1d_0    conda-forge
    blosc                     1.20.1               hb1e8313_0    conda-forge
    brotlipy                  0.7.0           py38h94c058a_1001    conda-forge
    bzip2                     1.0.8                haf1e3a3_3    conda-forge
    c-ares                    1.16.1               haf1e3a3_3    conda-forge
    ca-certificates           2020.10.14                    0  
    cairo                     1.16.0            h360c52f_1006    conda-forge
    certifi                   2020.6.20        py38h5347e94_2    conda-forge
    cffi                      1.14.3           py38h9edaa1b_1    conda-forge
    chardet                   3.0.4           py38h5347e94_1008    conda-forge
    click                     7.1.2              pyh9f0ad1d_0    conda-forge
    cloudpickle               1.6.0                      py_0    conda-forge
    colorama                  0.4.4              pyh9f0ad1d_0    conda-forge
    cryptography              3.2              py38hf6767f5_0    conda-forge
    cycler                    0.10.0                     py_2    conda-forge
    dbus                      1.13.18              h18a8e69_0  
    decorator                 4.4.2                      py_0    conda-forge
    defusedxml                0.6.0                      py_0    conda-forge
    diff-match-patch          20200713           pyh9f0ad1d_0    conda-forge
    docutils                  0.16             py38h5347e94_2    conda-forge
    entrypoints               0.3             py38h32f6830_1002    conda-forge
    expat                     2.2.10               hb1e8313_2  
    fa2                       0.3.5            py38h4d0b108_0    conda-forge
    flake8                    3.8.4                      py_0    conda-forge
    fontconfig                2.13.1            h79c0d67_1002    conda-forge
    freetype                  2.10.4               ha233b18_0    conda-forge
    future                    0.18.2           py38h32f6830_2    conda-forge
    get_version               2.1                        py_1    conda-forge
    gettext                   0.19.8.1          haf92f58_1004    conda-forge
    glib                      2.66.2               hb1e8313_0    conda-forge
    gmp                       6.2.0                hb1e8313_3    conda-forge
    h5py                      2.10.0          nompi_py38hf6831e1_105    conda-forge
    hdf5                      1.10.6          nompi_hc457bb4_1110    conda-forge
    icu                       67.1                 hb1e8313_0    conda-forge
    idna                      2.10               pyh9f0ad1d_0    conda-forge
    imagesize                 1.2.0                      py_0    conda-forge
    importlib-metadata        2.0.0            py38h32f6830_0    conda-forge
    importlib_metadata        2.0.0                         1    conda-forge
    intervaltree              3.1.0                      py_0  
    ipykernel                 5.3.4            py38h1cdfbd6_1    conda-forge
    ipython                   7.18.1           py38h1cdfbd6_1    conda-forge
    ipython_genutils          0.2.0                      py_1    conda-forge
    isort                     5.6.4                      py_0    conda-forge
    jedi                      0.17.1           py38h32f6830_0    conda-forge
    jinja2                    2.11.2             pyh9f0ad1d_0    conda-forge
    joblib                    0.17.0                     py_0    conda-forge
    jpeg                      9d                   h0b31af3_0    conda-forge
    jsonschema                3.2.0            py38h32f6830_1    conda-forge
    jupyter_client            6.1.7                      py_0    conda-forge
    jupyter_core              4.6.3            py38h32f6830_2    conda-forge
    jupyterlab_pygments       0.1.2              pyh9f0ad1d_0    conda-forge
    keyring                   21.4.0           py38h32f6830_2    conda-forge
    kiwisolver                1.3.0            py38h02bb52f_0    conda-forge
    krb5                      1.17.1               h75d18d8_3    conda-forge
    lazy-object-proxy         1.4.3            py38h64e0658_2    conda-forge
    lcms2                     2.11                 h174193d_0    conda-forge
    legacy-api-wrap           1.2                        py_0    conda-forge
    libblas                   3.9.0                2_openblas    conda-forge
    libcblas                  3.9.0                2_openblas    conda-forge
    libclang                  10.0.1          default_hf57f61e_1    conda-forge
    libcurl                   7.71.1               h9bf37e3_8    conda-forge
    libcxx                    11.0.0               h439d374_0    conda-forge
    libedit                   3.1.20191231         hed1e85f_2    conda-forge
    libev                     4.33                 haf1e3a3_1    conda-forge
    libffi                    3.2.1                         1    bioconda
    libgfortran               4.0.0               h50e675f_13    conda-forge
    libgfortran4              7.5.0               h50e675f_13    conda-forge
    libglib                   2.66.2               hdb5fb44_0    conda-forge
    libiconv                  1.16                 haf1e3a3_0    conda-forge
    liblapack                 3.9.0                2_openblas    conda-forge
    libllvm10                 10.0.1               h009f743_3    conda-forge
    libnghttp2                1.41.0               h7580e61_2    conda-forge
    libopenblas               0.3.12          openmp_h63d9170_1    conda-forge
    libpng                    1.6.37               hb0a8c7a_2    conda-forge
    libpq                     12.3                 haa216e0_2    conda-forge
    libsodium                 1.0.18               haf1e3a3_1    conda-forge
    libspatialindex           1.9.3                h4a8c4bd_3    conda-forge
    libssh2                   1.9.0                h39bdce6_5    conda-forge
    libtiff                   4.1.0                h2ae36a8_6    conda-forge
    libwebp-base              1.1.0                h0b31af3_3    conda-forge
    libxml2                   2.9.10               h7fdee97_2    conda-forge
    llvm-openmp               11.0.0               h73239a0_1    conda-forge
    llvmlite                  0.34.0           py38h3707e27_2    conda-forge
    loompy                    3.0.6                      py_0    conda-forge
    lz4-c                     1.9.2                hb1e8313_3    conda-forge
    markupsafe                1.1.1            py38h94c058a_2    conda-forge
    matplotlib-base           3.3.2            py38had0acaf_1    conda-forge
    mccabe                    0.6.1                      py_1    conda-forge
    mistune                   0.8.4           py38h4d0b108_1002    conda-forge
    mock                      4.0.2            py38h32f6830_1    conda-forge
    mysql-common              8.0.21                        2    conda-forge
    mysql-libs                8.0.21               hfb8f7af_2    conda-forge
    natsort                   7.0.1                      py_0    conda-forge
    nbclient                  0.5.1                      py_0    conda-forge
    nbconvert                 6.0.7            py38h32f6830_2    conda-forge
    nbformat                  5.0.8                      py_0    conda-forge
    ncurses                   6.2                  hb1e8313_2    conda-forge
    nest-asyncio              1.4.1                      py_0    conda-forge
    networkx                  2.5                        py_0    conda-forge
    nspr                      4.29                 hb1e8313_1    conda-forge
    nss                       3.47                 hcec2283_0    conda-forge
    numba                     0.51.2           py38h6be0db6_0    conda-forge
    numexpr                   2.7.1            py38h6be0db6_3    conda-forge
    numpy                     1.19.2           py38ha98150c_1    conda-forge
    numpy_groupies            0.9.13             pyh9f0ad1d_1    conda-forge
    numpydoc                  1.1.0                      py_1    conda-forge
    olefile                   0.46               pyh9f0ad1d_1    conda-forge
    openssl                   1.1.1h               haf1e3a3_0    conda-forge
    packaging                 20.4               pyh9f0ad1d_0    conda-forge
    pandas                    1.1.3            py38h48ddb8e_2    conda-forge
    pandoc                    2.11.0.4             h22f3db7_0    conda-forge
    pandocfilters             1.4.2                      py_1    conda-forge
    parso                     0.7.0              pyh9f0ad1d_0    conda-forge
    pathtools                 0.1.2                      py_1    conda-forge
    patsy                     0.5.1                      py_0    conda-forge
    pcre                      8.44                 hb1e8313_0    conda-forge
    pexpect                   4.8.0            py38h32f6830_1    conda-forge
    pickleshare               0.7.5           py38h32f6830_1002    conda-forge
    pillow                    8.0.1            py38hef457fe_0    conda-forge
    pip                       20.2.4                     py_0    conda-forge
    pixman                    0.38.0            h01d97ff_1003    conda-forge
    pluggy                    0.13.1           py38h5347e94_3    conda-forge
    prompt-toolkit            3.0.8                      py_0    conda-forge
    psutil                    5.7.3            py38h94c058a_0    conda-forge
    ptyprocess                0.6.0                   py_1001    conda-forge
    pycairo                   1.20.0           py38h26abc9d_1    conda-forge
    pycodestyle               2.6.0              pyh9f0ad1d_0    conda-forge
    pycparser                 2.20               pyh9f0ad1d_2    conda-forge
    pydocstyle                5.1.1                      py_0    conda-forge
    pyflakes                  2.2.0              pyh9f0ad1d_0    conda-forge
    pygments                  2.7.2                      py_0    conda-forge
    pylint                    2.6.0            py38h32f6830_1    conda-forge
    pyopenssl                 19.1.0                   py38_0    conda-forge
    pyparsing                 2.4.7              pyh9f0ad1d_0    conda-forge
    pyqt                      5.12.3           py38hca2ab18_4    conda-forge
    pyqt5-sip                 4.19.18                  pypi_0    pypi
    pyqtchart                 5.12                     pypi_0    pypi
    pyqtwebengine             5.12.1                   pypi_0    pypi
    pyrsistent                0.17.3           py38h4d0b108_1    conda-forge
    pysocks                   1.7.1            py38h5347e94_2    conda-forge
    pytables                  3.6.1            py38h4e4ac5c_3    conda-forge
    python                    3.8.6           hcfdab8c_0_cpython    conda-forge
    python-dateutil           2.8.1                      py_0    conda-forge
    python-igraph             0.8.3            py38hcde0000_2    conda-forge
    python-jsonrpc-server     0.4.0              pyh9f0ad1d_0    conda-forge
    python-language-server    0.35.1                     py_0    conda-forge
    python.app                2                       py38_10  
    python_abi                3.8                      1_cp38    conda-forge
    pytz                      2020.1             pyh9f0ad1d_0    conda-forge
    pyyaml                    5.3.1            py38h94c058a_1    conda-forge
    pyzmq                     19.0.2           py38h2c785a9_2    conda-forge
    qdarkstyle                2.8.1              pyh9f0ad1d_1    conda-forge
    qt                        5.12.9               h717870c_0    conda-forge
    qtawesome                 1.0.1              pyh9f0ad1d_0    conda-forge
    qtconsole                 4.7.7              pyh9f0ad1d_0    conda-forge
    qtpy                      1.9.0                      py_0    conda-forge
    readline                  8.0                  h0678c8f_2    conda-forge
    requests                  2.24.0             pyh9f0ad1d_0    conda-forge
    rope                      0.18.0             pyh9f0ad1d_0    conda-forge
    rtree                     0.9.4            py38h08f867b_1    conda-forge
    scanpy                    1.6.0                      py_0    bioconda
    scikit-learn              0.23.2           py38hc63f23e_1    conda-forge
    scipy                     1.5.2            py38hf17e0cf_2    conda-forge
    seaborn                   0.11.0                        0    conda-forge
    seaborn-base              0.11.0                     py_0    conda-forge
    setuptools                50.3.0           py38h0dc7051_1  
    setuptools-scm            4.1.2              pyh9f0ad1d_0    conda-forge
    setuptools_scm            4.1.2                         0    conda-forge
    sinfo                     0.3.1                      py_0    conda-forge
    six                       1.15.0             pyh9f0ad1d_0    conda-forge
    snowballstemmer           2.0.0                      py_0    conda-forge
    sortedcontainers          2.2.2              pyh9f0ad1d_0    conda-forge
    sphinx                    3.2.1                      py_0    conda-forge
    sphinxcontrib-applehelp   1.0.2                      py_0    conda-forge
    sphinxcontrib-devhelp     1.0.2                      py_0    conda-forge
    sphinxcontrib-htmlhelp    1.0.3                      py_0    conda-forge
    sphinxcontrib-jsmath      1.0.1                      py_0    conda-forge
    sphinxcontrib-qthelp      1.0.3                      py_0    conda-forge
    sphinxcontrib-serializinghtml 1.1.4                      py_0    conda-forge
    spyder                    4.1.5            py38h32f6830_0    conda-forge
    spyder-kernels            1.9.4            py38h32f6830_0    conda-forge
    sqlite                    3.33.0               h960bd1c_1    conda-forge
    statsmodels               0.12.0           py38h174b24a_1    conda-forge
    stdlib-list               0.7.0            py38h32f6830_1    conda-forge
    tbb                       2020.3               h879752b_0  
    testpath                  0.4.4                      py_0    conda-forge
    texttable                 1.6.3              pyh9f0ad1d_0    conda-forge
    threadpoolctl             2.1.0              pyh5ca1d4c_0    conda-forge
    tk                        8.6.10               hb0a8c7a_1    conda-forge
    toml                      0.10.1             pyh9f0ad1d_0    conda-forge
    tornado                   6.0.4            py38h4d0b108_2    conda-forge
    tqdm                      4.51.0             pyh9f0ad1d_0    conda-forge
    traitlets                 5.0.5                      py_0    conda-forge
    ujson                     4.0.1            py38h11c0d25_1    conda-forge
    umap-learn                0.4.6            py38h32f6830_0    conda-forge
    urllib3                   1.25.11                    py_0    conda-forge
    watchdog                  0.10.3           py38h4d0b108_2    conda-forge
    wcwidth                   0.2.5              pyh9f0ad1d_2    conda-forge
    webencodings              0.5.1                      py_1    conda-forge
    wheel                     0.35.1             pyh9f0ad1d_0    conda-forge
    wrapt                     1.11.2           py38h4d0b108_1    conda-forge
    wurlitzer                 2.0.1                    py38_0  
    xz                        5.2.5                haf1e3a3_1    conda-forge
    yaml                      0.2.5                haf1e3a3_0    conda-forge
    yapf                      0.30.0             pyh9f0ad1d_0    conda-forge
    zeromq                    4.3.3                hb1e8313_2    conda-forge
    zipp                      3.4.0                      py_0    conda-forge
    zlib                      1.2.11            h7795811_1010    conda-forge
    zstd                      1.4.5                h0384e3a_2    conda-forge
    
  16. giovp commented on Nov 2, 2020

    @giovp
    Member

    @flying-sheep could you explain again what you need from ICB? Sorry not sure I understand. Thank you!

  17. giovp commented on Feb 10, 2021

    @giovp
    Member

    @lc822 could you post a reproducible example? maren seems to have solved it so it could be something else.

  18. mbuttner commented on Feb 12, 2021

    @mbuttner
    ContributorAuthor

    I hve to clarify: I tried out the fix provided above from @flying-sheep and it does the job for me, but the error persists on the master branch.

  19. giovp commented on Feb 12, 2021

    @giovp
    Member

    I just tried again with the reprex above and it works for me

    import scanpy as sc
    adata = sc.datasets.paul15()
    sc.pp.pca(adata)
    sc.pp.neighbors(adata)
    sc.tl.dpt(adata)
    sc.tl.paga(adata, groups='paul15_clusters')
    sc.pl.paga_path(adata, nodes=['1Ery'], keys=['Gata2', 'Btg2', 'Btg1'])

    image

    I'm on a separate branch but it's on par with current master

    scanpy==1.7.0rc2.dev25+g56303580.d20210212 anndata==0.7.4 umap==0.4.6 numpy==1.19.4 scipy==1.5.2 pandas==1.1.4 scikit-learn==0.24.1 statsmodels==0.12.1 python-igraph==0.8.3 leidenalg==0.8.2
    
    
  20. mbuttner commented on Feb 12, 2021

    @mbuttner
    ContributorAuthor

    I copied your code to a google colabs instance and ran into a Type Error similar to the one above:
    https://colab.research.google.com/drive/1LYxOAuNqaJHGfRjNjyluUHk9BFsmkWa4?usp=sharing

    Error message:

    TypeError                                 Traceback (most recent call last)
    <ipython-input-3-9abce68d1753> in <module>()
          4 sc.tl.dpt(adata)
          5 sc.tl.paga(adata, groups='paul15_clusters')
    ----> 6 sc.pl.paga_path(adata, nodes=['1Ery'], keys=['Gata2', 'Btg2', 'Btg1'])
    
    5 frames
    /usr/local/lib/python3.6/dist-packages/matplotlib/image.py in set_data(self, A)
        697                 or self._A.ndim == 3 and self._A.shape[-1] in [3, 4]):
        698             raise TypeError("Invalid shape {} for image data"
    --> 699                             .format(self._A.shape))
        700 
        701         if self._A.ndim == 3:
    
    TypeError: Invalid shape (3, 43, 1) for image data
    

    Versions:

    scanpy==1.7.0 
    anndata==0.7.5 
    umap==0.5.0 
    numpy==1.19.5 
    scipy==1.4.1 
    pandas==1.1.5 
    scikit-learn==0.22.2.post1 
    statsmodels==0.10.2 
    python-igraph==0.8.3 
    leidenalg==0.8.3
    
  21. giovp commented on Feb 12, 2021

    @giovp
    Member

    ...ok then let's wait for #1047 to get merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs info❔

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions