Question: Extract unmapped reads using RNAME
gravatar for max_19
22 months ago by
max_19150 wrote:

I know I can use samtools view -f 4 to get all unmapped reads, but is there anyway to use RNAME (column 3) to do this? I noticed in my data that if read is unmapped, the RNAME is usually "*" but this is not always the case, for example, the below read is unmapped, and column 3 shows a value of 919.

MN00234:25:000H2KF73:1:11101:1073:6553  101     919     6150    0       *       =       6150    0       GATCGCTGCGGGGGGGGGGGGGGGG       AFFFFFA/AFFFFFAFFAFFF/FAF       YT:Z:UP

I would like to get all pairs where one or both mates are unmapped, using RNAME column. Any ideas?


bam sequence next-gen • 548 views
ADD COMMENTlink modified 22 months ago by finswimmer13k • written 22 months ago by max_19150
gravatar for cschu181
22 months ago by
cschu1812.5k wrote:

From the SAM specification:

Bit 0x4 is the only reliable place to tell whether the read is unmapped. If 0x4 is set, no assumptions can be made about RNAME, POS, CIGAR, MAPQ, and bits 0x2, 0x100, and 0x800.

I.e., no.

ADD COMMENTlink written 22 months ago by cschu1812.5k
Please log in to add an answer.


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