marbl / Winnowmap

Long read / genome alignment software
Other
250 stars 22 forks source link

Seeing multiple primary alignments per read #44

Open mwykes opened 7 months ago

mwykes commented 7 months ago

I've just use winnowmap v2.03 (installed using conda from the bioconda channel) to align reads to a haplotype resolved human assembly.

I used winnowmap --sv-off option.

As perhaps expected, each read has alignments on two contigs, the two contigs being maternal/paternal homologous pairs.

What surprised me is that both of these alignments are flagged as primary alignments in the resulting bam file. Filtering the bam file with samtools view -F 2308 does not reduce the number of alignments per read to one.

If the first half of the read was aligning to one haplotype and the second half of the read to another, I'd expect one to be primary and one supplementary.

However I'm seeing that the full length of each read is aligned in two places, so I'd expect one alignment per read to be secondary.

I can post-process the bam to update the flags such that the alignment with the higher mapping score is primary and lower is secondary, but as this might catch lots of users out, it would be great if winnowmap did this.