Question: Does samtools view only show reads that completely span the region?
1
gravatar for Noam Teyssier
2.2 years ago by
San Francisco
Noam Teyssier80 wrote:

I've got a bam file of paired-end illumina sequences mapped to a reference sequence and I was wondering if when I call the samtools view command if the results represent only reads that completely span over the region of interest or if it also included reads that intersect it by one or two base pairs.

If not are there any existing tools out there to only read thats completely span over the region of interest?

with this visual example of what I mean I would want to only include sequences like case_2 and exclude case_1:

                                  [===================Region-of-Interest=====================]

                 [---------------------------------------------------------------------------------------------------------] case_1
                               [-------------------------------------------------------------------------------------------------------------------] case_2

Thanks!

ADD COMMENTlink modified 2.2 years ago by h.mon29k • written 2.2 years ago by Noam Teyssier80
3
gravatar for h.mon
2.2 years ago by
h.mon29k
Brazil
h.mon29k wrote:

bedtools intersect with -f 1.0 or -F 1.0 should do what you want. Something like:

bedtools intersect -F 1.0 -a intervarls.bed -b file.bam

I am not an expert on bedtools, though, so you may have to tweak / correct this command.

ADD COMMENTlink written 2.2 years ago by h.mon29k
1

Hey h.mon,

bedtools is definitely the way to go, I ended up using

   bedtools coverage -f 1.0 -a intervals.bed -b file.bam -counts -e

Thanks for the help!

ADD REPLYlink written 2.2 years ago by Noam Teyssier80

Checkmark this as the accepted answer if they helped you :)

ADD REPLYlink written 2.2 years ago by swbarnes27.8k
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: 761 users visited in the last hour