strobealign icon indicating copy to clipboard operation
strobealign copied to clipboard

`-N 1` outputs no extra alignment

Open marcelm opened this issue 2 years ago • 2 comments

By default, StrobeAlign outputs no secondary alignments (-N 0). I’ve tried to see what happens on the test dataset when using -N 1 and -N 2. The sixth read (SRR1377138.6) is the first to have a secondary alignment. I show an excerpt from the SAM file for it below. This is done on single-end reads.

With -N 0:

SRR1377138.6    0       NC_001422.1     649     8 ...

With -N 1:

SRR1377138.6    0       NC_001422.1     649     0 ...

With -N 2:

SRR1377138.6    0       NC_001422.1     649     0 ...
SRR1377138.6    256     NC_001422.1     649     255 ...

There are some things that I didn’t expect:

  • No extra alignment is shown with -N 1. -N 2 is required for that (as if -N would limit the total number of alignments).
  • The mapping quality of the primary alignment changes from 8 to 0, but perhaps that is another manifestation of #52.

(The mapping quality for the second alignment is 255, but that is ok since 255 means "unavailable".)

marcelm avatar Sep 09 '22 11:09 marcelm

Spontaneous thoughts:

  1. From your example it looks like -N n outputs n - 1 extra alignments :)
  2. the decrease in quality is probably because we do not consider an extra alignment to score against in the -N 0 case, but it is weird that -N 1 does this relative scoring against the second best alignment, but still does not output it (could of course be because of the off-by-one bug in point 1)
  3. I remember thinking about the 255 for MAPQ. I think I chose this reporting to be consistent with Bowtie2.

ksahlin avatar Sep 09 '22 12:09 ksahlin

Perhaps an obvious statement, but this issue made me think of a straightforward analysis for sanity check of the MAPQ outputs, as discussed in #25 and #52. If strobealign is run with -N > 1, we could simply check whether the MAPQ score is consistent with the difference is the primary and secondary alignment cigars.

ksahlin avatar Sep 14 '22 13:09 ksahlin