d0054a39067a773d5342af78a80d964835d47a60
markd
  Thu Oct 16 13:28:21 2025 -0700
add bedToBigBed -fixScores to correct scores that are out-of-range or invalid

diff --git src/utils/bedToBigBed/tests/makefile src/utils/bedToBigBed/tests/makefile
index d4167478edf..f0f4b1cb689 100644
--- src/utils/bedToBigBed/tests/makefile
+++ src/utils/bedToBigBed/tests/makefile
@@ -1,20 +1,21 @@
 kentSrc = ../../..
 A = bedToBigBed
 include ../../../inc/common.mk
 
-test: testOddSorted testRgb testMultiInsAtEnd itemsRgb tabSep testBadChrom1 testBbSize1 testBbSize2 testDevStdin testStdin testCompress testNotSorted
+test: testOddSorted testRgb testMultiInsAtEnd itemsRgb tabSep testBadChrom1 testBbSize1 testBbSize2 testDevStdin testStdin \
+	testCompress testNotSorted testFixScores
 
 # use ! cmd 2> output/$@.err || (${shouldHaveFailed})
 shouldHaveFailed = echo "Error: command should have failed" >&2 && false
 
 fakeGenomeTwoBit = output/fakeGenome.2bit
 
 testBadChrom1:  outputDir
 	! ${BINDIR}/${A} input/colored.genbank.bed input/human.chrom.sizes.txt output/noFile.chromAlias.bb -tab -type=bed12+13 -as=input/bigGenePred.as 2> output/testBadChrom1.err || (${shouldHaveFailed})
 	diff expected/testBadChrom1.err output/testBadChrom1.err
 
 output/human.chromAlias.bb: outputDir
 	${BINDIR}/${A} input/human.chromAlias.bed input/human.chrom.sizes.txt output/human.chromAlias.bb   -tab -type=bed3+4 -as=input/chromAliasIndex.as -extraIndex=genbank,ensembl,ncbi,ucsc
 
 testBbSize1: outputDir output/human.chromAlias.bb
 	${BINDIR}/${A} input/colored.genbank.bed output/human.chromAlias.bb output/colored.genbank.bb -sizesIsChromAliasBb -tab -type=bed12+13 -as=input/bigGenePred.as 
@@ -89,23 +90,29 @@
 	bigBedToBed output/tabSep.bb output/test_tabSep.bed
 	diff input/tabSep.bed output/test_tabSep.bed
 
 testDevStdin: outputDir
 	cat  input/itemRgb.bed | (! ${BINDIR}/${A} -type=bed9 -as=input/itemRgb.as /dev/stdin input/chrom.sizes output/$@.bb 2> output/$@.err) || (${shouldHaveFailed})
 	diff expected/$@.err output/$@.err
 
 testStdin: outputDir
 	cat input/itemRgb.bed | (! ${BINDIR}/${A} -type=bed9 -as=input/itemRgb.as stdin input/chrom.sizes output/$@.bb 2> output/$@.err) || (${shouldHaveFailed})
 	diff expected/$@.err output/$@.err
 
 test2bitMissingSeq: outputDir ${fakeGenomeTwoBit}
 	! ${BINDIR}/${A} -tab -type=bed4 -as=input/tabSep.as -sizesIs2Bit input/tabSep.bed ${fakeGenomeTwoBit} output/tabSep.bb 2> output/$@.err || (${shouldHaveFailed})
 	diff expected/$@.err output/$@.err
 
+testFixScores: outputDir
+	${BINDIR}/${A} -fixScores -verbose=0 -type=bed9 -as=input/itemRgb.as input/badScores.bed input/chrom.sizes output/fixScores.bb
+	bigBedToBed output/fixScores.bb output/fixScores.bed
+	diff expected/fixScores.bed output/fixScores.bed
+
+
 ${fakeGenomeTwoBit}: outputDir input/fakeGenome.fa
 	faToTwoBit input/fakeGenome.fa $@ 
 
 clean::
 	@rm -rf output
 
 outputDir:
 	@${MKDIR} -p output