442e76e6f50e9c79f3dde2964d6f754511908e44
markd
  Sun May 14 17:32:02 2023 -0700
trim overlapping blocks as can happen when mapping protein to DNA alignments

diff --git src/utils/pslMap/tests/makefile src/utils/pslMap/tests/makefile
index fdf3dcf..32d405f 100644
--- src/utils/pslMap/tests/makefile
+++ src/utils/pslMap/tests/makefile
@@ -1,30 +1,30 @@
 kentSrc = ../../..
 include ${kentSrc}/inc/common.mk
 
 #pslMap = valgrind --tool=memcheck --num-callers=25 pslMap
 pslMap = ${DESTBINDIR}/pslMap
 pslSwap = ${DESTBINDIR}/pslSwap
 blastToPsl = ${DESTBINDIR}/blastToPsl
 pslCheck = ${DESTBINDIR}/pslCheck
 chainSwap = ${DESTBINDIR}/chainSwap
 
 all:
 
 test:	gapBoth mrnaMrnaMap mrnaMrnaXMap mrnaMapOver mrnaMapOverSwap \
 	mrnaMapOverChain mrnaMapOverChainSwap testMapFileWithInQName \
-	kgProt negQChain
+	kgProt negQChain testSpGencode
 
 # basic tests of protein -> mrna -> genome mapping
 kgProt: mkdirs
 	${blastToPsl} input/kgProtMRna.blast output/kgProtMRna.psl
 	${pslMap} output/kgProtMRna.psl input/kgMRna.psl output/$@.psl
 	${pslCheck} -verbose=0 output/$@.psl
 	diff -u expected/$@.psl output/$@.psl
 
 # this generated a gap in both query and target
 gapBoth: mkdirs
 	${blastToPsl} input/gapBothProtMRna.blast output/gapBothProtMRna.psl
 	${pslMap} output/gapBothProtMRna.psl input/gapBothMRna.psl output/$@.psl
 	${pslCheck} -verbose=0 output/$@.psl
 	diff -u expected/$@.psl output/$@.psl
 
@@ -83,20 +83,29 @@
 
 # retro/parent alignment through mRNA, with -simplifyMappingIds
 retroParent: mkdirs
 	${pslMap} -simplifyMappingIds -swapIn -mapInfo=output/$@.mapinfo input/retro.psl input/parent.psl output/$@.psl
 	${pslCheck} -verbose=0 output/$@.psl
 	diff -u expected/$@.psl output/$@.psl
 	diff -u expected/$@.mapinfo output/$@.mapinfo
 
 # -mapFileWithInQName
 testMapFileWithInQName: mkdirs
 	${pslMap} -mapFileWithInQName -mapInfo=output/$@.mapinfo input/gencode.src.psl input/gencode.blocks.qName-psl output/$@.psl
 	${pslCheck} -verbose=0 output/$@.psl
 	diff -u expected/$@.psl output/$@.psl
 	diff -u expected/$@.mapinfo output/$@.mapinfo
 
+# swissprot canonical features that were mapped to isoform with protein
+# isoforms aligned to gencode RNAs.  Mapping these resulted in overlapping
+# blocks.  This tests block adjustments.
+testSpGencode: mkdirs
+	${pslMap} -mapInfo=output/$@.mapinfo input/spAnnotIso.psl input/spGencode.psl output/$@.psl
+	${pslCheck} -verbose=0 output/$@.psl
+	diff -u expected/$@.psl output/$@.psl
+	diff -u expected/$@.mapinfo output/$@.mapinfo
+
 clean::
 	rm -rf output
 
 mkdirs:
 	@${MKDIR} output