Skip to content

bigwigaverageoverbed average outputs fixed 3 decimal precision unlike Kent bigWigAverageOverBed #97

@rabyj

Description

@rabyj

bigwigaverageoverbed appears to format the average/mean output values (last two columns) with a fixed precision of three decimal places, whereas the UCSC bigWigAverageOverBed utility outputs variable floating-point precision.

This leads to a loss of precision compared to the UCSC/Kent implementation.

Example using the same bigWig and BED input (head -n10):

bigtools

rank1	8800	8800	2006.485	0.228	0.228
rank2	24000	24000	6108.989	0.255	0.255
rank3	13400	13400	5949.426	0.444	0.444
rank4	23800	23800	8905.968	0.374	0.374
rank5	5200	5200	1188.002	0.228	0.228
rank6	4400	4400	786.351	0.179	0.179
rank7	7600	7600	1841.650	0.242	0.242
rank8	11600	11600	2512.321	0.217	0.217
rank9	2200	2200	643.230	0.292	0.292
rank10	2400	2400	439.444	0.183	0.183

UCSC bigWigAverageOverBed (once sorted)

rank1	8800	8800	2006.48	0.22801	0.22801
rank2	24000	24000	6108.99	0.254541	0.254541
rank3	13400	13400	5949.43	0.443987	0.443987
rank4	23800	23800	8905.97	0.3742	0.3742
rank5	5200	5200	1188	0.228462	0.228462
rank6	4400	4400	786.351	0.178716	0.178716
rank7	7600	7600	1841.65	0.242322	0.242322
rank8	11600	11600	2512.32	0.216579	0.216579
rank9	2200	2200	643.23	0.292377	0.292377
rank10	2400	2400	439.444	0.183102	0.183102

Across 303114 regions, the number of digits after the decimal point differs substantially:

bigtools:
303114 3

Kent:
     30 0
      2 1
     41 2
    365 3
   3248 4
  46830 5
 229797 6
  22791 7
     10 8

This suggests bigwigaverageoverbed truncates or rounds values to 3 decimal places.

If the goal is to match the Kent utility behavior, it might be preferable to output full floating-point precision (or match the formatting used in bigWigAverageOverBed), since the current output may lose information.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions