int main(int argc, char *argv[]) /* Process command line. */ { setlinebuf(stdout); setlinebuf(stderr); optionInit(&argc, argv, optionSpecs); boolean drop = optionExists("drop"); gbVerbInit(optionInt("verbose", 0)); if (gbVerbose >= 5) sqlMonitorEnable(JKSQL_TRACE); if (drop) { if (argc != 2) usage(); mgcDropTables(argv[1]); } else { if (argc != 3) usage(); workDir = optionVal("workdir", "work/load/mgc"); gbMakeDirs(workDir); allMgcTables = optionExists("allMgcTables"); mgcDbLoad(argv[1], argv[2]); } return 0; }
int main(int argc, char *argv[]) /* Process command line. */ { char *repairTask, **dbs, *accFile = NULL;; boolean dryRun; int ndbs, i; optionInit(&argc, argv, optionSpecs); if (argc < 3) usage("wrong # args"); gbVerbInit(optionInt("verbose", 1)); dryRun = optionExists("dryRun"); accFile = optionVal("accFile", NULL); repairTask = argv[1]; dbs = argv+2; ndbs = argc-2; if (sameString(repairTask, "refPepList")) { if (accFile != NULL) errAbort("-accFile is not valid for refPepList"); for (i = 0; i < ndbs; i++) refPepList(dbs[i], stdout); } else if (sameString(repairTask, "refPepRepair")) { for (i = 0; i < ndbs; i++) refPepRepair(dbs[i], accFile, dryRun); } else errAbort("invalid repairTask: %s", repairTask); return 0; }
int main(int argc, char *argv[]) /* Process command line. */ { char *database; optionInit(&argc, argv, optionSpecs); if (argc != 2) usage(); if (optionExists("gbdbCurrent")) { char* p; gGbdbMapToCurrent = optionVal("gbdbCurrent", NULL); /* trim trailing slashes */ for (p = gGbdbMapToCurrent + (strlen(gGbdbMapToCurrent)-1); ((p > gGbdbMapToCurrent) && (*p == '/')); p--) *p = '\0'; } gbVerbInit(optionInt("verbose", 0)); if (gbVerbose >= 5) sqlMonitorEnable(JKSQL_TRACE); database = argv[1]; gOptions = dbLoadOptionsParse(database); testMode = optionExists("test"); gCheckExtSeqRecs = optionExists("checkExtSeqRecs"); gbVerbEnter(0, "gbSanity: begin: %s", database); gbSanity(database); gbVerbLeave(0, "gbSanity: completed: %d errors", errorCnt); return ((errorCnt == 0) ? 0 : 1); }
int main(int argc, char* argv[]) /* parse command line */ { int numMrnas; int numEsts; char *accList, *selectAccFile; char *database, *relName, *outDir; verboseSetLevel(0); optionInit(&argc, argv, optionSpecs); if (argc != 4) usage(); relName = argv[1]; database = argv[2]; outDir = argv[3]; numMrnas = optionInt("numMrnas", 10); numEsts = optionInt("numEsts", 10); accList = optionVal("accList", NULL); selectAccFile = optionVal("selectAcc", NULL); gbVerbInit(optionInt("verbose", 0)); if (verboseLevel() > 0) setlinebuf(stderr); getTestSubset(numMrnas, numEsts, accList, selectAccFile, relName, database, outDir); return 0; }
int main(int argc, char* argv[]) { char *relName, *updateName, *typeAccPrefix, *database, *sep; struct gbIndex* index; struct gbSelect select; struct gbSelect* prevSelect = NULL; struct gbAlignInfo alignInfo; boolean noMigrate; ZeroVar(&select); optionInit(&argc, argv, optionSpecs); if (argc != 5) usage(); maxFaSize = optionInt("fasize", -1); workDir = optionVal("workdir", "work/align"); noMigrate = optionExists("noMigrate"); createPolyASizes = optionExists("polyASizes"); gbVerbInit(optionInt("verbose", 0)); relName = argv[1]; updateName = argv[2]; typeAccPrefix = argv[3]; database = argv[4]; /* parse typeAccPrefix */ sep = strchr(typeAccPrefix, '.'); if (sep != NULL) *sep = '\0'; select.type = gbParseType(typeAccPrefix); if (sep != NULL) { select.accPrefix = sep+1; *sep = '.'; } select.orgCats = gbParseOrgCat(optionVal("orgCats", "native,xeno")); index = gbIndexNew(database, NULL); select.release = gbIndexMustFindRelease(index, relName); select.update = gbReleaseMustFindUpdate(select.release, updateName); gbVerbMsg(0, "gbAlignGet: %s/%s/%s/%s", select.release->name, select.release->genome->database, select.update->name, typeAccPrefix); /* Get the release to migrate, if applicable */ if (!noMigrate) prevSelect = gbAlignGetMigrateRel(&select); alignInfo = gbAlignGet(&select, prevSelect); /* always print stats */ fprintf(stderr, "gbAlignGet: %s/%s/%s/%s: align=%d, migrate=%d\n", select.release->name, select.release->genome->database, select.update->name, typeAccPrefix, alignInfo.align.accTotalCnt, alignInfo.migrate.accTotalCnt); gbIndexFree(&index); /* print alignment and migrate count, which is read by the driver program */ printf("alignCnt: %d %d\n", alignInfo.align.accTotalCnt, alignInfo.migrate.accTotalCnt); return 0; }
int main(int argc, char* argv[]) { char *relName, *updateName, *typeAccPrefix, *database, *sep; struct gbIndex* index; struct gbSelect select; struct gbSelect* prevSelect = NULL; boolean noMigrate; ZeroVar(&select); optionInit(&argc, argv, optionSpecs); if (argc != 5) usage(); gWorkDir = optionVal("workdir", "work/align"); gSortTmp = optionVal("sortTmp", NULL); noMigrate = optionExists("noMigrate"); gbVerbInit(optionInt("verbose", 0)); relName = argv[1]; updateName = argv[2]; typeAccPrefix = argv[3]; database = argv[4]; /* parse typeAccPrefix */ sep = strchr(typeAccPrefix, '.'); if (sep != NULL) *sep = '\0'; select.type = gbParseType(typeAccPrefix); if (sep != NULL) { select.accPrefix = sep+1; *sep = '.'; } index = gbIndexNew(database, NULL); select.release = gbIndexMustFindRelease(index, relName); select.update = gbReleaseMustFindUpdate(select.release, updateName); select.orgCats = gbParseOrgCat(optionVal("orgCats", "native,xeno")); gbVerbMsg(0, "gbAlignInstall: %s/%s/%s/%s", select.release->name, select.release->genome->database, select.update->name, typeAccPrefix); /* Get the release to migrate, if applicable */ if (!noMigrate) prevSelect = gbAlignGetMigrateRel(&select); gbAlignInstall(&select, prevSelect); /* must go to stderr to be logged */ gbVerbMsg(0, "gbAlignInstall: complete"); gbIndexFree(&index); return 0; }
int main(int argc, char* argv[]) { int argi; char* dumpFile = NULL; unsigned flags = 0; char* database, *accPrefix; struct gbIndex* index; struct stepInfo runInfo; gbVerbInit(0); optionInit(&argc, argv, optionSpecs); if (argc < 2) usage(); if (optionExists("processed")) flags |= DO_PROCESSED; if (optionExists("aligned")) flags |= DO_PROCESSED|DO_ALIGNED; if (optionExists("mrna")) flags |= DO_MRNA; if (optionExists("est")) flags |= DO_EST; dumpFile = optionVal("dump", NULL); database = optionVal("db", NULL); accPrefix = optionVal("accPrefix", NULL); if ((flags & DO_ALIGNED) && (database == NULL)) errAbort("must specify -db with -aligned"); if (!(flags & (DO_MRNA|DO_EST))) errAbort("must specify at least one of -mrna or -est"); if (!(flags & (DO_ALIGNED|DO_PROCESSED))) errAbort("must specify at least one of -processed or -aligned"); index = gbIndexNew(database, NULL); runInfo = beginStep(index, NULL, "loading index files"); for (argi = 1; argi < argc; argi++) testRelLoad(index, gbIndexMustFindRelease(index, argv[argi]), database, flags, accPrefix); if (dumpFile != NULL) { FILE* dumpOut = mustOpen(dumpFile, "w"); gbIndexDump(index, dumpOut); if (fclose(dumpOut) != 0) errnoAbort("close of dumpfile"); } endStep(index, &runInfo); gbIndexFree(&index); return 0; }
int main(int argc, char* argv[]) { optionInit(&argc, argv, optionSpecs); if (argc != 1) usage(); gbVerbInit(optionInt("verbose", 0)); gGbRoot = optionVal("gbRoot", NULL); gbProcessedCheck(); if (gErrorCnt > 0) errAbort("%d errors detected in processed entries, most likely need to " "add to etc/ignore.idx", gErrorCnt); return 0; }
int main(int argc, char *argv[]) /* Process command line. */ { boolean drop, move, copy; struct sigaction sigSpec; setlinebuf(stdout); setlinebuf(stderr); ZeroVar(&sigSpec); sigSpec.sa_handler = sigStopSignaled; sigSpec.sa_flags = SA_RESTART; if (sigaction(SIGUSR1, &sigSpec, NULL) < 0) errnoAbort("can't set SIGUSR1 handler"); optionInit(&argc, argv, optionSpecs); drop = optionExists("drop"); move = optionExists("move"); copy = optionExists("copy"); gReload = optionExists("reload"); if (move || copy) { if (argc != 3) usage(); } else if (argc != 2) usage(); if ((drop+move+copy) > 1) errAbort("can only specify one of -drop, -move, or -copy"); gbVerbInit(optionInt("verbose", 0)); if (gbVerbose >= 6) sqlMonitorEnable(JKSQL_TRACE); if (drop) dropAll(argv[1]); else if (move) moveAll(argv[1], argv[2]); else if (copy) copyAll(argv[1], argv[2]); else { char *reloadList = optionVal("reloadList", NULL); gDatabase = argv[1]; gOptions = dbLoadOptionsParse(gDatabase); gForceIgnoreDelete = optionExists("forceIgnoreDelete"); if (optionExists("rebuildDerived")) gOptions.flags |= DBLOAD_BYPASS_GBLOADED|DBLOAD_REBUILD_DERIVED; gMaxShrinkage = optionFloat("maxShrinkage", 0.1); gGbdbGenBank = optionVal("gbdbGenBank", NULL); if (gGbdbGenBank == NULL) gGbdbGenBank = gbConfGet(gOptions.conf, "gbdb.genbank"); if (gGbdbGenBank == NULL) gGbdbGenBank = "/gbdb/genbank"; gWorkDir = optionVal("workdir", "work/load"); if (gOptions.flags & DBLOAD_DRY_RUN) printf("*** using dry run mode ***\n"); gbLoadRna(reloadList); } return 0; }