48d92ef665025410a2ee23fac5c6d468fe7cb128
markd
  Wed Jan 26 10:52:34 2011 -0800
modified refSeqGet to return results in predictiable order to minimize test failures when database changes
diff --git src/hg/lib/genePred.c src/hg/lib/genePred.c
index 76c475b..f5ce54f 100644
--- src/hg/lib/genePred.c
+++ src/hg/lib/genePred.c
@@ -370,31 +370,43 @@
     {
     lineFileExpectAtLeast(lf, GENEPRED_NUM_COLS, numCols);
     el = genePredExtLoad(row, numCols);
     slAddHead(&list, el);
     }
 lineFileClose(&lf);
 slReverse(&list);
 return list;
 }
 
 int genePredCmp(const void *va, const void *vb)
 /* Compare to sort based on chromosome, txStart. */
 {
 const struct genePred *a = *((struct genePred **)va);
 const struct genePred *b = *((struct genePred **)vb);
-int dif;
+int dif = strcmp(a->chrom, b->chrom);
+if (dif == 0)
+    dif = a->txStart - b->txStart;
+return dif;
+}
+
+int genePredNameCmp(const void *va, const void *vb)
+/* Compare to sort based on name, then chromosome, txStart. */
+{
+const struct genePred *a = *((struct genePred **)va);
+const struct genePred *b = *((struct genePred **)vb);
+int dif = strcmp(a->name, b->name);
+if (dif == 0)
 dif = strcmp(a->chrom, b->chrom);
 if (dif == 0)
     dif = a->txStart - b->txStart;
 return dif;
 }
 
 static boolean haveStartStopCodons(struct gffFile *gff)
 /* For GFFs, determine if any of the annotations use start_codon or                                                                                                                 
  * stop_codon */
 {
 struct gffFeature *feature;
 for(feature = gff->featureList; feature != NULL; feature = feature->next)
     {
     if(sameWord(feature->name, "start_codon") ||
        sameWord(feature->name, "start_codon"))