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

mg.py - TypeError: Can't convert 'int' object to str implicitly #37

Closed darneson closed 7 years ago

darneson commented 7 years ago

I found the following bug in mg.py on line 613 when using the python package:

Traceback (most recent call last): File "/usr/local/Cellar/python3/3.5.1/Frameworks/Python.framework/Versions/3.5/lib/python3.5/tkinter/init.py", line 1549, in call return self.func(*args) File "/usr/local/bin/magic_gui.py", line 624, in _runTSNE n_iter=self.iterVar.get(), theta=self.angleVar.get()) File "/usr/local/lib/python3.5/site-packages/magic/mg.py", line 613, in run_tsne index=self.data.index, columns=[self._data_prefix + 'tSNE' + i for i in range(1, 3)]) File "/usr/local/lib/python3.5/site-packages/magic/mg.py", line 613, in index=self.data.index, columns=[self._data_prefix + 'tSNE' + i for i in range(1, 3)]) TypeError: Can't convert 'int' object to str implicitly

This can be fixed by converting i to string: self.tsne = pd.DataFrame(tsne.fit_transform(data),index=self.data.index, columns=[self._data_prefix + 'tSNE' + str(i) for i in range(1, 3)])

pkathail commented 7 years ago

Thanks for catching this, I'll add in this fix!