Ejemplo n.º 1
0
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;
}
Ejemplo n.º 2
0
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;
}
Ejemplo n.º 3
0
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", &sectionRa);

addGoodSection(demogSection(conn, sectionRa), conn, &sectionList);
addGoodSection(vaccineSection(conn, sectionRa), conn, &sectionList);
addGoodSection(clinicalSection(conn, sectionRa), conn, &sectionList);
addGoodSection(sequenceSection(conn, sectionRa), conn, &sectionList);

slSort(&sectionList, 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;
}
Ejemplo n.º 6
0
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", &sectionRa);

// 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, &sectionList);
        return sectionList;
        }
    }

addGoodSection(linksSection(conn, sectionRa), conn, &sectionList);
/* disable ortherOrg section for CGB servers for the time being */
if (!hIsCgbServer()) addGoodSection(otherOrgsSection(conn, sectionRa), conn, &sectionList);
addGoodSection(gadSection(conn, sectionRa), conn, &sectionList);
addGoodSection(malaCardsSection(conn, sectionRa), conn, &sectionList);
    addGoodSection(ctdSection(conn, sectionRa), conn, &sectionList);
/*if (isRgdGene(conn))
    {
    addGoodSection(ctdRgdGene2Section(conn, sectionRa), conn, &sectionList);
    }
else
    {
    addGoodSection(ctdSection(conn, sectionRa), conn, &sectionList);
    }
*/
addGoodSection(rgdGeneRawSection(conn, sectionRa), conn, &sectionList);

addGoodSection(gtexSection(conn, sectionRa), conn, &sectionList);
/* temporarily disable microarray section for Zebrafish, until a bug is fixed */
if (strstr(database, "danRer") == NULL)
    {
    addGoodSection(microarraySection(conn, sectionRa), conn, &sectionList);
    }
addGoodSection(rnaStructureSection(conn, sectionRa), conn, &sectionList);
addGoodSection(domainsSection(conn, sectionRa), conn, &sectionList);
addGoodSection(altSpliceSection(conn, sectionRa), conn, &sectionList);
// addGoodSection(multipleAlignmentsSection(conn, sectionRa), conn, &sectionList);
addGoodSection(swissProtCommentsSection(conn, sectionRa), conn, &sectionList);
addGoodSection(flyBaseRolesSection(conn, sectionRa), conn, &sectionList);
addGoodSection(flyBasePhenotypesSection(conn, sectionRa), conn, &sectionList);
addGoodSection(flyBaseSynonymsSection(conn, sectionRa), conn, &sectionList);
addGoodSection(bdgpExprInSituSection(conn, sectionRa), conn, &sectionList);
addGoodSection(goSection(conn, sectionRa), conn, &sectionList);
addGoodSection(infoSection(conn, sectionRa), conn, &sectionList);
addGoodSection(methodSection(conn, sectionRa), conn, &sectionList);
addGoodSection(localizationSection(conn, sectionRa), conn, &sectionList);
addGoodSection(transRegCodeMotifSection(conn, sectionRa), conn, &sectionList);
addGoodSection(pathwaysSection(conn, sectionRa), conn, &sectionList);
addGoodSection(mrnaDescriptionsSection(conn, sectionRa), conn, &sectionList);
//addGoodSection(pseudoGeneSection(conn, sectionRa), conn, &sectionList);
addGoodSection(synonymSection(conn, sectionRa), conn, &sectionList);
addGoodSection(geneReviewsSection(conn, sectionRa), conn, &sectionList);
addGoodSection(allelesSection(conn, sectionRa), conn, &sectionList);

// addGoodSection(xyzSection(conn, sectionRa), conn, &sectionList);

slSort(&sectionList, sectionCmpPriority);
return sectionList;
}