bffbb000a3df4b88a8117ea5f852ab3abeea6e17 angie Mon Sep 24 14:42:01 2018 -0700 Added a new mode to hgSuggest: altOrPatch, to match alt haplo or fix patch sequence names. Use it in hgTracks' multi-region dialog. Make the dialog inputs activate their respective radio buttons. refs #18854 diff --git src/hg/hgTracks/config.c src/hg/hgTracks/config.c index b7f825f..1f4d2e9 100644 --- src/hg/hgTracks/config.c +++ src/hg/hgTracks/config.c @@ -674,48 +674,66 @@ hPrintf("Show only one transcript using an ID from %s : ", emGeneTrack->shortLabel); char *trans = cartUsualString(cart, "singleTransId", singleTransId); char sql[1024]; sqlSafef(sql, sizeof sql, "select name from %s where name='%s'", emGeneTable, trans); char *result = sqlQuickString(conn, sql); if (!result) { sqlSafef(sql, sizeof sql, "select name from %s limit 1", emGeneTable); trans = sqlQuickString(conn, sql); } hTextVar("singleTransId", trans, 20); hPrintf("</TD></TR>\n"); } */ -if (conn && sqlTableExists(conn, "altLocations")) +if (conn) + { + boolean altLocExists = sqlTableExists(conn, "altLocations"); + boolean fixLocExists = sqlTableExists(conn, "fixLocations"); + if (altLocExists || fixLocExists) { hPrintf("<TR><TD>"); - cgiMakeRadioButton("virtModeType", "singleAltHaplo", sameWord("singleAltHaplo", virtModeType)); + cgiMakeRadioButton("virtModeType", "singleAltHaplo", + sameWord("singleAltHaplo", virtModeType)); hPrintf("</TD><TD>"); hPrintf("Show one alternate haplotype, placed on its chromosome, using ID: "); char *haplo = cartUsualString(cart, "singleAltHaploId", singleAltHaploId); + char *foundHaplo = NULL; char sql[1024]; + if (altLocExists) + { sqlSafef(sql, sizeof sql, "select name from altLocations where name='%s'", haplo); - char *result = sqlQuickString(conn, sql); - if (!result) + foundHaplo = sqlQuickString(conn, sql); + } + if (!foundHaplo && fixLocExists) { + sqlSafef(sql, sizeof sql, "select name from fixLocations where name='%s'", haplo); + foundHaplo = sqlQuickString(conn, sql); + } + if (!foundHaplo) + { + if (altLocExists) sqlSafef(sql, sizeof sql, "select name from altLocations limit 1"); + else + sqlSafef(sql, sizeof sql, "select name from fixLocations limit 1"); haplo = sqlQuickString(conn, sql); } hTextVar("singleAltHaploId", haplo, 20); hPrintf("</TD></TR>\n"); } + } /* disable demo for now if (sameString(database,"hg19") || sameString(database, "hg38")) { hPrintf("<TR><TD>"); cgiMakeRadioButton("virtModeType", "demo1", sameWord("demo1", virtModeType)); hPrintf("</TD><TD>"); hPrintf("demo1 two windows on two chroms (default pos on chr21, and same loc on chr22)"); hPrintf("</TD></TR>\n"); } */ /* Disabled for now hPrintf("<TR><TD>");