I'm trying to run the "bedmap --mean" function to generate mean coverage in genomic windows.
My "ref.bed" looks like this (10bp disjoined windows):
region1 1 11
region1 11 21
region1 21 31
region1 31 41
region1 41 51
region1 51 61
region1 61 71
region1 71 81
region1 81 91
region1 91 101
My "map.bed" looks like this (bp-level sequencing coverage score, the first few regions have zero coverage but non-zero later):
region1 1 2 0
region1 2 3 0
region1 3 4 0
region1 4 5 0
region1 5 6 0
region1 6 7 0
region1 7 8 0
region1 8 9 0
region1 9 10 0
region1 10 11 0
The "bedmap --mean" is supposed to calculate the mean coverage in those 10bp windows. Instead, I only got one value for the first window and the rest reported "NAN":
region1 1 11 0.000000
region1 11 21 NAN
region1 21 31 NAN
region1 31 41 NAN
region1 41 51 NAN
region1 51 61 NAN
region1 61 71 NAN
region1 71 81 NAN
region1 81 91 NAN
This is the command I ran:
bedmap --faster --mean --delim "\t" --echo ref.bed map.bed
Both bed files are sorted by "sort -k1,1 -k2n,2". I also tried using 0-based system for the bed files but that didn't work, either.
I'm pretty new to bedops so could any bedops experts help me a bit here?
My "map" file only has four columns. Because they are bp-level bam coverage, it seemed trivial to give every bp a dummy name so I didn't do it. Now I know why the mapping function was not working properly. Thanks!