09ba8a42df0be5b65518715f8f499e4ac965a4ef
angie
Tue Apr 30 11:10:37 2024 -0700
When multiple references are matched, make navigation links at the top of the results page.
diff --git src/hg/hgPhyloPlace/phyloPlace.c src/hg/hgPhyloPlace/phyloPlace.c
index 291012d..82fa6f1 100644
--- src/hg/hgPhyloPlace/phyloPlace.c
+++ src/hg/hgPhyloPlace/phyloPlace.c
@@ -3739,35 +3739,52 @@
name, description);
}
struct slName *noMatches = NULL;
int startTime = clock1000();
struct refMatch *refFiles = matchSamplesWithReferences(org, nextcladeIndex, lf, &noMatches,
&startTime);
lineFileClose(&lf);
if (noMatches != NULL)
{
printf("
No reference was found for the following sequences:\n
\n");
struct slName *noMatch;
for (noMatch = noMatches; noMatch != NULL; noMatch = noMatch->next)
printf("- %s\n", noMatch->name);
puts("
");
}
+ int refCount = slCount(refFiles);
+ boolean doNav = (refCount > 1);
struct refMatch *ref;
+ if (doNav)
+ {
+ // Make some navigation links at the top
+ puts("");
+ printf("Your uploaded sequences matched %d different reference sequences. "
+ "Click on these links to jump to the results for each reference.\n",
+ refCount);
+ puts("
");
+ for (ref = refFiles; ref != NULL; ref = ref->next)
+ printf("- %s\n", ref->acc, ref->description);
+ puts("
");
+ }
for (ref = refFiles; ref != NULL; ref = ref->next)
{
+ printf("\n", ref->acc);
if (ref != refFiles)
puts("
");
- printf("Sequence(s) matched reference %s
\n", ref->description);
+ printf("Sequence(s) matched to reference %s
\n", ref->description);
+ if (doNav)
+ puts("back to top");
struct lineFile *rlf = lineFileOpen(ref->seqFile, TRUE);
phyloPlaceSamplesOneRef(rlf, db, org, ref->acc, defaultProtobuf,
doMeasureTiming, subtreeSize, tl, cart, &success);
}
puts("
");
}
else
{
// No nextcladeIndex means this is the old-style single-reference setup (i.e. SARS-CoV-2).
phyloPlaceSamplesOneRef(lf, db, org, org, defaultProtobuf, doMeasureTiming, subtreeSize,
tl, cart, &success);
}
return success;
}