Minimap2: keep alingments above a query fraction

Created on 13 Nov 2018  路  2Comments  路  Source: lh3/minimap2

Hi,
I am aligning ONT reads to a reference and I wonder if in minimap2 there is a way to discard (or filter out from the output file?) alignments that do not span a minimum fraction of the query length (e.g. 0.8).
On a similar note, how to minimize secondary and spurious alignments (e.g. to have good alignments for mpileup or similar)? -N 0 and -p 1.0?
thanks

feature-request question

All 2 comments

I wonder if in minimap2 there is a way to discard (or filter out from the output file?) alignments that do not span a minimum fraction of the query length (e.g. 0.8).

Please post-process the output alignment with your own script. I might consider to add an option in future.

how to minimize secondary and spurious alignments (e.g. to have good alignments for mpileup or similar)? -N 0 and -p 1.0?

Mpileup ignores secondary alignments. Please don't use -N0 -p1. This will lead to much worse alignment.

After a second thought, I wouldn't add an option to set a min fraction of the query length. For nanopore, there are often alignment splits due to long gaps. Such a filter would remove many of these alignments. It is hard to find a general way to filter alignments. Filtering is highly task dependent.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

a-89 picture a-89  路  7Comments

dangchenyuan picture dangchenyuan  路  5Comments

wangyugui picture wangyugui  路  3Comments

fbemm picture fbemm  路  5Comments

pterzian picture pterzian  路  3Comments