samtools filtering
0
0
Entering edit mode
7 months ago
sansan96 ▴ 130

Hello everyone,

I mapped several reads to a reference genome with minimap2 and now I would like to filter the primary reads that have a certain % identity with the reference, is it possible to do this?

I found that samtools can filter the primary reads using the following command:

samtools view --F 0x100 -q 30 -b sorted.bam > primary_alignments.bam

However, I remain doubtful about the percentage of identity, can anybody help me?

The idea is to then run a bedtools to see if my reads cover the reference.

samtools • 610 views
ADD COMMENT
1
Entering edit mode
ADD REPLY
0
Entering edit mode

Thank you very much, I will see if I can install any of those options on my server. I was considering using this samtools command that filters out non-primary reads:

samtools view --F 0x100 -q 30 -b sorted.bam > primary_alignments.bam
ADD REPLY
0
Entering edit mode

this is not the filter you asked for

ADD REPLY
0
Entering edit mode

Sorry, I got confused in the first question,

ADD REPLY
0
Entering edit mode

You can add -e '[NM]/qlen >= 0.1' into the view command, but the definition of what constitutes +1 on mismatch for NM and on identity may be subtly different.

ADD REPLY

Login before adding your answer.

Traffic: 1956 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6