0225987c360191851dd02bc7fd9d02a704da4654
angie
  Tue Apr 13 18:25:15 2021 -0700
For spike mutations of same priority, order by position.

diff --git src/hg/hgPhyloPlace/phyloPlace.c src/hg/hgPhyloPlace/phyloPlace.c
index 5325c5f..e589069 100644
--- src/hg/hgPhyloPlace/phyloPlace.c
+++ src/hg/hgPhyloPlace/phyloPlace.c
@@ -1754,31 +1754,34 @@
 {
     char *name;                 // The name that people are used to seeing, e.g. "E484K', "N501Y"
     struct slName *sampleIds;   // The uploaded samples that have it
     int priority;               // For sorting; lower number means scarier.
     int pos;                    // 1-based position
     enum spikeMutType spikeType;// If spike mutation, what kind?
     char oldAa;                 // Reference AA
     char newAa;                 // Alt AA
 };
 
 int aaMutInfoCmp(const void *a, const void *b)
 /* Compare aaMutInfo priority for sorting. */
 {
 const struct aaMutInfo *amiA = *(struct aaMutInfo * const *)a;
 const struct aaMutInfo *amiB = *(struct aaMutInfo * const *)b;
-return amiA->priority - amiB->priority;
+int dif = amiA->priority - amiB->priority;
+if (dif == 0)
+    dif = amiA->pos - amiB->pos;
+return dif;
 }
 
 // For now, hardcode SARS-CoV-2 Spike RBD coords and antibody escape positions (1-based).
 static int rbdStart = 319;
 static int rbdEnd = 541;
 static boolean *escapeMutPos = NULL;
 
 static void initEscapeMutPos()
 /* Allocate excapeMutPos and set positions implicated by at least a couple experiments from Bloom Lab
  * or that appear in Whelan, Rappuoli or McCoy tracks. */
 {
 AllocArray(escapeMutPos, rbdEnd);
 escapeMutPos[332] = TRUE;
 escapeMutPos[334] = TRUE;
 escapeMutPos[335] = TRUE;