KrishnaswamyLab / MAGIC

MAGIC (Markov Affinity-based Graph Imputation of Cells), is a method for imputing missing values restoring structure of large biological datasets.
GNU General Public License v2.0
347 stars 96 forks source link

Animate MAGIC error #214

Open JLTrincado opened 2 years ago

JLTrincado commented 2 years ago

Dear authors,

I'm using this amazing package in python (MAGIC version 3.0.0). When running animate_magic method, I encounter the following error:

magic.plot.animate_magic(data, gene_x='CXCR3', gene_y='IL2RB', operator=magic_op, t_max=12)

IndexError: only integers, slices (`:`), ellipsis (`...`), numpy.newaxis (`None`) and integer or boolean arrays are valid indices
---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
<command-877177666815040> in <module>
      1 # make the font size bigger
      2 plt.rc('font', size=16)
----> 3 magic.plot.animate_magic(data, gene_x='CXCR3', gene_y='IL2RB', operator=magic_op, t_max=12)

/databricks/python/lib/python3.8/site-packages/magic/plot.py in animate_magic(data, gene_x, gene_y, gene_color, t_max, delay, operator, filename, ax, figsize, s, cmap, interval, dpi, ipython_html, verbose, **kwargs)
    129     data_magic = scprep.utils.toarray(data_magic)
    130     c = data_magic[gene_color] if gene_color is not None else None
--> 131     sc = ax.scatter(data_magic[gene_x], data_magic[gene_y], c=c, cmap=cmap)
    132     ax.set_title("t = 0")
    133     ax.set_xlabel(gene_x)

IndexError: only integers, slices (`:`), ellipsis (`...`), numpy.newaxis (`None`) and integer or boolean arrays are valid indices

Is there any deprecation that could be affecting this method?

Thanks for your help,

Juanlu.