f00ee8d8e407da35c50e5d61815250a49960dabe
angie
  Tue Dec 5 13:52:12 2023 -0800
More refinements for displaying RSV results.  Still need to make it more config-driven.

diff --git src/hg/hgPhyloPlace/phyloPlace.c src/hg/hgPhyloPlace/phyloPlace.c
index 116b270..7875023 100644
--- src/hg/hgPhyloPlace/phyloPlace.c
+++ src/hg/hgPhyloPlace/phyloPlace.c
@@ -1547,71 +1547,74 @@
          TOOLTIP("Number of bases in aligned portion of uploaded sequence that are not present in "
                  "reference %s")
          "</th>\n<th>Deleted bases"
          TOOLTIP("Number of bases in reference %s that are not "
                  "present in aligned portion of uploaded sequence")
            "</th>", refName, refName, refName);
 puts("<th>#SNVs used for placement"
      TOOLTIP("Number of single-nucleotide variants in uploaded sample "
              "(does not include N's or mixed bases) used by UShER to place sample "
              "in phylogenetic tree")
      "</th>\n<th>#Masked SNVs"
      TOOLTIP("Number of single-nucleotide variants in uploaded sample that are masked "
              "(not used for placement) because they occur at known "
              "<a href='https://virological.org/t/issues-with-sars-cov-2-sequencing-data/473/12' "
              "target=_blank>Problematic Sites</a>"));;
