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
341 stars 97 forks source link

module 'magic' has no attribute 'mg' #135

Closed jphfisher closed 6 years ago

jphfisher commented 6 years ago

Hi, I recently installed magic on a new machine, and whilst the code below worked fine before, now I'm getting the AttributeError shown. I've tried re-installing magic using the directions in the README, and I'm running version 1.2.1 in python3.6 Any ideas? Jon

scdata = magic.mg.SCData(df, 'sc-seq')

AttributeError: module 'magic' has no attribute 'mg'

scottgigante commented 6 years ago

Hi @jphfisher ,

The MAGIC API changed in version 1.0. I'll point you to the usage instructions in the README: magic.mg no longer exists, you can just apply magic to your data as you would with any sklearn estimator.

import magic
magic_operator = magic.MAGIC()
X_magic = magic_operator.fit_transform(df)

Read more: https://github.com/KrishnaswamyLab/MAGIC#quick-start

Feel free to open another issue if you have any problems migrating to the new API.