Extract target region sequence with samtools but the output contains suquence exceeding the bed region
1
0
Entering edit mode
5.5 years ago
xusijiamed • 0

Hi, guys. I'm using "samtools view" to look at a sorted.bam. I tired setting a region

  1. Using a bed file
  2. Input the region in samtools command manually

(1)using a bed file

$ cat Gene.bed
chr19   11089362    11133830

$ samtools view -L Gene.bed [sorted.bam] | head

(2)input the region manually

$ samtools view [sorted.bam] "chr19:11089362-11133830" | head

Both methods gave me the sequence starts before "11089362"

b758e43b-3975-4d6e-a112-4e457161770a    0   chr19   **11089173**    60 5S43M1D181M2D9M6D185M3D49M3D13M1I2M3 ....

I'm confused. Could any one help me with this? Thank you very much!

bed samtools • 1.9k views
ADD COMMENT
0
Entering edit mode

Please show the output of head

ADD REPLY
0
Entering edit mode

Edited for formatting

ADD REPLY
0
Entering edit mode

"5S43M1D181M2D9M6D185M3D49M3D13M1I2M3" ~ 500bp By the way, you should notice that bed file is 0-based half-open but region argument for samtools should be 1-based inclusive.

ADD REPLY
2
Entering edit mode
5.5 years ago

When you ask samtools to output reads from a region, it outputs all reads that overlap that region. The read you show starts before 11,089,362, but finishes after it, thus the read overlaps with the region you specified.

ADD COMMENT

Login before adding your answer.

Traffic: 2577 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6