Hello,
I am mapping Oxford nanopore reads to very complex region that has repeats and genome rearrangements. I am using minimap2 for the mapping. I would like to set up a parameter where reads where atleast 90% of a read should be mapped to the reference and if not, the reads should be filtered. I have tried several parameters in minimap2
minimap2 -ax map-ont -N5 --no-long-join --secondary=no -t 20 --MD --sam-hit-only ./input.fasta ../clean_input.fastq.gz | samtools view -bS -@ 20 - | samtools sort -@ 20 - -o output.bam`
I also tried the -r
parameter in minimap2 but it didnt seem to work. I saw in a couple of posts that you can do samtools filtering with "NM" however it only takes the number of mismatches and not a percentage.
Can someone help me to filter reads of alignment rate as 90%?
Thanks!