d09da69c7c010ccf108a96eeeebe1f8e28fd905d braney Mon Nov 26 14:57:03 2012 -0800 if we have hgg_gene, don't even bother looking for hgg_chrom in the cart because it might be grek from an earlier call. (#9668) diff --git src/hg/hgGene/hgGene.c src/hg/hgGene/hgGene.c index 714be36..2f28fa8 100644 --- src/hg/hgGene/hgGene.c +++ src/hg/hgGene/hgGene.c @@ -544,79 +544,51 @@ char *alias = genomeOptionalSetting("kgAlias"); if (alias != NULL && sqlTableExists(conn, alias)) { safef(query, sizeof(query), "select kgID from %s where alias = '%s'", alias, name); char *id = sqlQuickString(conn, query); if (id == NULL) hUserAbort("Couldn't find %s in %s.%s or %s.%s", name, database, mainTable, database, alias); return id; } else hUserAbort("Couldn't find %s in %s.%s", name, database, mainTable); return NULL; } static void getGenePosition(struct sqlConnection *conn) -/* Get gene position - from cart if it looks valid, - * otherwise from database. */ -{ -char *oldGene = hashFindVal(oldVars, hggGene); -char *oldStarts = hashFindVal(oldVars, hggStart); -char *oldEnds = hashFindVal(oldVars, hggEnd); -char *newGene = curGeneId; -char *newChrom = cartOptionalString(cart, hggChrom); -char *newStarts = cartOptionalString(cart, hggStart); -char *newEnds = cartOptionalString(cart, hggEnd); - -if (newChrom != NULL - && !sameString(newChrom, "none") - && newStarts != NULL - && newEnds != NULL) - { - if (IS_CART_VAR_EMPTY(oldGene) || IS_CART_VAR_EMPTY(oldStarts) || IS_CART_VAR_EMPTY(oldEnds) - || sameString(oldGene, newGene)) - { - curGeneChrom = newChrom; - curGeneStart = atoi(newStarts); - curGeneEnd = atoi(newEnds); - return; - } - } - -/* If we made it to here we can't find/don't trust the cart position - * info. We'll look it up from the database instead. */ +/* Get gene position from database. */ { char *table = genomeSetting("knownGene"); char query[256]; struct sqlResult *sr; char **row; safef(query, sizeof(query), "select chrom,txStart,txEnd from %s where name = '%s'" , table, curGeneId); sr = sqlGetResult(conn, query); row = sqlNextRow(sr); if (row != NULL) { curGeneChrom = cloneString(row[0]); curGeneStart = atoi(row[1]); curGeneEnd = atoi(row[2]); } else hUserAbort("Couldn't find %s in %s.%s", curGeneId, database, table); sqlFreeResult(&sr); } -} struct genePred *getCurGenePred(struct sqlConnection *conn) /* Return current gene in genePred. */ { char *track = genomeSetting("knownGene"); char table[64]; boolean hasBin; char query[256]; struct sqlResult *sr; char **row; struct genePred *gp = NULL; hFindSplitTable(sqlGetDatabase(conn), curGeneChrom, track, table, &hasBin); safef(query, sizeof(query), "select * from %s where name = '%s' " "and chrom = '%s' and txStart=%d and txEnd=%d"