a4887527b333527019132f93bfcebab37e594b5a markd Sat Jun 10 12:17:57 2023 -0700 added tests for various mapping PSL type modes and fixed mode checking bug diff --git src/utils/pslMap/tests/makefile src/utils/pslMap/tests/makefile index d2cc8fb..19a1d92 100644 --- src/utils/pslMap/tests/makefile +++ src/utils/pslMap/tests/makefile @@ -1,30 +1,32 @@ 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 testSpGencode testTypeErr + kgProt negQChain testProtPort_ProtNa testProtPort_ProtProt \ + testProtNa_NaNa testProtProt_NaNa \ + testTypeErr # 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 @@ -85,32 +87,55 @@ 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 +# blocks. This tests block adjustments as well +# prot_prot prot_na cds_na +testProtPort_ProtNa: mkdirs ${pslMap} -inType=prot_prot -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 -# implied types not supported +# Mapping protein alignments with protein alignments, just done with swapped PSL as map +# This mainly tests options, as there is no difference between this and NA mappings. +# prot_prot prot_prot prot_prot +testProtPort_ProtProt: mkdirs + pslSwap input/spAnnotIso.psl output/$@.mapping.psl + ${pslMap} -inType=prot_prot -mapType=prot_prot input/spAnnotIso.psl output/$@.mapping.psl output/$@.psl + ${pslCheck} -verbose=0 output/$@.psl + diff -u expected/$@.psl output/$@.psl + +# prot_na na_na cds_na +testProtNa_NaNa: mkdirs + ${pslMap} -inType=prot_na -mapType=na_na input/spGencode.psl input/gencodeGenome.psl output/$@.psl + ${pslCheck} -verbose=0 output/$@.psl + diff -u expected/$@.psl output/$@.psl + +# prot_prot na_na cds_na +testProtProt_NaNa: mkdirs + ${pslMap} -inType=prot_prot -mapType=na_na input/spAnnotIso.psl expected/testProtNa_NaNa.psl output/$@.psl + ${pslCheck} -verbose=0 output/$@.psl + diff -u expected/$@.psl output/$@.psl + +# implied types will not work with prot_na map: +# prot_prot prot_na cds_na testTypeErr: mkdirs - if ${pslMap} -mapInfo=output/$@.mapinfo input/spAnnotIso.psl input/spGencode.psl output/$@.psl 2> output/$@.err ; then echo "Error: should have failed" >&2; false ; else true ; fi + if ${pslMap} input/spAnnotIso.psl input/spGencode.psl output/$@.psl 2> output/$@.err ; then echo "Error: should have failed" >&2; false ; else true ; fi diff expected/$@.err output/$@.err clean:: rm -rf output mkdirs: @${MKDIR} output