a9c9cf2828c124535a1562f709bd4437b1bf60a2 braney Mon Jun 22 16:41:31 2020 -0700 starting on making hgGene use and external database for the know* tables diff --git src/hg/hgGene/pathways.c src/hg/hgGene/pathways.c index 27ef8ec..03e4492 100644 --- src/hg/hgGene/pathways.c +++ src/hg/hgGene/pathways.c @@ -288,56 +288,56 @@ char condStr[256]; char *origSpID; /* check the existence of kgXref table first */ if (!isRgdGene(conn)) { if (!sqlTableExists(conn, "kgXref")) return(0); } else { if (!sqlTableExists(conn, "rgdGene2Xref")) return(0); } if (isRgdGene(conn)) { sqlSafefFrag(condStr, sizeof(condStr), "name='%s'", geneId); - spID = sqlGetField(database, "rgdGene2ToUniProt", "value", condStr); + spID = sqlGetField(sqlGetDatabase(conn), "rgdGene2ToUniProt", "value", condStr); } else { sqlSafefFrag(condStr, sizeof(condStr), "kgID='%s'", geneId); - spID = sqlGetField(database, "kgXref", "spID", condStr); + spID = sqlGetField(sqlGetDatabase(conn), "kgXref", "spID", condStr); } if (spID != NULL) { origSpID = cloneString(spID); /* convert splice variant UniProt ID to its main root ID */ chp = strstr(spID, "-"); if (chp != NULL) *chp = '\0'; if (!isRgdGene(conn)) { sqlSafef(query, sizeof(query), "select count(*) from %s.spReactomeEvent, %s.spVariant, %s.kgXref where kgID='%s' and kgXref.spID=variant and variant = '%s' and spReactomeEvent.spID=parent", - PROTEOME_DB_NAME, PROTEOME_DB_NAME, database, geneId, origSpID); + PROTEOME_DB_NAME, PROTEOME_DB_NAME, sqlGetDatabase(conn), geneId, origSpID); } else { sqlSafef(query, sizeof(query), "select count(*) from %s.spReactomeEvent, %s.spVariant, %s.rgdGene2ToUniProt where name='%s' and value=variant and variant = '%s' and spReactomeEvent.spID=parent", - PROTEOME_DB_NAME, PROTEOME_DB_NAME, database, geneId, origSpID); + PROTEOME_DB_NAME, PROTEOME_DB_NAME, sqlGetDatabase(conn), geneId, origSpID); } ret = sqlQuickNum(conn, query); } return ret; } struct pathwayLink pathwayLinks[] = { { "kegg", "KEGG", "KEGG - Kyoto Encyclopedia of Genes and Genomes", "keggPathway keggMapDesc", keggCount, keggLink}, { "bioCyc", "BioCyc", "BioCyc Knowledge Library", "bioCycPathway bioCycMapDesc", bioCycCount, bioCycLink},