struct column *getColumns(struct sqlConnection *conn) /* Return list of columns for big table. */ { char *raName = "columnDb.ra"; struct column *col, *colList = NULL; struct hash *raList = readRa(raName), *raHash = NULL; /* Create built-in columns. */ if (raList == NULL) errAbort("Couldn't find anything from %s", raName); for (raHash = raList; raHash != NULL; raHash = raHash->next) { AllocVar(col); col->settings = raHash; columnVarsFromSettings(col, raName); if (!hashFindVal(raHash, "hide")) { setupColumnType(col); slAddHead(&colList, col); } } /* Put columns in hash */ columnHash = hashColumns(colList); /* Tweak ordering and visibilities as per user settings. */ //refinePriorities(columnHash); refineVisibility(colList); refineFilterOn(colList); slSort(&colList, columnCmpPriority); return colList; }
static void getGenomeSettings() /* Set up genome settings hash */ { struct hash *hash = readRa("genome.ra", NULL); char *name; if (hash == NULL) errAbort("Can't find anything in genome.ra"); name = hashMustFindVal(hash, "name"); if (!sameString(name, "global")) errAbort("Can't find global ra record in genome.ra"); genomeSettings = hash; }
struct section *loadSectionList(struct sqlConnection *conn) /* Load up section list - first load up sections.ra, and then * call each section loader. */ { struct hash *sectionRa = NULL; struct section *sectionList = NULL; readRa("section.ra", §ionRa); addGoodSection(demogSection(conn, sectionRa), conn, §ionList); addGoodSection(vaccineSection(conn, sectionRa), conn, §ionList); addGoodSection(clinicalSection(conn, sectionRa), conn, §ionList); addGoodSection(sequenceSection(conn, sectionRa), conn, §ionList); slSort(§ionList, sectionCmpPriority); return sectionList; }
static struct link *getLinkList(struct sqlConnection *conn, char *raFile) /* Get list of links - starting with everything in .ra file, * and making sure any associated tables and databases exist. */ { struct hash *ra, *raList = readRa(raFile, NULL); struct link *linkList = NULL, *link; for (ra = raList; ra != NULL; ra = ra->next) { if (linkOptionalField(ra, "hide") == NULL) { if (checkDatabases(linkOptionalField(ra, "databases")) && sqlTablesExist(conn, linkOptionalField(ra, "tables"))) { /* only include the wikiTrack if it is enabled */ if (sameWord(linkRequiredField(ra, "name"), "wikiTrack") && ! wikiTrackEnabled(database, NULL)) continue; AllocVar(link); link->priority = atof(linkRequiredField(ra, "priority")); link->name = linkRequiredField(ra, "name"); link->shortLabel = linkRequiredField(ra, "shortLabel"); link->idSql = linkRequiredField(ra, "idSql"); link->nameSql = linkOptionalField(ra, "nameSql"); link->nameFormat = linkOptionalField(ra, "nameFormat"); link->url = linkRequiredField(ra, "url"); link->useHgsid = (linkOptionalField(ra, "hgsid") != NULL); link->useDb = (linkOptionalField(ra, "dbInUrl") != NULL); link->preCutAt = linkOptionalField(ra, "preCutAt"); link->postCutAt = linkOptionalField(ra, "postCutAt"); slAddHead(&linkList, link); } } } slSort(&linkList, linkCmpPriority); return linkList; }
static struct otherOrg *getOtherOrgList(struct sqlConnection *conn, char *raFile) /* Get list of otherOrgs - starting with everything in .ra file, * and making sure any associated tables and databases exist. */ { struct hash *ra, *raList = readRa(raFile, NULL); struct otherOrg *otherOrgList = NULL, *otherOrg; for (ra = raList; ra != NULL; ra = ra->next) { if (otherOrgOptionalField(ra, "hide") == NULL) { if (checkDatabases(otherOrgOptionalField(ra, "databases")) && sqlTablesExist(conn, otherOrgOptionalField(ra, "tables"))) { AllocVar(otherOrg); otherOrg->priority = atof(otherOrgRequiredField(ra, "priority")); otherOrg->name = otherOrgRequiredField(ra, "name"); otherOrg->shortLabel = otherOrgRequiredField(ra, "shortLabel"); otherOrg->idSql = otherOrgRequiredField(ra, "idSql"); otherOrg->idToProtIdSql = otherOrgOptionalField(ra, "idToProtIdSql"); otherOrg->otherIdSql = otherOrgOptionalField(ra, "otherIdSql"); otherOrg->otherIdSql2 = otherOrgOptionalField(ra, "otherIdSql2"); otherOrg->genomeUrl = otherOrgOptionalField(ra, "genomeUrl"); otherOrg->sorterUrl = otherOrgOptionalField(ra, "sorterUrl"); otherOrg->geneUrl = otherOrgOptionalField(ra, "geneUrl"); otherOrg->otherUrl = otherOrgOptionalField(ra, "otherUrl"); otherOrg->otherName = otherOrgOptionalField(ra, "otherName"); otherOrg->db = otherOrgRequiredField(ra, "db"); otherOrg->pepTable = otherOrgOptionalField(ra, "pepTable"); otherOrg->geneTable = otherOrgOptionalField(ra, "geneTable"); slAddHead(&otherOrgList, otherOrg); } } } slSort(&otherOrgList, otherOrgCmpPriority); return otherOrgList; }
struct section *loadSectionList(struct sqlConnection *conn) /* Load up section list - first load up sections.ra, and then * call each section loader. */ { struct hash *sectionRa = NULL; struct section *sectionList = NULL; readRa("section.ra", §ionRa); // Could be an ajax request for a single section! char *ajaxSection = cartOptionalString(cart, hggAjaxSection); if (ajaxSection != NULL) { // Currently only one section supports ajax update. if (sameString(ajaxSection,HGG_GENE_ALLELES)) { addGoodSection(allelesSection(conn, sectionRa), conn, §ionList); return sectionList; } } addGoodSection(linksSection(conn, sectionRa), conn, §ionList); /* disable ortherOrg section for CGB servers for the time being */ if (!hIsCgbServer()) addGoodSection(otherOrgsSection(conn, sectionRa), conn, §ionList); addGoodSection(gadSection(conn, sectionRa), conn, §ionList); addGoodSection(malaCardsSection(conn, sectionRa), conn, §ionList); addGoodSection(ctdSection(conn, sectionRa), conn, §ionList); /*if (isRgdGene(conn)) { addGoodSection(ctdRgdGene2Section(conn, sectionRa), conn, §ionList); } else { addGoodSection(ctdSection(conn, sectionRa), conn, §ionList); } */ addGoodSection(rgdGeneRawSection(conn, sectionRa), conn, §ionList); addGoodSection(gtexSection(conn, sectionRa), conn, §ionList); /* temporarily disable microarray section for Zebrafish, until a bug is fixed */ if (strstr(database, "danRer") == NULL) { addGoodSection(microarraySection(conn, sectionRa), conn, §ionList); } addGoodSection(rnaStructureSection(conn, sectionRa), conn, §ionList); addGoodSection(domainsSection(conn, sectionRa), conn, §ionList); addGoodSection(altSpliceSection(conn, sectionRa), conn, §ionList); // addGoodSection(multipleAlignmentsSection(conn, sectionRa), conn, §ionList); addGoodSection(swissProtCommentsSection(conn, sectionRa), conn, §ionList); addGoodSection(flyBaseRolesSection(conn, sectionRa), conn, §ionList); addGoodSection(flyBasePhenotypesSection(conn, sectionRa), conn, §ionList); addGoodSection(flyBaseSynonymsSection(conn, sectionRa), conn, §ionList); addGoodSection(bdgpExprInSituSection(conn, sectionRa), conn, §ionList); addGoodSection(goSection(conn, sectionRa), conn, §ionList); addGoodSection(infoSection(conn, sectionRa), conn, §ionList); addGoodSection(methodSection(conn, sectionRa), conn, §ionList); addGoodSection(localizationSection(conn, sectionRa), conn, §ionList); addGoodSection(transRegCodeMotifSection(conn, sectionRa), conn, §ionList); addGoodSection(pathwaysSection(conn, sectionRa), conn, §ionList); addGoodSection(mrnaDescriptionsSection(conn, sectionRa), conn, §ionList); //addGoodSection(pseudoGeneSection(conn, sectionRa), conn, §ionList); addGoodSection(synonymSection(conn, sectionRa), conn, §ionList); addGoodSection(geneReviewsSection(conn, sectionRa), conn, §ionList); addGoodSection(allelesSection(conn, sectionRa), conn, §ionList); // addGoodSection(xyzSection(conn, sectionRa), conn, §ionList); slSort(§ionList, sectionCmpPriority); return sectionList; }