This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Minimap2: supplementary alignment PAF

Hi!

I am trying to parse PAF file generated from minimap2.1 to get primary and supplementary alignments of reads but excluding secundary alignments. In SAM format I would search for flags: 0, 16, 2048 and 2064. Unfortunately I don't currently find a nice way to get the same information out of PAF file.

Does anyone knows how to retrieve supplementary/primary but not secundary alignments from PAF file?

minimap2

1 answer

Hi,

According to minimap2 man page, the "tp" tag in the thirteenth column indicates the type of alignment: either primary, secondary or inversion.

Therefore, if you want only primary or supplementary, you can simply filter as follow :

awk '($13~"tp:A:P")  {print $0}' file.paf > filtered_file.paf

Log in to answer this question.