13407761de80485e6d82d05387698910fa309502
galt
  Tue Jan 28 17:30:54 2014 -0800
Fixes #12509. Create special chrom ordering for hg38 as specified in the ticket.
diff --git src/hg/inc/hdb.h src/hg/inc/hdb.h
index 9a5f6da..7b54718 100644
--- src/hg/inc/hdb.h
+++ src/hg/inc/hdb.h
@@ -834,30 +834,52 @@
  * exception cuz we're nice
  */
 
 int chrStrippedCmp(char *chrA, char *chrB);
 /*	compare chrom names after stripping chr, Scaffold_ or ps_ prefix */
 
 int chrNameCmp(char *str1, char *str2);
 /* Compare chromosome names by number, then suffix.  str1 and str2 must
  * match the regex "chr([0-9]+|[A-Za-z0-9]+)(_[A-Za-z0-9_]+)?". */
 
 int chrSlNameCmp(const void *el1, const void *el2);
 /* Compare chromosome names by number, then suffix.  el1 and el2 must be
  * slName **s (as passed in by slSort) whose names match the regex
  * "chr([0-9]+|[A-Za-z0-9]+)(_[A-Za-z0-9_]+)?". */
 
+int chrNameCmpWithAltRandom(char *str1, char *str2);
+/* Compare chromosome or linkage group names str1 and str2 
+ * to achieve this order:
+ * chr1 .. chr22
+ * chrX
+ * chrY
+ * chrM
+ * chr1_{alt, random} .. chr22_{alt, random}
+ * chrUns
+ */
+
+int chrSlNameCmpWithAltRandom(const void *el1, const void *el2);
+/* Compare chromosome or linkage group names str1 and str2 
+ * to achieve this order:
+ * chr1 .. chr22
+ * chrX
+ * chrY
+ * chrM
+ * chr1_{alt, random} .. chr22_{alt, random}
+ * chrUns
+ */
+
 int bedCmpExtendedChr(const void *va, const void *vb);
 /* Compare to sort based on chrom,chromStart.  Use extended
  * chrom name comparison, that strip prefixes and does numeric compare */
 
 int compareDbs(char *dbA, char *dbB);
 /* Compare two org# e.g. mm6 vs. mm16 or mm6 vs. hg17
  * Return > 0 if dbA > dbB, < 0 if less than, and 0 if equal */
 
 int getTableSize(char *db, char *table);
 /* Get count of rows in a table in the primary database */
 
 struct slName *getDomainList(struct sqlConnection *conn, char *ucscGeneId,
        char *domainDb);
 
 struct slName *getPfamDomainList(struct sqlConnection *conn, char *ucscGeneId);