How to find all the region where one read is mapped in a bam file
1
0
Entering edit mode
5.0 years ago

I have a bam file and I want to get all the positions where a single read is mapped. I tired searching for the solution everywhere but what I am getting is the no of reads in a particular region (coverage). But I need just the opposite. I need the count of the number of regions where a single read is mapped.

For ex

SRR003467.28691 is mapped at 3 locations respective positions are 19000156 , 19000228, 19000878

NGS SAMTOOLS DNA Mapping sequencing • 1.6k views
ADD COMMENT
0
Entering edit mode

I want to get all the positions where a single read is mapped

This is not what you shew in your example

I suggest you to take look at bamCoverage and filter your result to select only location with one read of coverage. Then with those locations, you can extract the read name using samtools view

ADD REPLY
0
Entering edit mode
5.0 years ago

I'm not sure I understand entirely, but I think the following should work:

samtools view youralignment.bam | grep SRR003467.28691
ADD COMMENT
0
Entering edit mode

Of course, the poster should have told the aligner to output multimappers to multiple positions, not just one.

ADD REPLY

Login before adding your answer.

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