aba8125cb532df17beb7c7c9bc8467a43d09e3d6 braney Wed Feb 10 13:39:27 2016 -0800 changes to allow for GenBank metadata to be held in a common table. #16809 diff --git src/hg/hgTracks/retroGene.c src/hg/hgTracks/retroGene.c index 1b5ca94..cb35d13 100644 --- src/hg/hgTracks/retroGene.c +++ src/hg/hgTracks/retroGene.c @@ -1,20 +1,21 @@ /* Copyright (C) 2013 The Regents of the University of California * See README in this or parent directory for licensing information. */ #include "retroGene.h" +#include "genbank.h" /* bit set of labels to use */ enum {useOrgCommon = 0x01, useOrgAbbrv = 0x02, useOrgDb = 0x04, useGene = 0x08, useAcc = 0x10}; struct linkedFeatures *lfFromRetroGene(struct ucscRetroInfo *pg) /* Return a linked feature from a retroGene. */ { struct linkedFeatures *lf; struct simpleFeature *sf, *sfList = NULL; int grayIx = grayInRange(pg->score, 0, 1000); int *starts = pg->chromStarts, start; @@ -80,34 +81,34 @@ } char *getRetroParentSymbol(struct ucscRetroInfo *r, char *parentName) { struct sqlConnection *conn = hAllocConn(database); char cond_str[512]; char *geneSymbol = NULL; if (r != NULL) { if (hTableExists(database, "kgXref") ) { sqlSafefFrag(cond_str, sizeof(cond_str), "kgID='%s'", parentName); geneSymbol = sqlGetField(database, "kgXref", "geneSymbol", cond_str); } - if (hTableExists(database, "refLink") ) + if (sqlTableExists(conn, refLinkTable) ) { sqlSafefFrag(cond_str, sizeof(cond_str), "mrnaAcc = '%s'", r->refSeq); - geneSymbol = sqlGetField(database, "refLink", "name", cond_str); + geneSymbol = sqlGetField(database, refLinkTable, "name", cond_str); } } hFreeConn(&conn); return geneSymbol; } static unsigned getLabelTypes(struct track *tg) /* get set of labels to use */ { unsigned labelSet = 0; // label setting are on parent track char prefix[128]; safef(prefix, sizeof(prefix), "%s.label", tg->tdb->track); struct hashEl *labels = cartFindPrefix(cart, prefix);