gtrichard / deepStats

deepStats: a stastitical toolbox for deeptools and genomic signals
GNU General Public License v3.0
32 stars 3 forks source link

Wilcoxon.pdf empty #14

Closed mkmwong closed 4 years ago

mkmwong commented 4 years ago

Hi, I have noticed that sometimes when I use deepStatus to generate plot, the wilcoxon plot pdf would be empt. It doesn't seem like a systematic issues since I only observe this sporadically. I've attached the script that I submitted and the output of the script as a tar ball - I was wondering is there are any specific reason as for why this is happening. Thank you! test.tar.gz

gtrichard commented 4 years ago

Hello Mandy, thank you for using deepStats!

I never encountered such a bug, but I was wondering if it has anything to do with the scaled regions. In my tests I focused on "peaks", did you see a consistent pattern of empty Wilcoxon plot with scaled regions matrices?

I checked your script and errors and identified the issue:

Error in grid.Call.graphics(C_setviewport, vp, TRUE) : 
  non-finite location and/or size for viewport
Calls: <Anonymous> ... lapply -> FUN -> push.vp.viewport -> grid.Call.graphics

Also I saw some warnings, this could be due to a dependency update. Do you mind sharing your the tools installed in your conda env with conda list?

I'll look into it today.

Thank you !

mkmwong commented 4 years ago

Hi thankyou for your quick response! I actually ran 100 of such files with the scaled regions, about 5 of them have empty Wilcoxon plot, so it's not all across the board. I did attach one that have an empty output so that maybe you can replicate the bug. I can also supply a tarball with non-empty Wilcoxon plot output.

On Thu, Mar 26, 2020 at 1:28 AM Gautier RICHARD notifications@github.com wrote:

Hello Mandy, thank you for using deepStats!

I never encountered such a bug, but I was wondering if it has anything to do with the scaled regions. In my tests I focused on "peaks", did you see a consistent pattern of empty Wilcoxon plot with scaled regions matrices?

I checked your script and errors and identified the issue:

Error in grid.Call.graphics(C_setviewport, vp, TRUE) : non-finite location and/or size for viewport Calls: ... lapply -> FUN -> push.vp.viewport -> grid.Call.graphics

I'll look into it today.

Thank you !

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/gtrichard/deepStats/issues/14#issuecomment-604295871, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHVYTTFHJG7G3WQECQEDKCDRJMG2DANCNFSM4LT2B7RQ .

gtrichard commented 4 years ago

Yes please ! I looked into it quickly and didn't really spot the issue... Perhaps with a working vs non working example I'll find it.

Thanks!

mkmwong commented 4 years ago

test_working.tar.gz Here is a example of the plot working. thank you so much!

gtrichard commented 4 years ago

Dear Mandy,

I found the issue, the wilcoxon plot is failing because of infinite values retrieved by the Wilcoxon Rank sum test (too significant). Currently I'm setting the upper plot limit to be the max of the values retrieved by the test, so the ylim upper bound is then set to Ìnf, the plotting is thus crashing.

I'm currently finding the solution to handle infinite values and will push a patch ASAP.

gtrichard commented 4 years ago

Fixed by https://github.com/gtrichard/deepStats/commit/5ac02868f29dbea276a7190116feeff773450e71

The patch is available in the new branch: https://github.com/gtrichard/deepStats/tree/dsCompareCurves_infvalues_fix

Can you please test it? Infinite values should appear as hitting the top border of the plotting area, delimited by the maximum non infinite value.

If you deepStats from a conda env, you can simply try this new branch with the following:

git clone -b dsCompareCurves_infvalues_fix --single-branch https://github.com/gtrichard/deepStats
cd deepStats
path=$(pwd)
conda activate deepStats
export PYTHONPATH=$path:$PYTHONPATH

After that dsCompareCurves will use the fixed branch version (but only for the current session).

Also, I will not make a new release just yet with this patch as I plan to make a single plot showing Wilcoxon + Bootstraps and displayed p-value when comparing only two curves :)

mkmwong commented 4 years ago

thank you so much! I'll try soon and report back.

On Wed, Apr 1, 2020 at 6:00 AM Gautier RICHARD notifications@github.com wrote:

Fixed by 5ac0286 https://github.com/gtrichard/deepStats/commit/5ac02868f29dbea276a7190116feeff773450e71

The patch is available in the new branch: https://github.com/gtrichard/deepStats/tree/dsCompareCurves_infvalues_fix

Can you please test it?

If you use it from a conda env, you can simply try this new branch with the following:

git clone -b dsCompareCurves_infvalues_fix --single-branch https://github.com/gtrichard/deepStats cd deepStats path=$(pwd) conda activate deepStats export PYTHONPATH=$path:$PYTHONPATH

After that dsCompareCurves will use this fixed branch version. Since you launched the command from a shell script with Slurm, please add the PYTHONPATH export at the beginning of the script.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/gtrichard/deepStats/issues/14#issuecomment-607234705, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHVYTTDHLS56F3A523VNVALRKM3IJANCNFSM4LT2B7RQ .

gtrichard commented 4 years ago

I guess the patch fixed your issue. I'm thus closing this issue.

All the best.