Hi,
I can successfully perform bedtools intersect for two 3-column BED files, but I want to perform the same intersect using a "file A" that contains multiple additional columns with values for a large number of samples formatted like so:
File A:
(chr) (start) (stop) (sample 1..2..3...4...etc..)
chr1 1001 1002 10 25 14 25
chr1 1006 1007 12 22 11 50
chr1 1012 1013 44 11 12 30
File B:
chr1 500 1010
chr1 2000 3000
Output:
chr1 1001 1002 10 25 14 25
chr1 1006 1007 12 22 11 50
Does anyone know if there is a way to use bedtools intersect, or bedtools intersect with another program, or any other code at all into perform this kind of intersect and retain the data in the additional columns in the output?
Thanks!
Dan
Have a look at
bedtools unionbedg.
Actually, the File A is an output of unionbedg. So it is a bedgraph with many columns and then I want to intersect it with a BED file with intervals. (Also File A has data for each single nucleotide whereas the BED file has intervals)
I added an example to the original post.