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?
Thanks!