Exemple #1
0
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;
}
Exemple #2
0
static void setOptions(struct hash *hash)
/* Set global options hash to hash, and also do processing
 * of log file and other common options. */
{
options = hash;
if (optionExists("verbose"))
    verboseSetLevel(optionInt("verbose", 0));
}
int main(int argc, char *argv[])
/* Process command line */
{
int verb = 0;

verboseSetLevel(0);
optionInit(&argc, argv, optionSpecs);
if (argc != 4 & argc != 5)
    {
fprintf(stdout, "USAGE: extractPslForLfs [-verbose=<level>] psl lfsBed outputPsl\n");
    return 1;
    }
verb = optionInt("verbose", 0);
verboseSetLevel(verb);
extractPslForLfs(argv[1], argv[2], argv[3]);
return (0);
}
int main(int argc, char *argv[])
/* Process command line. */
{
optionInit(&argc, argv, options);
if (argc != 5)
    usage();
if (optionExists("verbose"))
    verboseSetLevel(1);
cgapSageBedAddFreqs(argv[1], argv[2], argv[3], argv[4]);
return 0;
}
Exemple #5
0
int main(int argc, char *argv[])
/* Process command line. */
{
cgiSpoof(&argc, argv);
userCount = cgiOptionalInt("userCount", userCount);
randSeed = cgiOptionalInt("randSeed", (int)getpid());
verboseSetLevel(cgiOptionalInt("verbose", 1));
readOnly = cgiVarExists("readOnly");
srand(randSeed);
if (argc != 7)
    usage();
cartSimNoInsert(argv[1], argv[2], argv[3], argv[4], argv[5], argv[6]);
return 0;
}
int main(int argc, char *argv[])
/* Process command line. */
{
optionInit(&argc, argv, optionSpecs);
if (argc < 4)
    usage();
noBin = optionExists("noBin") || optionExists("nobin");
noSort = optionExists("noSort");
strictTab = optionExists("tab");
oldTable = optionExists("oldTable");
sqlTable = optionVal("sqlTable", sqlTable);
renameSqlTable = optionExists("renameSqlTable");
trimSqlTable = optionExists("trimSqlTable");
hasBin = optionExists("hasBin");
noLoad = optionExists("noLoad");
noHistory = optionExists("noHistory");
bedGraph = optionInt("bedGraph",0);
bedDetail = optionExists("bedDetail");
minScore = optionInt("minScore",100);
if (minScore<0 || minScore>1000)
    errAbort("minScore must be between 0-1000\n");
notItemRgb = optionExists("notItemRgb");
if (notItemRgb) itemRgb = FALSE;
maxChromNameLength = optionInt("maxChromNameLength",0);
noStrict = optionExists("noStrict") || optionExists("nostrict");
allowStartEqualEnd = optionExists("allowStartEqualEnd");
tmpDir = optionVal("tmpDir", tmpDir);
nameIx = ! optionExists("noNameIx");
ignoreEmpty = optionExists("ignoreEmpty");
allowNegativeScores = optionExists("allowNegativeScores");
customTrackLoader = optionExists("customTrackLoader");
/* turns on: noNameIx, ignoreEmpty, allowStartEqualEnd, allowNegativeScores
 * -verbose=0 */
if (customTrackLoader)
    {
    ignoreEmpty = TRUE;
    noHistory = TRUE;
    nameIx = FALSE;
    allowStartEqualEnd = TRUE;
    allowNegativeScores = TRUE;
    verboseSetLevel(0);
    }
fillInScoreColumn = optionVal("fillInScore", NULL);
hgLoadBed(argv[1], argv[2], argc-3, argv+3);
return 0;
}
int main(int argc, char *argv[])
/* Process command line. */
{
optionInit(&argc, argv, optionSpecs);
if (argc != 3)
    usage();
trials = optionInt("trials", 0);
seed = optionInt("seed", 0);
shoulder = optionInt("shoulder", 100);
neighbor = optionVal("neighbor", NULL);
bedOutFile = optionVal("bed", NULL);
zeroBedOutFile = optionVal("zeroBed", NULL);
distOut = optionVal("distOut", NULL);
shoulderBedOutFile = optionVal("shoulderBed", NULL);
verbosity = optionInt("verbose", 1);
upstreamOnly = optionExists("upstreamOnly");
if (! upstreamOnly)
    downstreamOnly = optionExists("downstreamOnly");

verboseSetLevel(verbosity);
verbose(2,"bounding elements file: %s\n", argv[1]);
verbose(2,"placed items file: %s\n", argv[2]);
if (neighbor)
    verbose(2,"nearest neighbor file: %s\n", neighbor);
if (upstreamOnly)
    verbose(2,"nearest neighbor measured only to upstream element\n");
if (downstreamOnly)
    verbose(2,"nearest neighbor measured only to downstream element\n");
if (!upstreamOnly && !downstreamOnly)
    verbose(2,"nearest neighbor measured either to upstream or downstream element\n");
if (bedOutFile)
    verbose(2,"last alignment of trials output to bed file: %s\n", bedOutFile);
if (zeroBedOutFile)
    verbose(2,"zero distance items to bed file: %s\n", zeroBedOutFile);
if (distOut)
    verbose(2,"distances written to bedGraph file: %s\n", distOut);
if (shoulderBedOutFile)
    verbose(2,"shoulder distance items to bed file: %s\n", shoulderBedOutFile);
verbose(2,"number of trials: %d\n", trials);
verbose(2,"seed value for drand48(): %d\n", seed);
verbose(2,"shoulder value: %d\n", shoulder);

randomPlacement(argv[1], argv[2]);
verbose(3,"at exit of main()\n");
return(0);
}
Exemple #8
0
int main(int argc, char *argv[])
{
  struct lineFile *pf, *ef, *apf;
  FILE *of, *nf, *enf=NULL;
  char *efName=NULL, filename[256];
  int verb = 0;

verboseSetLevel(0);
optionInit(&argc, argv, optionSpecs);
if (argc < 3)
    {
      fprintf(stderr, "USAGE: pslAnal [-epcr=<file> -verbose=<level>] <isPCR psl file> <all.primers> <outfile>\n");
    return 1;
    }
verb = optionInt("verbose", 0);
verboseSetLevel(verb);

 efName = optionVal("epcr", NULL);
 pf = pslFileOpen(argv[1]);
 apf = lineFileOpen(argv[2], TRUE);

 of = mustOpen(argv[3], "w");
 sprintf(filename, "%s.notfound.primers", argv[3]);
 nf = mustOpen(filename, "w");

 verbose(1, "Reading all.primers file\n");
 readPrimerInfo(apf);

 if (efName)
   {
     ef = lineFileOpen(efName, TRUE);
     verbose(1, "Reading epcr file\n");
     readEpcr(ef);
   }

 verbose(1, "Reading and processing isPCR file\n");
 processPrimers(pf, of);

 if (efName)
   {
     verbose(1, "Writing epcr.not.found file\n");
     sprintf(filename, "epcr.not.found");
     enf = mustOpen(filename, "w");
     writeEpcrNotFound(enf);
   }

 verbose(1, "Writing out primers not found\n");
 writePrimersNotFound(nf);

 if (efName)
   {
     lineFileClose(&ef);
     fclose(enf);
   }
 lineFileClose(&pf);
 lineFileClose(&apf);
 fclose(of);
 fclose(nf);

 return(0);
}
int main(int argc, char *argv[])
{
struct lineFile *cgf, *clf, *mkf, *nmf, *acf, *usf;
FILE *bacAlias, *bacXRef; 
int verb = 0;
char *dir, errorFile[256], aliasFile[256], xRefFile[256];

verboseSetLevel(0);
optionInit(&argc, argv, optionSpecs);
if (argc != 8)
    {
fprintf(stdout, "USAGE: formatZfishSts [-verbose=<level>] <contig file> <clone file> <marker file> <list of BACs and chroms> <accessions> <UniSTS IDs file><output directory>\n");
    return 1;
    }
verb = optionInt("verbose", 0);
verboseSetLevel(verb);

fprintf(stdout, "Opening and reading files ...\n");
cgf = lineFileOpen(argv[1], TRUE );
clf = lineFileOpen(argv[2], TRUE);
mkf = lineFileOpen(argv[3], TRUE);
nmf = lineFileOpen(argv[4], TRUE);
acf = lineFileOpen(argv[5], TRUE);
usf = lineFileOpen(argv[6], TRUE);
dir = cloneString(argv[7]); 

sprintf(errorFile, "%s/error.log", dir);
sprintf(aliasFile, "%s/bacAlias.tab", dir);
sprintf(xRefFile, "%s/bacXRef.tab", dir);

fprintf(stdout, "files are error: %s, alias: %s and xRef: %s \n", errorFile, aliasFile, xRefFile);
stderr = mustOpen(errorFile, "w");
bacAlias = mustOpen(aliasFile, "w");
bacXRef = mustOpen(xRefFile, "w");

/* Read in contigs file with internal name, external name and FPC contig */
verbose(1, "Reading contig names file\n");
readContigs(cgf);

/* Read in internal BAC clone names and Sanger sts names  */
verbose(1, "Reading BAC clone names and Sanger sts names\n");
readCloneNames(clf);

/* Read in BAC clone information: Sanger name, UniSTS ID and aliases */
verbose(1, "Reading markers file\n");
readMarkers(mkf);

/* Read in file of BAC clones names and chroms mapped to by blat */
verbose(1, "Reading file of BAC clone external names\n");
readBacNames(nmf);

/* Read in internal names and corresponding GenBank accessions */
verbose(1, "Reading accessions file\n");
readAccessions(acf);

/*Read file of UniSTS IDs and BAC Clone IDs */
verbose(1, "Reading UniSTS IDs file\n");
readUniStsIds(usf);

/* Print out the STS marker information to a file */
verbose(1, "Creating output file\n");
fprintf(stdout, "Printing tab files for bacCloneAlias and bacCloneXRef tables ...\n");
writeAliasTable(bacAlias);
writeXRefTable(bacXRef);

lineFileClose(&nmf);
lineFileClose(&cgf);
lineFileClose(&clf);
lineFileClose(&mkf);
lineFileClose(&acf);
lineFileClose(&usf);
carefulClose(&bacXRef);
carefulClose(&bacAlias);
carefulClose(&stderr);

freeHashAndVals(&bacHash);
freeHashAndVals(&extNameHash);
freeHashAndVals(&aliasHash);
freeHashAndVals(&sangerByExtNameHash);

return(0);
}
int main(int argc, char *argv[])
{
  struct lineFile *pf, *ef, *apf;
  FILE *of, *nf, *enf=NULL;
  char *efName=NULL, filename[256], notFound[256];
  int verb = 0;

verboseSetLevel(0);
optionInit(&argc, argv, optionSpecs);
if (argc < 3)
    {
      verbose(0, "usage: pslFilterPrimers [-epcr=<file> -verbose=<level>] <isPCR psl file> <all.primers> <outfile>\n");
    return 1;
    }
verb = optionInt("verbose", 0);
verboseSetLevel(verb);

 efName = optionVal("epcr", NULL);
 pf = pslFileOpen(argv[1]);
 apf = lineFileOpen(argv[2], TRUE);

 of = mustOpen(argv[3], "w");
 safef(notFound, sizeof(filename), "%s.notfound.primers", argv[3]);
 nf = mustOpen(notFound, "w");

 verbose(1, "Reading all primers file: '%s'\n", argv[2]);
 readPrimerInfo(apf);

 if (efName)
   {
     ef = lineFileOpen(efName, TRUE);
     verbose(1, "Reading epcr file: '%s'\n", efName);
     readEpcr(ef);
   }

 verbose(1, "Reading isPCR file: '%s' processing output to: '%s'\n", argv[1], argv[3]);
 processPrimers(pf, of);

 if (efName)
   {
     safef(filename, sizeof(filename), "epcr.not.found");
     verbose(1, "Writing %s file\n", filename);
     enf = mustOpen(filename, "w");
     writeEpcrNotFound(enf);
   }

 verbose(1, "Writing primers not found to file: '%s'\n", notFound);
 writePrimersNotFound(nf);

 if (efName)
   {
     lineFileClose(&ef);
     fclose(enf);
   }
 lineFileClose(&pf);
 lineFileClose(&apf);
 fclose(of);
 fclose(nf);

 return(0);
}
Exemple #11
0
int main(int argc, char *argv[])
/* Process command line. */
{
char *chromInfo;
optionInit(&argc, argv, optionSpecs);
if (argc < 4)
    usage();
noBin = optionExists("noBin") || optionExists("nobin");
noSort = optionExists("noSort");
strictTab = optionExists("tab");
oldTable = optionExists("oldTable");
sqlTable = optionVal("sqlTable", sqlTable);
renameSqlTable = optionExists("renameSqlTable");
trimSqlTable = optionExists("trimSqlTable");
as = optionVal("as", as);
type = optionVal("type", type);
hasBin = optionExists("hasBin");
noLoad = optionExists("noLoad");
noHistory = optionExists("noHistory");
bedGraph = optionInt("bedGraph",0);
bedDetail = optionExists("bedDetail");
minScore = optionInt("minScore",100);
if (minScore<0 || minScore>1000)
    errAbort("minScore must be between 0-1000\n");
notItemRgb = optionExists("notItemRgb");
if (notItemRgb) itemRgb = FALSE;
maxChromNameLength = optionInt("maxChromNameLength",0);
dotIsNull = optionInt("dotIsNull",dotIsNull);
noStrict = optionExists("noStrict") || optionExists("nostrict");
allowStartEqualEnd = optionExists("allowStartEqualEnd");
tmpDir = optionVal("tmpDir", tmpDir);
nameIx = ! optionExists("noNameIx");
ignoreEmpty = optionExists("ignoreEmpty");
allowNegativeScores = optionExists("allowNegativeScores");
customTrackLoader = optionExists("customTrackLoader");
parseType();
/* turns on: noNameIx, ignoreEmpty, allowStartEqualEnd, allowNegativeScores
 * -verbose=0 */
if (customTrackLoader)
    {
    type = NULL;   /* because customTrack/Factory has already validated the input */
    ignoreEmpty = TRUE;
    noHistory = TRUE;
    nameIx = FALSE;
    allowStartEqualEnd = TRUE;
    allowNegativeScores = TRUE;
    verboseSetLevel(0);
    expireSeconds = 1200;	/* 20 minutes */
    (void) signal(SIGALRM, selfApoptosis);
    (void) alarm(expireSeconds);	/* CGI timeout */
    }
fillInScoreColumn = optionVal("fillInScore", NULL);

chromInfo=optionVal("chromInfo", NULL);
if (chromInfo)
    {
    if (!type)
	errAbort("Only use chromInfo with type for validate");
    // Get chromInfo from file
    chrHash = chromHashFromFile(chromInfo); 
    }
else if (type)
    {
    // Get chromInfo from DB
    chrHash = chromHashFromDatabase(argv[1]); 
    }

hgLoadBed(argv[1], argv[2], argc-3, argv+3);
return 0;
}
Exemple #12
0
int main(int argc, char *argv[])
{
  struct lineFile *sif, *dsf, *daf, *gbf;
  FILE *of, *opf, *oaf, *off, *asf, *dff;
  char filename[256], *gbName;
  int verb = 0;

verboseSetLevel(0);
optionInit(&argc, argv, optionSpecs);
if (argc < 3)
    {
      fprintf(stderr, "USAGE: updateStsInfo [-verbose=<level> -gb=<file>] <stsInfo file> <all.STS.fa> <dbSTS.sts> <dbSTS.aliases> <dbSTS.convert.fa> <outfile prefix>\n");
    return 1;
    }
verb = optionInt("verbose", 0);
verboseSetLevel(verb);

 gbName = optionVal("gb", NULL);
 if (gbName) 
   gbf = lineFileOpen(gbName, TRUE);
 sif = lineFileOpen(argv[1], TRUE);
 asf = mustOpen(argv[2], "r");
 dsf = lineFileOpen(argv[3], TRUE);
 daf = lineFileOpen(argv[4], TRUE);
 dff = mustOpen(argv[5], "r");

 safef(filename, ArraySize(filename), "%s.info", argv[6]);
 of = mustOpen(filename, "w");
 safef(filename, ArraySize(filename), "%s.primers", argv[6]);
 opf = mustOpen(filename, "w");
 safef(filename, ArraySize(filename), "%s.alias", argv[6]);
 oaf = mustOpen(filename, "w");
 safef(filename, ArraySize(filename), "%s.fa", argv[6]);
 off = mustOpen(filename, "w");

 /* Read in current stsInfo file */
 verbose(1, "Reading current stsInfo file: %s\n", argv[1]);
 readStsInfo(sif);

 /* Read in genbank accessions that have sequences */ 
 if (gbName)
   {
     verbose(1, "Reading genbank accession file: %s\n", gbName);
     readGbAcc(gbf);
   }

 /* Read in primer and organism information from dbSTS.sts */
 verbose(1, "Reading current dbSTS.sts file: %s\n", argv[3]);
 readDbstsPrimers(dsf);

 /* Read in names from dbSTS.alias and create new stsInfo records if needed */
 verbose(1, "Reading current dbSTS.aliases file: %s\n", argv[4]);
 readDbstsNames(daf);

 /* Read in current sequences for sts markers */
 verbose(1, "Reading current all.STS file: %s\n", argv[2]);
 readAllSts(asf);

 /* Read in new sequences from dbSTS.fa */
 verbose(1, "Reading dbSTS.fa file: %s\n", argv[5]);
 readDbstsFa(dff);

 /* Print out the new files */
 verbose(1, "Creating output files: %s .info .primers .alias .fa\n", argv[6]);
 writeOut(of, opf, oaf, off);

 fclose(asf);
 lineFileClose(&dsf);
 lineFileClose(&daf);
 fclose(dff);
 if (gbName)
   lineFileClose(&gbf);   
 fclose(of);
 fclose(opf);
 fclose(oaf);
 fclose(off);

 return(0);
}
int main(int argc, char *argv[])
{
struct lineFile *stf,*zmf, *gzf, *uaf, *zaf;
FILE *sto; 
char filename[256];
int verb = 0;

verboseSetLevel(0);
optionInit(&argc, argv, optionSpecs);
if (argc < 7)
    {
fprintf(stdout, "USAGE: formatZfishSts [-verbose=<level>] <UniSTS file> <genbank.txt> <UniSTS aliases> <ZFIN aliases> <ZFIN mappings.txt> <dbSTS map panels>\n");
    return 1;
    }
verb = optionInt("verbose", 0);
verboseSetLevel(verb);

stf = lineFileOpen(argv[1], TRUE);
zmf = lineFileOpen(argv[2], TRUE);
gzf = lineFileOpen(argv[3], TRUE);
uaf = lineFileOpen(argv[4], TRUE);
zaf = lineFileOpen(argv[5], TRUE);

stderr = mustOpen("/cluster/bluearc/danRer1/stsMarkers/formatOut/error.log", "w");
sprintf(filename, "%s.format", argv[6]);
sto = mustOpen(filename, "w");

/* Read in STS markers file */
verbose(1, "Reading STS markers file\n");
readStsMarkers(stf);

/* Read in ZFIN Ids, maps and marker names from mapping.txt */
verbose(1, "Reading mapping.txt file\n");
readZfinMapping(zmf);

/* Read in genbank accessions that have ZFIN IDs */
verbose(1, "Reading genbank accession and ZFIN ID file\n");
readGbZfin(gzf);

/* Read in UniSTS alias information */
verbose(1, "Reading UniSTS aliases file\n");
readUnistsAliases(uaf);
/* Read in ZFIN marker IDs with old names */
verbose(1, "Reading ZFIN marker IDs and old names - aliases from a file\n");
readZfinAliases(zaf);

/* Print out the STS marker information to a file */
verbose(1, "Creating output file\n");
writeOut(sto);

lineFileClose(&stf);
lineFileClose(&zmf);
lineFileClose(&gzf);
lineFileClose(&uaf);
lineFileClose(&zaf);
fclose(sto);
fclose(stderr);

freeHash(&stsHash);
freeHash(&stsIdHash);
freeHash(&zfinMarkerHash);
freeHash(&zfinIdHash);
freeHash(&aliasByNameHash);
freeHash(&aliasHash);
return(0);
}