struct slName *subtractFiles(struct slName *fileList)
/* Subtract two files using subtractLists */
{
struct slName *initialList = slNameLoadReal(fileList->name);
struct slName *subtractMe = slNameLoadReal(fileList->next->name);
struct slName *diffList = subtractLists(initialList, subtractMe);
slNameFreeList(&initialList);
slNameFreeList(&subtractMe);
return diffList;
}
void metaCollect(char *metaDb, char *reqViewsName, 
    char *expVarsName)
/* metaCollect - build collections using metadata. */
{
boolean validated;
struct mdbObj *mdbObjs = mdbObjsLoadFromFormattedFile(metaDb, &validated);
struct slName *expVars = slNameLoadReal(expVarsName);
struct slName *reqViews = slNameLoadReal(reqViewsName);

struct group *groups = groupByExpVar(mdbObjs, expVars);

checkOverlap(mdbObjs, groups);

checkForReqView(groups, reqViews);
}
Exemplo n.º 3
0
void refPepRepair(char *db,
                  char *accFile,
                  boolean dryRun)
/* fix dangling repPep gbSeq entries. */
{
struct sqlConnection *conn = sqlConnect(db);
struct brokenRefPepTbl *brpTbl;
struct extFileTbl* extFileTbl;
struct slName *accs = (accFile == NULL) ? NULL : slNameLoadReal(accFile);
if (!checkForRefLink(conn))
    {
    sqlDisconnect(&conn);
    return;
    }

gbVerbMsg(1, "%s: repairing refseq protein gbExtFile entries%s",
          sqlGetDatabase(conn), (dryRun? " (dry run)" : ""));

extFileTbl = extFileTblLoad(conn);
brpTbl = brokenRefPepTblNew(conn, accs);
brokenRefPepGetSeqScan(conn, extFileTbl, brpTbl);
brokenRefPepGetMrnas(conn, brpTbl);

fillInFastaOffsets(brpTbl, conn, extFileTbl);
if (brpTbl->numToRepair > 0)
    makeRepairs(brpTbl, conn, extFileTbl, dryRun);
else
    gbVerbMsg(1, "%s: no refseq proteins to repair", sqlGetDatabase(conn));
brokenRefPepTblFree(&brpTbl);
extFileTblFree(&extFileTbl);
sqlDisconnect(&conn);
slFreeList(&accs);
}
struct slName *intersectFiles(struct slName *fileList)
/* Successively intersect files. */
{
struct slName *isectList = slNameLoadReal(fileList->name);
struct slName *curFile = fileList->next;
struct slName *cur;
while (curFile != NULL)
    {
    struct hash *isectHash = hashList(isectList);
    struct slName *someWords = slNameLoadReal(curFile->name);
    struct slName *bothWords = thoseInHash(isectHash, someWords, FALSE);
    slNameFreeList(&someWords);
    slNameFreeList(&isectList);
    isectList = bothWords;
    freeHashAndVals(&isectHash);
    curFile = curFile->next;
    }
return isectList;
}
struct slName *unionFiles(struct slName *fileList)
/* Successively union files. */
{
struct slName *initialList = slNameLoadReal(fileList->name);
struct hash *theHash = hashList(initialList);
struct slName *nextFile = fileList->next;
struct slName *unionList = NULL;
struct slName *cur;
while (nextFile != NULL)
    {
    struct slName *someWords = slNameLoadReal(nextFile->name);
    addMoreToHash(theHash, someWords);
    slNameFreeList(&someWords);
    nextFile = nextFile->next;
    }
unionList = hashToList(theHash);
hashFree(&theHash);
slNameFreeList(&initialList);
return unionList;
}