SEQanswers

Go Back   SEQanswers > Bioinformatics > Bioinformatics



Similar Threads
Thread Thread Starter Forum Replies Last Post
About Samtools view -L Brace Bioinformatics 2 03-29-2013 08:33 PM
Samtools view region ftp DavyK Bioinformatics 1 09-13-2012 03:05 AM
samtools view cmccabe Bioinformatics 0 07-21-2012 09:07 AM
samtools view seq_lover Bioinformatics 2 04-27-2012 11:22 AM
Question about samtools view -r? syedsaid Bioinformatics 0 09-29-2011 02:00 AM

Reply
 
Thread Tools
Old 04-21-2013, 12:28 AM   #1
dietmar13
Senior Member
 
Location: Vienna

Join Date: Mar 2010
Posts: 107
Default samtools -view region (overlap?) question

hello,

does somebody know how overlap is definded for the
Quote:
samtools view region
function.

given the defined region # and four reads a-d:
Code:
                    ##############################
                aaaaaaaaaaaaaaaaa
                    bbbbbbbbbbbbbbbb
                               ccccccccccccccccccc
                                        ddddddddddddddd
which one is extracted: b and c or a-d?


thank you,

dietmar
dietmar13 is offline   Reply With Quote
Old 04-22-2013, 05:31 AM   #2
syfo
Just a member
 
Location: Southern EU

Join Date: Nov 2012
Posts: 103
Default

No idea, but it should not be difficult to test by browsing a real bal file with the "samtools tview" option and selecting the first region with a couple of overlapping reads. I bet on a-d
syfo is offline   Reply With Quote
Old 04-22-2013, 07:30 AM   #3
maubp
Peter (Biopython etc)
 
Location: Dundee, Scotland, UK

Join Date: Jul 2009
Posts: 1,543
Default

I think it should give you all of them - any reads within or overlapping the region requested.
maubp is offline   Reply With Quote
Old 04-22-2013, 09:20 AM   #4
dietmar13
Senior Member
 
Location: Vienna

Join Date: Mar 2010
Posts: 107
Default further question

Quote:
I think it should give you all of them - any reads within or overlapping the region requested.
this seems true, all overlapping were extracted.

does somebody know a script to fetch only those which start AND end inside a given range (###).

Code:
                    #################################
                aaaaaaaaaaaaaaaaa
                    bbbbbbbbbbbbbbbb
                               ccccccccccccccccccc
                                        ddddddddddddddd
eeee----splice------eeeeeeeeeee
here only: b and c
dietmar13 is offline   Reply With Quote
Old 04-22-2013, 09:48 AM   #5
swbarnes2
Senior Member
 
Location: San Diego

Join Date: May 2008
Posts: 912
Default

You might consider using BEDTools instead of samtools view. BEDTools can be given a .bed file of intervals, and a .bam file, and you could limit the reads to only those which completely overlap the intervals.
swbarnes2 is offline   Reply With Quote
Old 04-22-2013, 10:44 AM   #6
dietmar13
Senior Member
 
Location: Vienna

Join Date: Mar 2010
Posts: 107
Default @swbarnes

thank you, works great, but too slow with big bam files:

therefore preselection with samtools...

Code:
samtools view -b xxx.bam chr1:1000-2000 | bedtools intersect -f 1.0 -b region.bed -abam - | samtools view - > yyy.sam
dietmar13 is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off




All times are GMT -8. The time now is 04:23 PM.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Single Sign On provided by vBSSO