dphansti / mango

chia pet analysis software
25 stars 15 forks source link

Fix to distance calculation actually breaks pipeline #17

Open pjmichalski opened 7 years ago

pjmichalski commented 7 years ago

Hi, I've been using Mango for 5-6 months now, pretty much without issue. I recently upgraded to the latest version, and suddenly I get the following error:

Error in (bedpe[, 5] - bedpe[, 2])[, 1] : incorrect number of dimensions

The error definitely comes from the file plotdistancedistribution.R. It looks like this line was changed in the code a few months ago. Any idea why the old code worked and the new code doesn't? Does something else need to be changed to make the new code work?

Thanks for any help.

pjmichalski commented 7 years ago

I think I discovered the source of the problem. On our linux cluster, the default version of R has version 0.2.2 of readr, which gives the type of bedpe[,5] as "integer." When using the latest version of readr, 1.0.0, I get type of bedpe[,5] as "list." You might want to add an if statement to check the readr version, or state that you need the latest version in the install instructions.