21e5bfb345bf372c0855901b583cc6833a67aa03 angie Wed Jan 26 14:24:05 2011 -0800 Feature #1638 (Add "this SNP also maps to" text to hgdpGeo track). diff --git src/hg/hgc/hgdpClick.c src/hg/hgc/hgdpClick.c index 05426ca..a354435 100644 --- src/hg/hgc/hgdpClick.c +++ src/hg/hgc/hgdpClick.c @@ -406,38 +406,35 @@ /* Show details page for HGDP SNP with population allele frequencies * plotted on a world map. */ { struct sqlConnection *conn = hAllocConn(database); char query[512]; struct sqlResult *sr; char **row; int start = cartInt(cart, "o"); genericHeader(tdb, item); int hasBin=1; safef(query, sizeof(query), "select * from %s where name = '%s' and chrom = '%s' and chromStart = %d", tdb->table, item, seqName, start); sr = sqlGetResult(conn, query); -if ((row = sqlNextRow(sr)) != NULL) - { +if ((row = sqlNextRow(sr)) == NULL) + errAbort("doHgdpGeo: no match in %s for %s at %s:%d", tdb->table, item, seqName, start); struct hgdpGeo geo; hgdpGeoStaticLoad(row+hasBin, &geo); +sqlFreeResult(&sr); printCustomUrl(tdb, item, TRUE); bedPrintPos((struct bed *)&geo, 4, tdb); printf("Ancestral Allele: %c
\n", geo.ancestralAllele); printf("Derived Allele: %c
\n", geo.derivedAllele); +printOtherSnpMappings(tdb->table, item, start, conn, hasBin); printf("
\n"); printf("
\n"); hgdpGeoFreqTable(&geo); printf("\n"); hgdpGeoImg(&geo); printf("
\n"); - } -else - errAbort("doHgdpGeo: no match in %s for %s at %s:%d", tdb->table, item, seqName, start); - -sqlFreeResult(&sr); printTrackHtml(tdb); hFreeConn(&conn); }