report only primary alignment BWA-MEM
0
0
Entering edit mode
6.6 years ago
Medhat 9.7k

I can extract primary alignment from sam/bam file using

samtools view -F 260

where 260 = unmapped(4) + secondary alignment(256)

but is there is a way to report primary alignment only for single read in the first place? (-a option in bwa-mem will report all alignment. Is there is option (or way around) so the output file contains the primary aligned read only? )

bwa sequence alignment • 5.2k views
ADD COMMENT
1
Entering edit mode

How about

bwa mem (...) | samtools view -bh -f 0 -F 256
ADD REPLY
0
Entering edit mode

good, but this do not show any direct way (in bwa-mem itself) to do the job, I still need to depend on another tool

ADD REPLY
1
Entering edit mode

Yes, but is that a problem? I guess you are anyway not using SAM files, right? So one round of samtools is necessary in any case to get binary files.

ADD REPLY
0
Entering edit mode

No, I was searching if there is a flag in bwa-mem to do that directly

ADD REPLY

Login before adding your answer.

Traffic: 2747 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