JetBrains-Research / jbr

JBR Genome Browser
https://doi.org/10.1093/bioinformatics/btab376
11 stars 0 forks source link

Number format exception while opening peaks overlap #4

Open iromeo opened 5 years ago

iromeo commented 5 years ago

Due to non-US local and "0,0" like string parsing. Example file:

"",Galaxy5-[MACS2_BB].bed,Galaxy7-[MACS2_CC].bed,Galaxy16-[SICER_BB].interval,Galaxy23-[SICER_CC].interval
Galaxy5-[MACS2_BB].bed,1.0,0.06963249516441006,1.0,0.8588007736943907
Galaxy7-[MACS2_CC].bed,0.02130249543517955,1.0,0.8928788800973828,1.0
Galaxy16-[SICER_BB].interval,0.07604895104895106,0.14947552447552448,1.0,0.6846153846153846
Galaxy23-[SICER_CC].interval,0.07092592592592592,0.19203703703703703,0.7437037037037038,1.0

Workaround: Add into jbr.l4j.ini -Duser.language=en -Duser.country=US

iromeo commented 5 years ago

see workarounds forcing US locale https://artyomovlab.wustl.edu/publications/supp_materials/SBW-epigenetics-StL/JVM.zip https://artyomovlab.wustl.edu/publications/supp_materials/SBW-epigenetics-StL/JBR%201.0.app.zip

iromeo commented 5 years ago

Better to fix rendering in overlap

iromeo commented 5 years ago

Bug is in 3-rd party library:rapaio.graphics.base.Wilkinson.getList() in list.add(Double.valueOf(String.format("%." + Math.abs(digits) + "f", i)));

Double.valueOf(..) expects only '.' as separator, but in russion locale it will be ',' Double.valueOf(String.format("%.4f", 0.123445)) Should be instead: NumberFormat.getInstance().parse(String.format("%.4f", 0.123445)).doubleValue()

E.g.: NumberFormat.getInstance(Locale.FRANCE).parse(String.format("%.4f", 0.123445)).doubleValue() works ok with "," as fract separator

See https://github.com/padreati/rapaio/issues/167

iromeo commented 5 years ago

Workaround applied to code and already work in #4787. Next - check rapaio library if the fix is available and works.

olegs commented 4 years ago

Should we recheck it once again?