i think this is it!
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:
1 answer
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
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
Log in to answer this question.