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;
}
示例#2
0
static void ccdsMkTables(char *ccdsDb, char *hgDb, int ccdsBuildId, char *ccdsInfoOut, char *ccdsNotesOut, char *ccdsGeneOut)
/* create tables for hg db from imported CCDS database */
{
if (verboseLevel() >= 2)
    sqlMonitorEnable(JKSQL_TRACE);
struct sqlConnection *ccdsConn = ccdsSqlConn(ccdsDb);
struct genomeInfo *genome = getGenomeInfo(hgDb, ccdsBuildId);
struct hash *infoCcds = hashNew(20);
struct hash *geneCcds = hashNew(20);
struct hash* ignoreTbl = buildIgnoreTbl(ccdsConn, genome);

char ccdsInfoFile[PATH_LEN], ccdsInfoTbl[PATH_LEN];
ccdsGetTblFileNames(ccdsInfoOut, ccdsInfoTbl, ccdsInfoFile);
createCcdsInfo(ccdsConn, ccdsInfoFile, genome, ignoreTbl, infoCcds);

char ccdsNotesFile[PATH_LEN], ccdsNotesTbl[PATH_LEN];
ccdsGetTblFileNames(ccdsNotesOut, ccdsNotesTbl, ccdsNotesFile);
createCcdsNotes(ccdsConn, ccdsNotesFile, genome, infoCcds);

char ccdsGeneFile[PATH_LEN], ccdsGeneTbl[PATH_LEN];
ccdsGetTblFileNames(ccdsGeneOut, ccdsGeneTbl, ccdsGeneFile);
createCcdsGene(ccdsConn, ccdsGeneFile, genome, ignoreTbl, geneCcds);

sqlDisconnect(&ccdsConn);
sqlMonitorDisable();

gotCcdsValidate(infoCcds, geneCcds);

if (loadDb)
    loadTables(hgDb, ccdsInfoTbl, ccdsInfoFile, ccdsGeneTbl, ccdsGeneFile, ccdsNotesTbl, ccdsNotesFile);
}
示例#3
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[])
/* 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;
}