5d3c984e5289c378059745106719244edcf29071 angie Wed Jan 26 08:58:22 2011 -0800 Track #1684 (SNPs 132 (dbSNP)): minor prettying up of near-genefunctional annotation. diff --git src/hg/hgc/hgc.c src/hg/hgc/hgc.c index 2fa465f..feff54d 100644 --- src/hg/hgc/hgc.c +++ src/hg/hgc/hgc.c @@ -15648,50 +15648,52 @@ { struct sqlResult *sr; char query[512]; char **row; int snpStart = snp->chromStart, snpEnd = snp->chromEnd; int nearCount = 0; int maxDistance = 10000; /* query to the left: */ safef(query, sizeof(query), "select name,txEnd,strand from %s " "where chrom = '%s' and txStart < %d and txEnd > %d", geneTable, snp->chrom, snpStart, snpStart - maxDistance); sr = sqlGetResult(conn, query); while ((row = sqlNextRow(sr)) != NULL) { char *gene = row[0]; + char *geneName = getSymbolForGeneName(geneTable, gene); int end = sqlUnsigned(row[1]); char *strand = row[2]; printf(firstTwoColumnsPctS "%d bases %sstream</TD></TR>\n", - geneTable, gene, (snpStart - end + 1), + geneTrack, geneName, (snpStart - end + 1), (strand[0] == '-' ? "up" : "down")); nearCount++; } sqlFreeResult(&sr); /* query to the right: */ safef(query, sizeof(query), "select name,txStart,strand from %s " "where chrom = '%s' and txStart < %d and txEnd > %d", geneTable, snp->chrom, snpEnd + maxDistance, snpEnd); sr = sqlGetResult(conn, query); while ((row = sqlNextRow(sr)) != NULL) { char *gene = row[0]; + char *geneName = getSymbolForGeneName(geneTable, gene); int start = sqlUnsigned(row[1]); char *strand = row[2]; printf(firstTwoColumnsPctS "%d bases %sstream</TD></TR>\n", - geneTable, gene, (start - snpEnd + 1), + geneTrack, geneName, (start - snpEnd + 1), (strand[0] == '-' ? "down" : "up")); nearCount++; } sqlFreeResult(&sr); if (nearCount == 0) printf("<TR><TD>%s </TD><TD></TD><TD>intergenic</TD></TR>", geneTrack); } static struct genePred *getGPsWithFrames(struct sqlConnection *conn, char *geneTable, char *chrom, int start, int end) /* Given a known-to-exist genePred table name and a range, return * genePreds in range with exonFrames populated. */ { struct genePred *gpList = NULL; boolean hasBin;