3d7162950c4263142f123cfb968f9e7be7dcf2c4 angie Mon Jul 31 16:29:23 2017 -0700 Fixing bug found by Cath in #19832 note-3. refs #19832 diff --git src/hg/lib/hgHgvs.c src/hg/lib/hgHgvs.c index 9e490a7..c76b795 100644 --- src/hg/lib/hgHgvs.c +++ src/hg/lib/hgHgvs.c @@ -1404,35 +1404,35 @@ } else { region->chromStart -= upstream; region->chromEnd += downstream; } limitToRange(region->chromStart, 0, psl->tSize); limitToRange(region->chromEnd, 0, psl->tSize); return region; } static struct bed *hgvsMapNucToGenome(char *db, struct hgvsVariant *hgvs, char **retPslTable) /* Return a bed6 with the variant's span on the genome and strand, or NULL if unable to map. * If successful and retPslTable is not NULL, set it to the name of the PSL table used. */ { +if (hgvs->type == hgvstGenomic) + return hgvsMapGDotToGenome(db, hgvs, retPslTable); char *acc = normalizeVersion(db, hgvs->seqAcc, NULL); if (isEmpty(acc)) return NULL; -if (hgvs->type == hgvstGenomic) - return hgvsMapGDotToGenome(db, hgvs, retPslTable); struct bed *region = NULL; char *pslTable = pslTableForAcc(db, acc); struct genbankCds cds; boolean gotCds = (hgvs->type == hgvstCoding) ? getCds(db, acc, &cds) : FALSE; if (pslTable && (hgvs->type != hgvstCoding || gotCds) && hTableExists(db, pslTable)) { int upstream = 0, downstream = 0; struct psl *mappedToGenome = mapPsl(db, hgvs, pslTable, acc, &cds, &upstream, &downstream); // As of 9/26/16, ncbiRefSeqPsl is missing some items (#13673#note-443) -- so fall back // on UCSC alignments. if (!mappedToGenome && sameString(pslTable, "ncbiRefSeqPsl") && hTableExists(db, "refSeqAli")) { char *accNoVersion = cloneFirstWordByDelimiter(acc, '.'); gotCds = (hgvs->type == hgvstCoding) ? getCds(db, accNoVersion, &cds) : FALSE; if (hgvs->type != hgvstCoding || gotCds)