Skip to content

Commit 31efb2e

Browse files
committed
Fix mummerplot space issue. Fixes #206
* Don't require a space before an alignment information in the output of mummer. It is a FASTA format, headers are already marked by '>', data shouldn't require a space. Used to break when indices were larger than 8 digits long.
1 parent 45516e6 commit 31efb2e

4 files changed

Lines changed: 14 additions & 4 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,5 @@ missing
1414
autom4te.cache
1515
compile
1616
test-driver
17+
compile_commands.json
18+
.deps

scripts/mummerplot.pl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ ($)
516516

517517
while ( <MFILE> ) {
518518
#-- match
519-
if ( /^\s+(\d+)\s+(\d+)\s+(\d+)\s+\S+\s+\S+$/ ) {
519+
if ( /^\s*(\d+)\s+(\d+)\s+(\d+)\s+\S+\s+\S+$/ ) {
520520
@align = ($1, $1, $2, $2, 100, $lenR, $lenQ, $idR, $idQ);
521521
$len = $3 - 1;
522522
$align[1] += $dR == 1 ? $len : -$len;
@@ -563,7 +563,7 @@ ($)
563563

564564
while ( <MFILE> ) {
565565
#-- 3 column match
566-
if ( /^\s+(\d+)\s+(\d+)\s+(\d+)$/ ) {
566+
if ( /^\s*(\d+)\s+(\d+)\s+(\d+)$/ ) {
567567
@align = ($1, $1, $2, $2, 100, 0, $lenQ, "REF", $idQ);
568568
$len = $3 - 1;
569569
$align[1] += $len;
@@ -573,7 +573,7 @@ ($)
573573
}
574574

575575
#-- 4 column match
576-
if ( /^\s+(\S+)\s+(\d+)\s+(\d+)\s+(\d+)$/ ) {
576+
if ( /^\s*(\S+)\s+(\d+)\s+(\d+)\s+(\d+)$/ ) {
577577
@align = ($2, $2, $3, $3, 100, 0, $lenQ, $1, $idQ);
578578
$len = $4 - 1;
579579
$align[1] += $len;

tests/Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ TEST_EXTENSIONS += .sh
7272
SH_LOG_COMPILER = %D%/testsh
7373

7474
# List of tests to run
75-
script_tests = %D%/save_load.sh %D%/batch.sh %D%/mummer.sh %D%/nucmer.sh %D%/sam.sh %D%/genome.sh %D%/delta-filter.sh
75+
script_tests = %D%/save_load.sh %D%/batch.sh %D%/mummer.sh %D%/nucmer.sh %D%/sam.sh %D%/genome.sh %D%/delta-filter.sh %D%/mummerplot.sh
7676
EXTRA_DIST += $(script_tests)
7777
TESTS += $(script_tests)
7878

tests/mummerplot.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
mummer -mum -b -c -n $D/small_genome.fa $D/small_reads_0.fa > small_0.mums
2+
3+
mummerplot -t png -p with_spaces small_0.mums
4+
sed 's/^ \+//' < small_0.mums > small_0_nospace.mums
5+
mummerplot -t png -p no_space small_0_nospace.mums
6+
7+
diff with_spaces.fplot no_space.fplot
8+
diff with_spaces.rplot no_space.rplot

0 commit comments

Comments
 (0)