extracting reads from bam file
1
0
Entering edit mode
7.0 years ago
KVC_bioinfo ▴ 600

Hello all,

I am trying to extract the reads falling into the particular region from a bam file. I am using the following command:

samtools view -b out.bam "chr10:regionstart-regionend" > region.bam

When I run this command I only get one read into the output. However, I can see many reads mapping in that particular region when I visualize the alignment in IGV.

Could someone help me identify what am I doing wrong?

Thank you in advance

bam fasta samtools • 3.1k views
ADD COMMENT
0
Entering edit mode

what is the version of samtools, did you try to re-index the bam ?

ADD REPLY
0
Entering edit mode

Program: samtools (Tools for alignments in the SAM format) Version: 0.1.19-44428cd

No I did not re-index it.

ADD REPLY
0
Entering edit mode

try to re-index; Use a newer version of samtools (I'm not sure 0.1.19 is able to handle supplementary alignments)

ADD REPLY
0
Entering edit mode

As pciifen said, region format is chr:start-stop, like "chr3:1000-2000"

ADD REPLY
2
Entering edit mode
7.0 years ago
pcliften ▴ 20

Are you really using a colon ":" between your regionstart and regionend numbers instead of a dash "-"?

ADD COMMENT
0
Entering edit mode

Sorry, its '-'

I made a typo there in thepost. I will correct it.

ADD REPLY

Login before adding your answer.

Traffic: 2133 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