Question: Removing Unmapped Reads from SAM File (SAMTools)
0
gravatar for gtasource
13 months ago by
gtasource60
gtasource60 wrote:

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?

samtools • 269 views
ADD COMMENTlink modified 13 months ago by swbarnes29.2k • written 13 months ago by gtasource60

Try it. If reads with a * in chromosome field are gone then you are all set.

ADD REPLYlink written 13 months ago by genomax92k

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.

ADD REPLYlink modified 13 months ago • written 13 months ago by gtasource60
0
gravatar for swbarnes2
13 months ago by
swbarnes29.2k
United States
swbarnes29.2k wrote:

Your way is fine. The -S is optional; the default behavior of samtools view is to output as sam, not bam.

ADD COMMENTlink written 13 months ago by swbarnes29.2k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1044 users visited in the last hour