void addVersion(boolean strict, char *database, char *dirName, char *raName,
                struct hash *uniqHash,
                struct hash *htmlHash,
                struct hgFindSpec **pSpecList)
/* Read in specs from raName and add them to list/database if new. */
{
    struct hgFindSpec *hfsList = NULL, *hfs = NULL;
    struct hgFindSpec *hfsNext = NULL;

    hfsList = hgFindSpecFromRa(database, raName, NULL);

    /* prune records of the incorrect release */
    hfsList = pruneRelease(hfsList);

    if (strict)
    {
        for (hfs = hfsList; hfs != NULL; hfs = hfsNext)
        {
            hfsNext = hfs->next;
            if (! hTableOrSplitExists(database, hfs->searchTable))
            {
                if (verboseLevel() > 1)
                    printf("%s missing\n", hfs->searchTable);
                slRemoveEl(&hfsList, hfs);
            }
            else if (hfs->xrefTable[0] != 0)
            {
                // Use sqlTableExists because xrefTable might be $db.$table,
                // not supported by hTableExists / hTableOrSplitExists
                // NOTE hfs->xrefTable can sometimes contain a comma-separated table list,
                // rather than just a single table.
                struct sqlConnection *conn = hAllocConn(database);
                char *tables = replaceChars(hfs->xrefTable, ",", " ");
                boolean exists = sqlTablesExist(conn, tables);
                hFreeConn(&conn);
                freeMem(tables);
                if (! exists)
                {
                    if (verboseLevel() > 1)
                        printf("%s (xref) missing\n", hfs->xrefTable);
                    slRemoveEl(&hfsList, hfs);
                }
            }
        }
    }

    for (hfs = hfsList; hfs != NULL; hfs = hfsNext)
    {
        hfsNext = hfs->next;
        if (! hashLookup(uniqHash, hfs->searchName))
        {
            hashAdd(uniqHash, hfs->searchName, hfs);
            slAddHead(pSpecList, hfs);
        }
    }
}
static boolean canIntersect(char *db, char *table)
/* Return true if table exists and is positional. */
{
if (isCustomTrack(table) && ctLookupName(table) != NULL)
    return TRUE;
if (sameWord(table, WIKI_TRACK_TABLE))
    return TRUE;
if (hTableOrSplitExists(db, table))
    return isPositional(db, table);
return FALSE;
}
Beispiel #3
0
boolean canIntersect(char *db, char *table)
/* Return true if table exists and is positional. */
{
if (isCustomTrack(table) && ctLookupName(table) != NULL)
    return TRUE;
if (isBamTable(table))
    return TRUE;
if (isBigWigTable(table))
    return TRUE;
if (isBigBed(database, table, curTrack, ctLookupName))
    return TRUE;
if (isVcfTable(table, NULL))
    return TRUE;
if (isHubTrack(table))
    return TRUE;
if (sameWord(table, WIKI_TRACK_TABLE))
    return TRUE;
if (hTableOrSplitExists(db, table))
    return isPositional(db, table);
return FALSE;
}
Beispiel #4
0
static struct trackDb *pruneStrict(struct trackDb *tdbList, char *db)
/* Remove tracks without data.  For parent tracks data in any child is sufficient to keep
 * them alive. */
{
struct trackDb *newList = NULL, *tdb, *next;
for (tdb = tdbList; tdb != NULL; tdb = next)
    {
    next = tdb->next;
    verbose(3,"pruneStrict checking track: '%s'\n", tdb->track);
    if (tdb->subtracks != NULL)
	{
	tdb->subtracks = pruneStrict(tdb->subtracks, db);
	}
    if (tdb->subtracks != NULL)
        {
	slAddHead(&newList, tdb);
	}
    else if (hTableOrSplitExists(db, tdb->table))
        {
	slAddHead(&newList, tdb);
	}
    else if (tdbIsDownloadsOnly(tdb))
        {
        slAddHead(&newList, tdb);
        }
    // We will allow these at some point, but currently(10/10/2011) the table browser still chokes.
    //else if (trackDbSetting(tdb, "bigDataUrl") != NULL)
    //    {
    //    slAddHead(&newList, tdb);
    //    }
    else
	verbose(3,"pruneStrict removing track: '%s' no table %s\n", tdb->track, tdb->table);
    }
slReverse(&newList);
return newList;
}