07d9e9ec22f32d628d1298245cf7852b2015a5e6
angie
Tue Oct 2 11:42:23 2018 -0700
Multi-region config also needs to watch out for :start-end suffixes in {alt,fix}Locations.name. refs #22144
diff --git src/hg/hgTracks/config.c src/hg/hgTracks/config.c
index 50bb83c..70b7ecb 100644
--- src/hg/hgTracks/config.c
+++ src/hg/hgTracks/config.c
@@ -693,45 +693,48 @@
if (altLocExists || fixLocExists)
{
hPrintf("
");
cgiMakeRadioButton("virtModeType", "singleAltHaplo",
sameWord("singleAltHaplo", virtModeType));
hPrintf(" | ");
hPrintf("Show one alternate haplotype");
if (fixLocExists)
hPrintf(" or fix patch");
hPrintf(", 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);
+ sqlSafef(sql, sizeof sql,
+ "select name from altLocations where name rlike '^%s(:[0-9-]+)?'", haplo);
foundHaplo = sqlQuickString(conn, sql);
}
if (!foundHaplo && fixLocExists)
{
- sqlSafef(sql, sizeof sql, "select name from fixLocations where name='%s'", haplo);
+ sqlSafef(sql, sizeof sql,
+ "select name from fixLocations where name rlike '^%s(:[0-9-]+)?'", 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);
+ chopSuffixAt(haplo, ':');
}
hTextVar("singleAltHaploId", haplo, 60);
hPrintf(" |
\n");
}
}
/* disable demo for now
if (sameString(database,"hg19") || sameString(database, "hg38"))
{
hPrintf("