There are existing tools that will take a BAM file and output a BED with read count in the score column (see e.g. regtools).
I want to adapt this to also assign a itemRgb column with different predefined RGB values for a series of cell type mappings, and also rescale the score column to have a maximum value of 1000.