-boolean isRsv = (stringIn("GCF_000855545", db) || stringIn("GCF_002815475", db));
+boolean isRsv = (stringIn("GCF_000855545", db) || stringIn("GCF_002815475", db) ||
+                 startsWith("RGCC", db));
 if (gotClades)
     {
     if (sameString(db, "wuhCor1"))
         puts("</th>\n<th>Nextstrain clade"
              TOOLTIP("The <a href='https://nextstrain.org/blog/2021-01-06-updated-SARS-CoV-2-clade-naming' "
                      "target=_blank>Nextstrain clade</a> assigned to the sample by "
                      "placement in the tree"));
     else if (isRsv)
         puts("</th>\n<th><a href='https://doi.org/10.1111/irv.12715' target=_blank>"
              "Goya 2020</a> clade"
              TOOLTIP("The clade described in "
                      "<a href='https://doi.org/10.1111/irv.12715' target=_blank>Goya et al. 2020, "
                      "&quot;Toward unified molecular surveillance of RSV: A proposal for "
                      "genotype definition&quot;</a> "
                      "assigned by placement in the tree"));
     else
         puts("</th>\n<th>Nextstrain lineage"
              TOOLTIP("The Nextstrain lineage assigned by "
                      "placement in the tree"));
     }
 if (gotLineages)
     {
     if (isRsv)
-         puts("</th>\n<th><a href='https://doi.org/10.1093/ve/veaa052' target=_blank>"
-              "RGCC 2023</a> clade"
+         puts("</th>\n<th>RGCC 2023 clade"
              TOOLTIP("The RSV Genotyping Consensus Consortium clade (manuscript in preparation) "
                      "assigned by placement in the tree"));
    else
         puts("</th>\n<th>Pango lineage"
              TOOLTIP("The <a href='https://cov-lineages.org/' "
                      "target=_blank>Pango lineage</a> assigned to the sample by UShER"));
     }
 puts("</th>\n<th>Neighboring sample in tree"
      TOOLTIP("A sample already in the tree that is a child of the node at which the uploaded "
              "sample was placed, to give an example of a closely related sample")
      "</th>\n<th>Lineage of neighbor");
 if (sameString(db, "wuhCor1"))
     puts(TOOLTIP("The <a href='https://cov-lineages.org/' target=_blank>"
                  "Pango lineage</a> assigned by pangolin "
                  "to the nearest neighboring sample already in the tree"));
+else if (isRsv)
+    puts(TOOLTIP("The RGCC 2023 clade assigned by Nextclade "
+                 "to the nearest neighboring sample already in the tree"));
 else
     puts(TOOLTIP("The lineage assigned by Nextclade "
                  "to the nearest neighboring sample already in the tree"));
 puts("</th>\n<th>#Imputed values for mixed bases"
      TOOLTIP("If the uploaded sequence contains mixed/ambiguous bases, then UShER may assign "
              "values based on maximum parsimony")
      "</th>\n<th>#Maximally parsimonious placements"
      TOOLTIP("Number of potential placements in the tree with minimal parsimony score; "
              "the higher the number, the less confident the placement")
      "</th>\n<th>Parsimony score"
      TOOLTIP("Number of mutations/changes that must be added to the tree when placing the "
              "uploaded sample; the higher the number, the more diverged the sample")
      "</th>\n<th>Subtree number"
      TOOLTIP("Sequence number of subtree that contains this sample")
      "</th></tr></thead>");
@@ -2017,48 +2020,86 @@
         puts("</tr>");
         }
     puts("</tbody></table><p></p>");
     }
 }
 
 static void summarizeSubtrees(struct slName *sampleIds, struct usherResults *results,
                               struct hash *sampleMetadata, struct tempName *jsonTns[],
                               char *db, int subtreeSize)
 /* Print a summary table of pasted/uploaded identifiers and subtrees */
 {
 boolean gotClades = FALSE, gotLineages = FALSE;
 lookForCladesAndLineages(results->samplePlacements, &gotClades, &gotLineages);
 puts("<table class='seqSummary'><tbody>");
 puts("<tr><th>Sequence</th>");
+boolean isRsv = (stringIn("GCF_000855545", db) || stringIn("GCF_002815475", db) ||
+                 startsWith("RGCC", db));
 if (gotClades)
+    {
+    if (sameString(db, "wuhCor1"))
         puts("<th>Nextstrain clade (UShER)"
      TOOLTIP("The <a href='https://nextstrain.org/blog/2021-01-06-updated-SARS-CoV-2-clade-naming' "
              "target=_blank>Nextstrain clade</a> "
              "assigned to the sequence by UShER according to its place in the phylogenetic tree")
              "</th>");
+    else if (isRsv)
+        puts("<th><a href='https://doi.org/10.1111/irv.12715' target=_blank>"
+             "Goya 2020</a> clade"
+             TOOLTIP("The clade described in "
+                     "<a href='https://doi.org/10.1111/irv.12715' target=_blank>Goya et al. 2020, "
+                     "&quot;Toward unified molecular surveillance of RSV: A proposal for "
+                     "genotype definition&quot;</a> "
+                     "assigned by placement in the tree")
+             "</th>");
+    else
+        puts("<th>Nextstrain lineage"
+             TOOLTIP("The Nextstrain lineage assigned by "
+                     "placement in the tree")
+             "</th>");
+    }
 if (gotLineages)
+    {
+    if (sameString(db, "wuhCor1"))
         puts("<th>Pango lineage (UShER)"
          TOOLTIP("The <a href='https://cov-lineages.org/' "
                  "target=_blank>Pango lineage</a> "
                  "assigned to the sequence by UShER according to its place in the phylogenetic tree")
              "</th>");
+    else if (isRsv)
+        puts("<th>RGCC 2023 clade"
+             TOOLTIP("The RSV Genotyping Consensus Consortium clade (manuscript in preparation) "
+                     "assigned by placement in the tree")
+             "</th>");
+    }
+if (sameString(db, "wuhCor1"))
     puts("<th>Pango lineage (pangolin)"
          TOOLTIP("The <a href='https://cov-lineages.org/' target=_blank>"
                  "Pango lineage</a> assigned to the sequence by "
                  "<a href='https://github.com/cov-lineages/pangolin/' target=_blank>pangolin</a>")
-     "</th>"
-     "<th>subtree</th></tr>");
+         "</th>");
+else if (isRsv)
+    puts("<th>RGCC 2023 clade (Nextclade)"
+         TOOLTIP("The RGCC clade assigned by Nextclade "
+                 "to the nearest neighboring sample already in the tree")
+         "</th>");
+else
+    puts("<th>Nextclade lineage"
+         TOOLTIP("The lineage assigned by Nextclade "
+                 "to the nearest neighboring sample already in the tree")
+         "</th>");
+puts("<th>subtree</th></tr>");
 struct slName *si;
 for (si = sampleIds;  si != NULL;  si = si->next)
     {
     puts("<tr>");
     printf("<th>%s</td>", replaceChars(si->name, "|", " | "));
     struct placementInfo *pi = hashFindVal(results->samplePlacements, si->name);
     if (pi)
         {
         if (gotClades)
             printf("<td>%s</td>", pi->nextClade ? pi->nextClade : "n/a");
         if (gotLineages)
             printLineageTd(pi->pangoLineage, "n/a", db);
         }
     else
         {