4a44c9a604efe7b8a0b93c6a220c484a61d9892b
braney
  Tue Sep 24 13:30:13 2013 -0700
more tweaks to optionally add version numbers to id's in genbank tables
diff --git src/hg/hgc/hgc.c src/hg/hgc/hgc.c
index 8595ce4..eb52d2a 100644
--- src/hg/hgc/hgc.c
+++ src/hg/hgc/hgc.c
@@ -5665,31 +5665,31 @@
 	}
     }
 }
 
 struct psl *getAlignments(struct sqlConnection *conn, char *table, char *acc)
 /* get the list of alignments for the specified acc */
 {
 struct sqlResult *sr = NULL;
 char **row;
 struct psl *psl, *pslList = NULL;
 boolean hasBin;
 char splitTable[64];
 char query[256];
 if (!hFindSplitTable(database, seqName, table, splitTable, &hasBin))
     errAbort("can't find table %s or %s_%s", table, seqName, table);
-sqlSafef(query, sizeof(query), "select * from %s where qName = '%s'", splitTable, acc);
+sqlSafef(query, sizeof(query), "select * from %s where qName like '%s%%'", splitTable, acc);
 sr = sqlGetResult(conn, query);
 while ((row = sqlNextRow(sr)) != NULL)
     {
     psl = pslLoad(row+hasBin);
     slAddHead(&pslList, psl);
     }
 sqlFreeResult(&sr);
 slReverse(&pslList);
 return pslList;
 }
 
 struct psl *loadPslRangeT(char *table, char *qName, char *tName, int tStart, int tEnd)
 /* Load a list of psls given qName tName tStart tEnd */
 {
 struct sqlResult *sr = NULL;
@@ -6954,31 +6954,31 @@
     sqlSafef(query, sizeof query, "select cds from gbCdnaInfo where acc = '%s'", accChopped);
     sr = sqlGetResult(conn, query);
     if ((row = sqlNextRow(sr)) != NULL)
 	{
         sqlSafef(query, sizeof query, "select name from cds where id = '%d'", atoi(row[0]));
 	sqlFreeResult(&sr);
 	sr = sqlGetResult(conn, query);
 	if ((row = sqlNextRow(sr)) != NULL)
 	    genbankParseCds(row[0], &cdsStart, &cdsEnd);
 	}
     sqlFreeResult(&sr);
     }
 
 /* Look up alignments in database */
 hFindSplitTable(database, seqName, aliTable, table, &hasBin);
-sqlSafef(query, sizeof query, "select * from %s where qName = '%s' and tName=\"%s\" and tStart=%d",
+sqlSafef(query, sizeof query, "select * from %s where qName like '%s%%' and tName=\"%s\" and tStart=%d",
 	table, acc, seqName, start);
 sr = sqlGetResult(conn, query);
 if ((row = sqlNextRow(sr)) == NULL)
     errAbort("Couldn't find alignment for %s at %d", acc, start);
 psl = pslLoad(row+hasBin);
 sqlFreeResult(&sr);
 
 /* get bz rna snapshot for blastz alignments */
 if (sameString("mrnaBlastz", aliTable) || sameString("pseudoMrna", aliTable))
     {
     struct sqlConnection *conn = hAllocConn(database);
     unsigned retId = 0;
     safef(accTmp, sizeof accTmp, "bz-%s", acc);
     if (hRnaSeqAndIdx(accTmp, &rnaSeq, &retId, conn) == -1)
         rnaSeq = hRnaSeq(database, acc);