Get common segments from several segment files
1
0
Entering edit mode
17 months ago
heskett ▴ 110

Hi all! I have a bunch of CNA segment files from multiple samples and want to compare them, problem is all the segments have different start and stop sites in each sample. Is there a one liner pre-built tool to get a new list of segments that covers all the segments from each sample? For example see drawing:enter image description here

copy-number • 625 views
ADD COMMENT
1
Entering edit mode
17 months ago

look at bedtools multiinter

 $ bedtools multiinter -header -i a.bed b.bed c.bed -names A B C
 chrom  start   end num list    A   B   C
 chr1   6   8   1   A   1   0   0
 chr1   8   12  2   A,C 1   0   1
 chr1   12  15  3   A,B,C   1   1   1
 chr1   15  20  2   A,B 1   1   0
 chr1   20  22  1   B   0   1   0
 chr1   22  30  2   A,B 1   1   0
 chr1   30  32  1   B   0   1   0
 chr1   32  34  1   C   0   0   1
ADD COMMENT
0
Entering edit mode

i think this is it!

ADD REPLY
0
Entering edit mode

Okay I looked into it Pierre. This counts the number of files that have segments at each location, but it doesnt report features at each interval that I am interested in like copy number in this example. But I guess it does give the intervals that I want, so i could then do some kind of bedtools map or bedtools intersect to get the CN values from each file after that. thanks

ADD REPLY

Login before adding your answer.

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