Question: extracting reads from bam file
0
gravatar for KVC_bioinfo
2.7 years ago by
KVC_bioinfo450
Boston
KVC_bioinfo450 wrote:

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

samtools bam fasta • 1.8k views
ADD COMMENTlink modified 2.7 years ago • written 2.7 years ago by KVC_bioinfo450

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

ADD REPLYlink written 2.7 years ago by Pierre Lindenbaum129k

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

No I did not re-index it.

ADD REPLYlink written 2.7 years ago by KVC_bioinfo450

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

ADD REPLYlink written 2.7 years ago by Pierre Lindenbaum129k

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

ADD REPLYlink written 2.7 years ago by 10970492970
2
gravatar for pcliften
2.7 years ago by
pcliften20
pcliften20 wrote:

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

ADD COMMENTlink written 2.7 years ago by pcliften20

Sorry, its '-'

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

ADD REPLYlink written 2.7 years ago by KVC_bioinfo450
Please log in to add an answer.

Help
Access

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