I am using BedTools Map operation to map the DNAse I signal of a cell type into some chromosome regions, by computing the mean on the third column
The command I use is the following:
$ bedtools map -a inputFile1.bed -b inputFile2.bedgraph -c 4 -o mean 1> outputFile
In the output file, I have real value for chrom1 -> chrom9, but strangely I find all dots for the other chromosome regions:
chr1 66660 66810 0.849999999999999977796
chr1 87640 87790 0.0500000000000000027756
chr1 96520 96670 0
chr1 115600 115750 115.527272727272702468
chr1 118840 118990 3.10000000000000008882
chr1 125340 125490 0
chr1 136280 136430 .
chr1 136960 137110 .
chr1 235600 235750 39.0559633027522963289
chr1 237020 237170 1.59999999999999986677
.... .... .... ....
.... .... .... ....
.... .... .... ....
chr10 134874600 134874750 .
chr10 134876820 134876970 .
chr10 134877940 134878090 .
chr10 134878160 134878310 .
chr10 134879420 134879570 .
chr10 134897500 134897650 .
chr10 134907140 134907290 .
chr10 134915640 134915790 .
chr10 134939120 134939270 .
chr10 134939280 134939430 .
chr10 134940860 134941010 .
.... .... .... .... .... ....
Do you know why this strange behavior happens?
Why don't I have all the values for chrom10...19, too?
sounds like a sorting problem. what are the outputs of:
you may need to sort one of them.
Output of the first:
Output of the second:
Any clue?
yes, a sorting problem. sort both with
sort -k1,1 -k2,2n $bed