Removing Unmapped Reads from SAM File (SAMTools)
I know, this question is everywhere. But I have yet to see somebody use the same samotols command as myself, and I wanted to double-check.
samtools view -S -f 4 aligned.sam > unmapped.sam
Yay?
• 2,268 views
•
link
1 answer
Your way is fine. The -S is optional; the default behavior of samtools view is to output as sam, not bam.
• 0 views
•
link
Log in to answer this question.
Try it. If reads with a
*in chromosome field are gone then you are all set.Just to clarify, the * in the chromosome signifies unmapped reads? So, in the above command, since I am extracting unmapped reads into a separate file, that file should have mostly reads with * in the chr field.