f3d3d03be73576bd1011a6b34e604c9c6566751b angie Fri Jul 21 20:55:57 2023 -0700 Move up NULL check of scoreStr before use (doh). refs MLQ #31782 diff --git src/hg/cgilib/annoFormatVep.c src/hg/cgilib/annoFormatVep.c index e741f9e..9941e60 100644 --- src/hg/cgilib/annoFormatVep.c +++ src/hg/cgilib/annoFormatVep.c @@ -672,38 +672,38 @@ { // Skip this row unless it contains the ensTxId found by getDbNsfpEnsTx // (but handle rare cases where dbNsfpSeqChange has "." for ensTxId, lame) char **words = row->data; if (differentString(ensTxId, ".") && differentString(words[ensTxIdIx], ".") && commaSepFindIx(ensTxId, words[ensTxIdIx]) < 0) continue; struct annoFormatVepExtraItem *extraItem = extraSrc->items; char *scoreStr = NULL; if (sameString(gpFx->gAllele, words[altAl1Ix])) scoreStr = words[score1Ix]; else if (sameString(gpFx->gAllele, words[altAl2Ix])) scoreStr = words[score2Ix]; else if (sameString(gpFx->gAllele, words[altAl3Ix])) scoreStr = words[score3Ix]; + if (isNotEmpty(scoreStr) && differentString(scoreStr, ".")) + { double score = atof(scoreStr); char prediction = '?'; if (score < 0.05) prediction = 'D'; else prediction = 'T'; - if (isNotEmpty(scoreStr) && differentString(scoreStr, ".")) - { afVepNewExtra(self, pGotExtra); fprintf(self->f, "%s=%c(%s)", extraItem->tag, prediction, scoreStr); } } } static void afVepPrintDbNsfpPolyPhen2(struct annoFormatVep *self, struct annoFormatVepExtraSource *extraSrc, struct annoRow *extraRows, struct gpFx *gpFx, boolean *pGotExtra) /* Match the allele from gpFx to the per-allele scores in each row from dbNsfpPolyPhen2. */ { // Look up column indices only once: static int aaPosIx=-1, altAl1Ix, hDivScore1Ix, hDivPred1Ix, hVarScore1Ix, hVarPred1Ix,