a1489c0fc1c99793e499e3915bc346b581664ad4 max Wed Jul 8 02:37:20 2026 -0700 Add support for all NCBI alternative genetic codes to dnautil Adds struct geneticCode plus the full set of NCBI translation tables (from gc.prt) so DNA can be translated with any genetic code, not just the Standard and Vertebrate Mitochondrial codes that were hardcoded. New API: geneticCodeForId/geneticCodeForName, lookupCodonInCode, isStopCodonInCode, dnaTranslateSomeInCode (explicit-handle, reentrant), and setDefaultGeneticCode for the process-global default. lookupCodon and friends are unchanged in behavior, still defaulting to the Standard code. The genetic code data lives in the auto-generated lib/geneticCodeTable.h, produced by oneShot/dnaGeneticCodes/dnaGeneticCodes.py from NCBI's gc.prt. Added a unit test under lib/tests. refs #16550 diff --git src/lib/tests/makefile src/lib/tests/makefile index 382934d1cf9..4edefea0e3e 100644 --- src/lib/tests/makefile +++ src/lib/tests/makefile @@ -1,38 +1,46 @@ kentSrc = ../.. include ../../inc/common.mk MYLIBDIR = ../../lib/${MACHTYPE} MYLIBS = ${MYLIBDIR}/jkweb.a BIN_DIR = bin/${MACHTYPE} pipelineTester = ${BIN_DIR}/pipelineTester test: errCatchTest htmlPageTest htmlExpandUrlTest pipelineTests dyStringTest \ mimeTests base64Tests quotedPTests safeTest hashTest fetchUrlTest gff3Test \ - tabixTest vcfTest hacTreeTest mmHashTest testSumDoubles jsonQueryTest + tabixTest vcfTest hacTreeTest mmHashTest testSumDoubles jsonQueryTest \ + dnaCodonTest rm -r output fetchUrlTest testSumDoubles @echo tested all mkdirs: ${MKDIR} output ${BIN_DIR} testSumDoubles: testSumDoubles.o ${MYLIBS} @${MKDIR} $(dir $@) ${CC} ${COPT} -o ./testSumDoubles testSumDoubles.o ${MYLIBS} ${L} +dnaCodonTest: dnaCodonTest.o ${MYLIBS} mkdirs + @${MKDIR} $(dir $@) + ${CC} ${COPT} -o ${BIN_DIR}/dnaCodonTest dnaCodonTest.o ${MYLIBS} ${L} + ${STRIP} ${BIN_DIR}/dnaCodonTest${EXE} + ${BIN_DIR}/dnaCodonTest > output/dnaCodonTest + diff expected/dnaCodonTest output/dnaCodonTest + errCatchTest: errCatchTest.o ${MYLIBS} mkdirs @${MKDIR} $(dir $@) ${CC} ${COPT} -o ${BIN_DIR}/errCatchTest errCatchTest.o ${MYLIBS} ${L} ${STRIP} ${BIN_DIR}/errCatchTest${EXE} ${BIN_DIR}/errCatchTest secret > output/errCatch.good diff expected/errCatch.good output/errCatch.good ${BIN_DIR}/errCatchTest bad > output/errCatch.bad diff expected/errCatch.bad output/errCatch.bad htmlExpandUrlTest: htmlExpandUrlTest.o ${MYLIBS} mkdirs @${MKDIR} $(dir $@) ${CC} ${COPT} -o ${BIN_DIR}/htmlExpandUrlTest htmlExpandUrlTest.o ${MYLIBS} ${L} ${STRIP} ${BIN_DIR}/htmlExpandUrlTest${EXE} ${BIN_DIR}/htmlExpandUrlTest > output/htmlExpandUrlTest 2>&1 diff expected/htmlExpandUrlTest output/htmlExpandUrlTest