mummer4/mummer

Mummerplot fails with some .mum files due to whitespace issue

margaretc-ho opened this issue · 1 comments

I'm encountering an issue where mummerplot is giving me an error when I am trying to use it to plot a mummer generated .mums file. The error I get is

Reading mummer file filename.mums (use mummer -c)
ERROR: Could not parse ref_v_query.mums
10016440       716       288

from the command

mummer -mum -b -c -n ${ref_fa} ${query_fa} > ref_v_query.mums
mummerplot -p ref_v_query ref_v_query.mums

From my searching it seems be caused by an issue that dates back some time but is caused by a command in mummerplot that is still in the latest version of mummer
issue: https://www.seqanswers.com/forum/bioinformatics/bioinformatics-aa/17641-mummerplot-error
mummerplot in mummer4 has it: https://github.com/mummer4/mummer/blob/master/scripts/mummerplot.pl

basically, this part of code
if ( /^\s+(\d+)\s+(\d+)\s+(\d+)$/ ) {
ought to be
if ( /^\s*(\d+)\s+(\d+)\s+(\d+)$/ ) {
and it happens twice in the code

"It search[es] for a line that begin with one or more space, but when you have a start superior to 9999999, this space do not exist anymore. So if you change '+' by '*' it search for 0 or more spaces."

I tried to fix the file to add a space in the mums file to go around this issue but it didn't work. It seems that the mummerplot code has to be fixed for this issue not to occur. Pretty annoying because then everything has to be recompiled from source.

This is now fixed in the development branch.