5da4f2f879717a10fbc2996adbfbc15c9e344667
angie
  Tue Apr 13 18:23:59 2021 -0700
Set parBase in sncList for TSV output for imputed bases too (oops).

diff --git src/hg/hgPhyloPlace/phyloPlace.c src/hg/hgPhyloPlace/phyloPlace.c
index 1edf288..5325c5f 100644
--- src/hg/hgPhyloPlace/phyloPlace.c
+++ src/hg/hgPhyloPlace/phyloPlace.c
@@ -1649,31 +1649,32 @@
             printf("<td>%d", ix+1);
             if (ti && nextstrainHost())
                 {
                 char *nextstrainUrl = nextstrainUrlFromTn(jsonTns[ix]);
                 printf(" (<a href='%s' target=_blank>view in Nextstrain<a>)", nextstrainUrl);
                 }
             printf("</td>");
             }
         puts("</tr>");
         }
     puts("</tbody></table><p></p>");
     }
 }
 
 static struct singleNucChange *sncListFromSampleMutsAndImputed(struct slName *sampleMuts,
-                                                               struct baseVal *imputedBases)
+                                                               struct baseVal *imputedBases,
+                                                               struct seqWindow *gSeqWin)
 /* Convert a list of "<ref><pos><alt>" names to struct singleNucChange list.
  * However, if <alt> is ambiguous, skip it because variantProjector doesn't like it.
  * Add imputed base predictions. */
 {
 struct singleNucChange *sncList = NULL;
 struct slName *mut;
 for (mut = sampleMuts;  mut != NULL;  mut = mut->next)
     {
     char ref = mut->name[0];
     if (ref < 'A' || ref > 'Z')
         errAbort("sncListFromSampleMuts: expected ref base value, got '%c' in '%s'",
                  ref, mut->name);
     int pos = atoi(&(mut->name[1]));
     if (pos < 1 || pos > chromSize)
         errAbort("sncListFromSampleMuts: expected pos between 1 and %d, got %d in '%s'",
@@ -1682,34 +1683,36 @@
     if (alt < 'A' || alt > 'Z')
         errAbort("sncListFromSampleMuts: expected alt base value, got '%c' in '%s'",
                  alt, mut->name);
     if (isIupacAmbiguous(alt))
         continue;
     struct singleNucChange *snc;
     AllocVar(snc);
     snc->chromStart = pos-1;
     snc->refBase = snc->parBase = ref;
     snc->newBase = alt;
     slAddHead(&sncList, snc);
     }
 struct baseVal *bv;
 for (bv = imputedBases;  bv != NULL;  bv = bv->next)
     {
+    char ref[2];
+    seqWindowCopy(gSeqWin, bv->chromStart, 1, ref, sizeof ref);
     struct singleNucChange *snc;
     AllocVar(snc);
     snc->chromStart = bv->chromStart;
-    snc->refBase = '?';
+    snc->refBase = snc->parBase = ref[0];
     snc->newBase = bv->val[0];
     slAddHead(&sncList, snc);
     }
 slReverse(&sncList);
 return sncList;
 }
 
 enum spikeMutType
 /* Some categories of Spike mutation are more concerning than others. */
 {
     smtNone,        // Just a spike mutation.
     smtVoC,         // Thought to be the problematic mutation in a Variant of Concern.
     smtEscape,      // Implicated in Antibody Escape experiments.
     smtRbd,         // Receptor Binding Domain
     smtCleavage,    // Furin cleavage site
@@ -1947,31 +1950,31 @@
 if (info)
     {
     // sample name / ID
     fprintf(f, "%s\t", sampleId);
     // nucleotide mutations
     struct slName *mut;
     for (mut = info->sampleMuts;  mut != NULL;  mut = mut->next)
         {
         if (mut != info->sampleMuts)
             fputc(',', f);
         fputs(mut->name, f);
         }
     fputc('\t', f);
     // AA mutations
     struct singleNucChange *sncList = sncListFromSampleMutsAndImputed(info->sampleMuts,
-                                                                      info->imputedBases);
+                                                                      info->imputedBases, gSeqWin);
     struct slPair *geneAaMutations = getAaMutations(sncList, geneInfoList, gSeqWin);
     struct slPair *geneAaMut;
     boolean first = TRUE;
     for (geneAaMut = geneAaMutations;  geneAaMut != NULL;  geneAaMut = geneAaMut->next)
         {
         struct slName *aaMut;
         for (aaMut = geneAaMut->val;  aaMut != NULL;  aaMut = aaMut->next)
             {
             if (first)
                 first = FALSE;
             else
                 fputc(',', f);
             fprintf(f, "%s:%s", geneAaMut->name, aaMut->name);
             if (sameString(geneAaMut->name, "S"))
                 addSpikeChange(spikeChanges, aaMut->name, sampleId);