Entering edit mode
7.5 years ago
Medhat
9.8k
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? )
How about
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
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.
No, I was searching if there is a flag in bwa-mem to do that directly