davidvi / pypanda

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

Zero expression error #1

Open choyichen opened 7 years ago

choyichen commented 7 years ago

It seems that when there are zero expression genes (expression values equal to zeros across all samples), pypanda will fail, e.g.,

numpy/lib/nanfunctions.py:1136: RuntimeWarning: Degrees of freedom <= 0 for slice.
  warnings.warn("Degrees of freedom <= 0 for slice.", RuntimeWarning)
step: 0, hamming: nan
running panda took: 106.649751902 seconds
Finished Panda run...
step: 0, hamming: nan
running panda took: 108.9292171 seconds
step: 0, hamming: nan
running panda took: 109.55636096 seconds
step: 0, hamming: nan
running panda took: 108.327214003 seconds
step: 0, hamming: nan
running panda took: 107.53530407 seconds
step: 0, hamming: nan
running panda took: 107.594507933 seconds
step: 0, hamming: nan
...

I think we should either pre-check or filter out those zeros genes.

mararie commented 7 years ago

Thanks for noticing this, Cho-Yi!

We could either filter these, or set the correlation coefficient of genes that are expressed in < 3 samples to 0, which is what we did for the GTEx networks. I prefer the latter, because then all genes from the expression dataset will be used, which will be less confusing to users.

Do you have time to implement this, David?

Thanks! Marieke

On Sun, Dec 18, 2016 at 3:29 PM, Cho-Yi (Joey) Chen < notifications@github.com> wrote:

It seems that when there are zero expression genes (expression values equal to zeros across all samples), pypanda will fail, e.g.,

numpy/lib/nanfunctions.py:1136: RuntimeWarning: Degrees of freedom <= 0 for slice. warnings.warn("Degrees of freedom <= 0 for slice.", RuntimeWarning) step: 0, hamming: nan running panda took: 106.649751902 seconds Finished Panda run... step: 0, hamming: nan running panda took: 108.9292171 seconds step: 0, hamming: nan running panda took: 109.55636096 seconds step: 0, hamming: nan running panda took: 108.327214003 seconds step: 0, hamming: nan running panda took: 107.53530407 seconds step: 0, hamming: nan running panda took: 107.594507933 seconds step: 0, hamming: nan...

I think we should either pre-check or filter out those zeros genes.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/davidvi/pypanda/issues/1, or mute the thread https://github.com/notifications/unsubscribe-auth/AFF-fewz8tzCcYn2S4QsA8EN0b95nhJOks5rJZemgaJpZM4LQOa4 .

lovenicole commented 5 months ago

Hi, I also encountered the same issue (hamming: nan).

image

Is this error message caused by the zero expression genes?

Further more, have you been able to implement it yet?