davidvi / pypanda

Python implementation of PANDA (Passing Attributes between Networks for Data Assimilation)
38 stars 11 forks source link

error in jupiter #6

Open SalvatoreRa opened 4 years ago

SalvatoreRa commented 4 years ago

Hi everyone,

I installed and just tried with the toy data

I am using python 3.7, I just updated all the libraries, windows 10 and anaconda.

from pypanda import Panda
from pypanda import Lioness
import pandas as pd
from pypanda.analyze_panda import AnalyzePanda
from pypanda.analyze_lioness import AnalyzeLioness

p = Panda('pypanda/ToyData/ToyExpressionData.txt', 'pypanda/ToyData/ToyMotifData.txt', 'pypanda/ToyData/ToyPPIData.txt', remove_missing=False)

I then received this error:

TypeError Traceback (most recent call last)

in ----> 1 p = Panda('pypanda/ToyData/ToyExpressionData.txt', 'pypanda/ToyData/ToyMotifData.txt', 'pypanda/ToyData/ToyPPIData.txt', remove_missing=False) ~\Anaconda3\lib\site-packages\pypanda-0.1-py3.7.egg\pypanda\panda.py in __init__(self, expression_file, motif_file, ppi_file, remove_missing) 29 #motif data to matrix 30 if self.motif_data is not None: ---> 31 self.__motif_data_to_matrix() 32 #ppi data to matrix 33 if self.motif_data is not None: ~\Anaconda3\lib\site-packages\pypanda-0.1-py3.7.egg\pypanda\panda.py in __motif_data_to_matrix(self) 81 idx_tfs = map(functools.partial(match, b = self.unique_tfs), self.motif_data[0]) 82 idx_genes = map(functools.partial(match, b = self.gene_names), self.motif_data[1]) ---> 83 idx = np.ravel_multi_index((idx_tfs, idx_genes), self.motif_matrix.shape) 84 self.motif_matrix.ravel()[idx] = self.motif_data[2] 85 return None TypeError: Iterator operand or requested dtype holds references, but the REFS_OK flag was not enabled thank you for your help
marouenbg commented 4 years ago

Hi @SalvatoreRa, pypanda is part of netZoo now https://netzoo.github.io/ Have a look at netZooPy https://github.com/netZoo/netZooPy with a jupyter tutorial on how to run panda https://github.com/netZoo/netZooPy/tree/master/tutorial/panda

mararie commented 4 years ago

the davidvi version of pypanda should still work, but only on Python 2.7

marouenbg commented 4 years ago

python2 will reach end of life on January 1 2020. netZooPy has migrated to python3 and is tested on 3.6, 3.7, and 3.8.

SalvatoreRa commented 4 years ago

Ok thank you very much, I will look to a netzoo. I tried to use on python 2.7 I encountered some errors the same