SEQanswers

Go Back   SEQanswers > Bioinformatics > Bioinformatics



Similar Threads
Thread Thread Starter Forum Replies Last Post
Is it possible to convert a SNP.txt to a bed file or get a SNP.bed from samtools? Ling Bioinformatics 7 04-02-2015 06:17 AM
Updated How to convert .txt file to .bed .GFF or .BAR file format, forevermark4 Bioinformatics 2 06-30-2014 05:02 AM
Is there a BED file format validator? Does a BED file have to be sorted position? LauraSmith Bioinformatics 3 05-21-2013 11:54 AM
Does standalone Blat can take multiple chromosome in one command line, find matches? ketan_bnf Bioinformatics 2 06-07-2012 12:12 AM
program to find common secondary structure of RNA from many sequences zhlyang Bioinformatics 3 06-17-2010 07:10 PM

Reply
 
Thread Tools
Old 01-20-2012, 06:09 AM   #1
epi
Member
 
Location: USA

Join Date: Jan 2012
Posts: 38
Default find overlaps/common in multiple bed file

Does anyway have experience to find commonalies (or overlaps) between bed files. I have 4 bed files and want to find what intervals are common to all.

And I don't have any rigid criteria for overlap, any intersection will do.

Appreciate any answers.
epi is offline   Reply With Quote
Old 01-20-2012, 07:01 AM   #2
dpryan
Devon Ryan
 
Location: Freiburg, Germany

Join Date: Jul 2011
Posts: 3,480
Default

Have a look at bedtools, specifically the intersectBed utility.
dpryan is offline   Reply With Quote
Old 01-20-2012, 07:10 AM   #3
GenoMax
Senior Member
 
Location: East Coast USA

Join Date: Feb 2008
Posts: 7,077
Default

http://pypi.python.org/pypi/pybedtools is a python extension of the bedtools that was mentioned in the post #2 by dpryan.
GenoMax is offline   Reply With Quote
Old 01-20-2012, 01:32 PM   #4
husamia
Member
 
Location: cinci

Join Date: Apr 2010
Posts: 66
Default

Quote:
Originally Posted by epi View Post
Does anyway have experience to find commonalies (or overlaps) between bed files. I have 4 bed files and want to find what intervals are common to all.

And I don't have any rigid criteria for overlap, any intersection will do.

Appreciate any answers.
I mentioned the wrong function I meant to mention Galaxy with the Intersect function in the operate on genomic intervals functions
here is example


http://main.g2.bx.psu.edu/

Last edited by husamia; 01-23-2012 at 06:03 AM. Reason: corrected intersect instead of merege for overlapping bed files
husamia is offline   Reply With Quote
Old 01-23-2012, 05:55 AM   #5
epi
Member
 
Location: USA

Join Date: Jan 2012
Posts: 38
Default

Quote:
Originally Posted by dpryan View Post
Have a look at bedtools, specifically the intersectBed utility.
Thanks for response everyone !

I could implement intersectBed as pairwise. And to find common among 4, I can do multiple pairwise, but it seems there is some chance for false negatives.

I dint get chance to look at the python script so far, I wonder if that adresses this issue.
epi is offline   Reply With Quote
Old 01-23-2012, 06:03 AM   #6
husamia
Member
 
Location: cinci

Join Date: Apr 2010
Posts: 66
Default

I mentioned the wrong function, I modified my response above to reflect the correct reference function. Sorry for confusion
husamia is offline   Reply With Quote
Old 01-23-2012, 06:29 AM   #7
dpryan
Devon Ryan
 
Location: Freiburg, Germany

Join Date: Jul 2011
Posts: 3,480
Default

Quote:
Originally Posted by epi View Post
Thanks for response everyone !

I could implement intersectBed as pairwise. And to find common among 4, I can do multiple pairwise, but it seems there is some chance for false negatives.

I dint get chance to look at the python script so far, I wonder if that adresses this issue.
The python interface isn't very different from direct command line usage and I would suspect produces the same results. I also don't see how you'd get a false negative, provided you actually want regions existing in all of the bed files.
dpryan is offline   Reply With Quote
Old 01-23-2012, 08:04 AM   #8
epi
Member
 
Location: USA

Join Date: Jan 2012
Posts: 38
Default

Quote:
Originally Posted by dpryan View Post
The python interface isn't very different from direct command line usage and I would suspect produces the same results. I also don't see how you'd get a false negative, provided you actually want regions existing in all of the bed files.
Thanks again for responding. I realize i did not state my objective well enough.
This is chip-seq analysis for which I have bed files (peaks). There could be a situation when peak 1 intersect peak 3 at 5' and peak 2 intersect peak 3 at 3`. but peak 1 and peak 2 do not intersect.
Read Peak1, Peak2 and Peak3 coming form Samples 1,2 and 3 please.
intersectBed will not reveal these peaks on my first paiwise comparison (peak1 and peak2) so it will be gone. Logically, it seems they come from same region so I was wondering if there is a tool that could capture those.

I must mention that this is not a real example, just i theoretical possibility which crossed my mind. May b I am just too obsessed over it
epi is offline   Reply With Quote
Old 01-23-2012, 10:38 AM   #9
mgogol
Senior Member
 
Location: Kansas City

Join Date: Mar 2008
Posts: 197
Default

You want multiIntersectBed...

http://biostar.stackexchange.com/que...iple-bed-files
mgogol is offline   Reply With Quote
Old 01-24-2012, 12:41 AM   #10
arvid
Senior Member
 
Location: Berlin

Join Date: Jul 2011
Posts: 156
Default

Quote:
Originally Posted by epi View Post
Read Peak1, Peak2 and Peak3 coming form Samples 1,2 and 3 please.
intersectBed will not reveal these peaks on my first paiwise comparison (peak1 and peak2) so it will be gone. Logically, it seems they come from same region so I was wondering if there is a tool that could capture those.
You can include both A and B regions in the output from intersectBed (e.g. with -wo), merge them with mergeBed and then intersect the merged output to the next sample (to "grow" the overlapping regions).
arvid is offline   Reply With Quote
Old 01-24-2012, 06:00 AM   #11
epi
Member
 
Location: USA

Join Date: Jan 2012
Posts: 38
Default

Quote:
Originally Posted by mgogol View Post
bullseye !!

Looks like can the job, will try it out ...
appreciate your response
epi is offline   Reply With Quote
Old 02-05-2013, 05:47 AM   #12
sjneph
Junior Member
 
Location: seattle, wa

Join Date: Jan 2013
Posts: 2
Default

If you prefer a much more scalable solution that can do this simple intersection (and any other set-like operation) on any number of bedfiles at once, check out BEDOPS.

http://code.google.com/p/bedops/
sjneph 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 02:49 AM.


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