I'm trying to use samtools view
to get reads falling in a given area
samtools view in.bam 'chr12:113428514-113428567' | grep "NB500938:125:HY3KMBGX3:4:21501:7767:16841"
NB500938:125:HY3KMBGX3:4:21501:7767:16841 99 chr12 113428559 255 151M = 113428600 169 CATAGTAATCACAATAGTGGATTTTTCCTCTATACCCGACAAAAACCCCAGAGTCTGACTAGAATCACCCCTGGGCAACTCAGACATTATGCCAATTCCTGGTGTCACACAAGAATCAACCATTCAAGTCATTGTTCCACATTCTGTTCCC AAAAAEEEEEEEEEEEEEEEEEEEEEEEE/EEEEEEEEEEAEEEEEEEEEEEEEEEEEAE/EEEEE/EEEEEEEEEA/EEAEEEE6EEEEE<EAEAEE<EEEEEEEEEEEAEEE/AEA<E6<AEEE<EAAEEEEEEAE/EEEEEEEAAA6< NH:i:1 HI:i:1 AS:i:277 nM:i:0 MD:Z:151
samtools view in.bam 'chr12:113428514-113428567' | grep "NB500938:125:HY3KMBGX3:2:22202:12932:7527"
NB500938:125:HY3KMBGX3:2:22202:12932:7527 99 chr12 113260099 255 138M169544N13M = 113260153 169730 CCTTCCCACTCTTTCCCCAGGTCACATTCATCGTGCCGGAAGGGAAGTAATCGTGAATCAGGCAGCCGATTATCACTGGGTCACTTGACAGAGCTGGTGGGAGTGTCAGTGGGTAGATGGTGGGATTTCTCGCAGACTCTGAGGAGACGGT AAAAAEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEAEEEE/EEEEEEEEEEEEEEAEEEEEEEAEEEE/<EEEEEEEEAEEEEEEEEEEEEEAEE/EEEEEEEEEEEEEEEE<<AAEAEEE/EEEEEAAAA6 NH:i:1 HI:i:1 AS:i:273 nM:i:3 MD:Z:95C55
The read name NB500938:125:HY3KMBGX3:4:21501:7767:16841
fall into the position chr12:113428514-113428567
While the read name NB500938:125:HY3KMBGX3:2:22202:12932:7527
fall into a skipped region from the reference (N letter in cigar)
I don't want from Samtools to output this read name, is there an option (I doubt) or an other tool that take care about the skipped regions ?
Samtools is just a check up, actually I use pysam in python but it works the same way...
Thanks
so which part of the read would you like to consider ? what is the logic ?
My reads are RNA, this read map on the reference from 113260099 to 113260237(113260099+138), then huge gap (169544N), then map from 113429781(113260099+138+169544) to 113429794(113260099+138+169544+13).
The logic is that this read map from 113260099 to 113260237 and from 113429781 to 113429794
My search is on 'chr12:113428514-113428567', my read does not cover this region but due to the 169544N Samtools output this read
i see