Question: Does samtools view only show reads that completely span the region?
1
gravatar for Noam Teyssier
16 months 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 16 months ago by h.mon27k • written 16 months ago by Noam Teyssier80
3
gravatar for h.mon
16 months ago by
h.mon27k
Brazil
h.mon27k 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 16 months ago by h.mon27k
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 16 months ago by Noam Teyssier80

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

ADD REPLYlink written 16 months ago by swbarnes26.2k
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: 1783 users visited in the last hour