110329b274d3e77d46cedfea05ac44a20682719e braney Wed Feb 5 13:12:28 2020 -0800 use mitochondrial code on chrMT diff --git src/hg/lib/genePred.c src/hg/lib/genePred.c index dc2584b..7edbfc4 100644 --- src/hg/lib/genePred.c +++ src/hg/lib/genePred.c @@ -2376,31 +2376,31 @@ && isStopOrSelno && !isRealStop) aa = 'U'; else if (isRealStop && ((options & GENEPRED_TRANSLATE_STAR_INFRAME_STOPS) != 0)) aa = '*'; else aa = 'X'; } return aa; } static char* translateCds(char* chrom, char* cds, unsigned options) /* translate the CDS */ { int cdsLen = strlen(cds); char *prot = needMem((cdsLen/3)+1); -boolean isChrM = sameString(chrom, "chrM"); +boolean isChrM = isMito(chrom); int iCds, iProt; for (iCds = 0, iProt = 0; iCds < cdsLen; iCds+=3, iProt++) prot[iProt] = translateCodon(isChrM, cds+iCds, (iCds == cdsLen-3), options); return prot; } void genePredTranslate(struct genePred *gp, struct nibTwoCache* genomeSeqs, unsigned options, char **protRet, char **cdsRet) /* Translate a genePred into a protein. It can also return the CDS part of the * mRNA sequence. If the chrom is chrM, the mitochondrial translation tables are * used. If protRet or cdsRet is NULL, those sequences are not returned. */ { // note: code tests by genePredToProt bool haveFrames = (gp->exonFrames != NULL);