d576a4c24545bb01c2ad375f733f4c82d98ab268 braney Mon Aug 3 12:17:04 2020 -0700 fix up dependency on kgXref diff --git src/hg/visiGene/vgGetText/vgGetText.c src/hg/visiGene/vgGetText/vgGetText.c index bc8c2c2..e404c49 100644 --- src/hg/visiGene/vgGetText/vgGetText.c +++ src/hg/visiGene/vgGetText/vgGetText.c @@ -1,30 +1,31 @@ /* vgGetText - Get text for full text indexing for VisiGene. * This is just the kgRef.description for known genes associated * with the visiGene genes. */ /* Copyright (C) 2013 The Regents of the University of California * See README in this or parent directory for licensing information. */ #include "common.h" #include "linefile.h" #include "hash.h" #include "localmem.h" #include "options.h" #include "jksql.h" #include "obscure.h" #include "visiGene.h" +#include "hdb.h" char *db = "visiGene"; void usage() /* Explain usage and exit. */ { errAbort( "vgGetText - Get text for full text indexing for VisiGene\n" "usage:\n" " vgGetText out.text genomeDb [genomeDb2 ...]\n" "Where the genomeDb is typically the latest human, the genomeDb2 is the latest mouse, and\n" "as more relevant organisms get added perhaps add genomeDb3 and so forth.\n" "options:\n" " -db=xxx - Use another database (default visiGene)\n" @@ -105,31 +106,32 @@ } void makeKnownGeneHashes(int knownDbCount, char **knownDbs) /* Create hashes containing info on known genes. */ { int i; knownTextHash = hashNew(18); uniProtToKnown = hashNew(18); refSeqToKnown = hashNew(18); aliasToKnown = hashNew(19); nameToKnown = hashNew(18); for (i=0; i<knownDbCount; i += 1) { char *gdb = knownDbs[i]; - struct sqlConnection *conn = sqlConnect(gdb); + char *knownDatabase = hdbDefaultKnownDb(gdb); + struct sqlConnection *conn = sqlConnect(knownDatabase); struct sqlResult *sr; char **row; sr = sqlGetResult(conn, NOSQLINJ "select kgID,geneSymbol,spID,spDisplayID,refseq,description from kgXref"); while ((row = sqlNextRow(sr)) != NULL) { char *kgID = cloneString(row[0]); touppers(kgID); touppers(row[1]); hashAdd(nameToKnown, row[1], kgID); hashAdd(uniProtToKnown, row[2], kgID); hashAdd(uniProtToKnown, row[3], kgID); hashAdd(refSeqToKnown, row[4], kgID); hashAdd(knownTextHash, kgID, cloneString(row[5]));