BEDOPS bedmap - output with too many decimals
1
1
Entering edit mode
14 months ago
Tawny ▴ 170

I am running bedmap and my output has many zeros after the decimal. I don't expect to have fractional counts. I looked at the bedmap help page and am just wanting clarification. Will the --prec flag allow me to remove the decimal and everything after it? I was considering using --prec 0.

Here is the code I am running:

./bedmap --fraction-map 0.5 --ec --echo --skip-unmapped --sum --delim '\t' hg38_chromSizes_500bpBins.bed $FILEIN > $OUT

And an example of the output:

chr1    10000   10500   28124.000000
chr1    10500   11000   2950.000000
chr1    11000   11500   0.000000
chr1    11500   12000   0.000000
BEDOPS bedmap • 333 views
ADD COMMENT
0
Entering edit mode

I also notice that I am using --skip-unmapped and --echo which are probably counter productive.

ADD REPLY
3
Entering edit mode
14 months ago

Yes, that is what --prec is for. When processing signals, they are treated as floating point values internally, even if one starts with integers. If you expect output signal to be integers, it can be useful to specify --prec 0. See: https://bedops.readthedocs.io/en/latest/content/reference/statistics/bedmap.html#formatting-score-output

The --skip-unmapped option simply skips over any intervals in hg38_chromSizes_500bpBins.bed which do not overlap an interval in $FILEIN. If you expect that all intervals (bins) in hg38_chromSizes_500bpBins.bed are covered, then you do not need --skip-unmapped. However, it is often best to use this when using signal operations like --sum, etc. so that you skip intervals that would have no signal reported.

The --echo option will report intervals (bins) from hg38_chromSizes_500bpBins.bed, along with the results from --sum. If you want a BED file as output, then you would want to use --echo or one of the other interval-specific --echo-* options.

ADD COMMENT
1
Entering edit mode

Thank you very much for the thorough answer!

ADD REPLY

Login before adding your answer.

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