7033f67074594c3d9cc3487f079456928fdf3260 angie Tue Apr 12 13:46:14 2016 -0700 Major change to hgGateway: the contents are replaced by a new page designed by a graphic artist. It has icons for selecting popular species, an autocomplete input for typing in species or common names, as well as a phylogenetic tree display that shows the relationships of the species that we host. It has a menu for selecting the assembly of the selected species' genome and the usual assembly description. refs #15277 diff --git src/hg/lib/trackHub.c src/hg/lib/trackHub.c index e26498b..90cda08 100644 --- src/hg/lib/trackHub.c +++ src/hg/lib/trackHub.c @@ -216,30 +216,50 @@ return dbList; } struct dbDb *trackHubGetBlatDbDbs() /* Get a list of connected track hubs that have blat servers */ { return getDbDbs(NULL, TRUE); } struct dbDb *trackHubGetDbDbs(char *clade) /* Get a list of dbDb structures for all the tracks in this clade/hub. */ { return getDbDbs(clade, FALSE); } +struct slPair *trackHubDbDbToValueLabel(struct dbDb *hubDbDbList) +/* Given a trackHub (list of) track hub dbDb which may be missing some info, + * return an slPair of value and label suitable for making a select/menu option. */ +{ +struct dbDb *dbDb; +struct slPair *pairList = NULL; +for (dbDb = hubDbDbList; dbDb != NULL; dbDb = dbDb->next) + { + char *db = dbDb->name; + if (isEmpty(db)) + db = dbDb->genome; + char *label = dbDb->description; + if (isEmpty(label)) + label = trackHubSkipHubName(db); + slAddHead(&pairList, slPairNew(db, cloneString(label))); + } +slReverse(&pairList); +return pairList; +} + struct slName *trackHubAllChromNames(char *database) /* Return a list of all the chrom names in this assembly hub database. */ /* Free with slFreeList. */ { struct trackHubGenome *genome = trackHubGetGenome(database); if (genome == NULL) return NULL; struct slName *chromList = twoBitSeqNames(genome->twoBitPath); return chromList; } int trackHubChromCount(char *database) /* Return number of chromosomes in a assembly data hub. */