Wish: Output reference position in matrix file

Issue #12 open
Jakob Nissen created an issue

During a current long and annoying debugging of my incoherent alignment results, I’ve found it useful to look at the matrix file to see the coverage and bases called. This gave rise to e.g. issue #11.

However, when you want to look at e.g. position 320 of the matrix file, it’s not so easy, because there are lots of coloumns marked “-”. In my case, these columns can outnumber the actual reference positions 4 to 1. That means there is no good way of answering: “Which row in the matrix file should I look at to look at position 320 in the alignment (or in the reference, whatever)”.

If the matrix file output another column giving the reference position, that would be much easier, and would allow me to just scroll through the matrix file and inspect it visually. It might be breaking for other users who might have set up scripts to parse the matrix file, but I think it’s worth considering.

Comments (4)

  1. ptlcc

    That would break backwards compatibility, but here is a one-liner that does the trick:

    gunzip -c test.mat.gz | awk '{if($0 ~ /^#/ || = ""){i = 0; print $0;} else if($1 ~ /-/){print i, $0;} else {i += 1; print i,$0;} }' | less

    Best,

    Philip

  2. Log in to comment