0b81078213eff40174d357fbc8632ed7077baec4
braney
  Fri Aug 21 09:47:38 2020 -0700
changes to support the lack of native knownGene tables in an assembly.

diff --git src/hg/hgGene/otherOrgs.c src/hg/hgGene/otherOrgs.c
index 1c0f9c8..5ed612e 100644
--- src/hg/hgGene/otherOrgs.c
+++ src/hg/hgGene/otherOrgs.c
@@ -73,31 +73,33 @@
 struct hash *ra, *raList = readRa(raFile, NULL);
 struct otherOrg *otherOrgList = NULL, *otherOrg;
 for (ra = raList; ra != NULL; ra = ra->next)
     {
     if (otherOrgOptionalField(ra, "hide") == NULL)
 	{
 	if (checkDatabases(otherOrgOptionalField(ra, "databases")) 
 	    && sqlTablesExist(conn, otherOrgOptionalField(ra, "tables")))
 	    {
 	    AllocVar(otherOrg);
 	    otherOrg->priority = atof(otherOrgRequiredField(ra, "priority"));
 	    otherOrg->name = otherOrgRequiredField(ra, "name");
 	    otherOrg->shortLabel = otherOrgRequiredField(ra, "shortLabel");
 	    otherOrg->idSql = otherOrgRequiredField(ra, "idSql");
 	    otherOrg->idToProtIdSql = otherOrgOptionalField(ra, "idToProtIdSql");
-	    otherOrg->otherIdSql = otherOrgOptionalField(ra, "otherIdSql");
+            char *otherIdSql = otherOrgOptionalField(ra, "otherIdSql");
+            if (otherIdSql)
+                otherOrg->otherIdSql = replaceChars(otherIdSql, "KNOWNDB",sqlGetDatabase(conn));
 	    otherOrg->otherIdSql2 = otherOrgOptionalField(ra, "otherIdSql2");
 	    otherOrg->genomeUrl = otherOrgOptionalField(ra, "genomeUrl");
 	    otherOrg->sorterUrl = otherOrgOptionalField(ra, "sorterUrl");
 	    otherOrg->geneUrl = otherOrgOptionalField(ra, "geneUrl");
 	    otherOrg->otherUrl = otherOrgOptionalField(ra, "otherUrl");
 	    otherOrg->otherName = otherOrgOptionalField(ra, "otherName");
 	    otherOrg->db = otherOrgRequiredField(ra, "db");
 	    otherOrg->pepTable = otherOrgOptionalField(ra, "pepTable");
 	    otherOrg->geneTable = otherOrgOptionalField(ra, "geneTable");
 	    slAddHead(&otherOrgList, otherOrg);
 	    }
 	}
     }
 slSort(&otherOrgList, otherOrgCmpPriority);
 return otherOrgList;