void readcommands(int argc, char **argv) { int i; char *parname = NULL ; phandle *ph ; char str[5000] ; char *tempname ; int n ; while ((i = getopt (argc, argv, "p:vV")) != -1) { switch (i) { case 'p': parname = strdup(optarg) ; break; case 'v': printf("version: %s\n", WVERSION) ; break; case 'V': verbose = YES ; break; case '?': printf ("Usage: bad params.... \n") ; fatalx("bad params\n") ; } } pcheck(parname,'p') ; printf("parameter file: %s\n", parname) ; ph = openpars(parname) ; dostrsub(ph) ; getint(ph, "packmode:", &packmode) ; // controls internals getstring(ph, "genotypename:", &genotypename) ; getstring(ph, "snpname:", &snpname) ; getstring(ph, "indivname:", &indivname) ; getstring(ph, "pcaname:", &pcaname) ; getint(ph, "numpc:", &numpc) ; getint(ph, "qtmode:", &qtmode) ; getint(ph, "hashcheck:", &hashcheck) ; getstring(ph, "outputname:", &outputname); writepars(ph) ; closepars(ph) ; }
int main (int argc , char **argv) { phandle *ph ; char *parname ; parname = strdup("actpar") ; ph = openpars(parname) ; writepars(ph) ; printf("\n\n") ; dostrsub(ph) ; writepars(ph) ; closepars(ph) ; }
void readcommands(int argc, char **argv) { int i ; phandle *ph ; int t ; while ((i = getopt (argc, argv, "p:vV")) != -1) { switch (i) { case 'p': parname = strdup(optarg) ; break; case 'v': printf("version: %s\n", WVERSION) ; break; case 'V': verbose = YES ; break; case '?': printf ("Usage: bad params.... \n") ; fatalx("bad params\n") ; } } if (parname==NULL) { fprintf(stderr, "no parameters\n") ; return ; } pcheck(parname,'p') ; printf("parameter file: %s\n", parname) ; ph = openpars(parname) ; dostrsub(ph) ; getstring(ph, "genotypename:", &genotypename) ; getstring(ph, "snpname:", &snpname) ; getstring(ph, "indivname:", &indivname) ; getstring(ph, "poplistname:", &poplistname) ; getstring(ph, "snpeigname:", &snpeigname) ; getstring(ph, "snpweightoutname:", &snpeigname) ; /* changed 09/18/07 */ getstring(ph, "output:", &outputname) ; getstring(ph, "outputvecs:", &outputname) ; getstring(ph, "evecoutname:", &outputname) ; /* changed 11/02/06 */ getstring(ph, "outputvals:", &outputvname) ; getstring(ph, "evaloutname:", &outputvname) ; /* changed 11/02/06 */ getstring(ph, "badsnpname:", &badsnpname) ; getstring(ph, "outliername:", &outliername) ; getstring(ph, "outlieroutname:", &outliername) ; /* changed 11/02/06 */ getstring(ph, "phylipname:", &phylipname) ; getstring(ph, "phylipoutname:", &phylipname) ; /* changed 11/02/06 */ getstring(ph, "weightname:", &weightname) ; getstring(ph, "fstdetailsname:", &fstdetailsname) ; getdbl(ph, "relthresh:", &relthresh) ; getint(ph, "numeigs:", &numeigs) ; getint(ph, "numoutevec:", &numeigs) ; /* changed 11/02/06 */ getint(ph, "markerscore:", &markerscore) ; getint(ph, "chisqmode:", &chisqmode) ; getint(ph, "missingmode:", &missingmode) ; getint(ph, "fancynorm:", &fancynorm) ; getint(ph, "usenorm:", &fancynorm) ; /* changed 11/02/06 */ getint(ph, "dotpopsmode:", &dotpopsmode) ; getint(ph, "pcorrmode:", &pcorrmode) ; /* print correlations */ getint(ph, "pcpopsonly:", &pcpopsonly) ; /* but only within population */ getint(ph, "altnormstyle:", &altnormstyle) ; getint(ph, "hashcheck:", &hashcheck) ; getint(ph, "popgenmode:", &altnormstyle) ; getint(ph, "noxdata:", &noxdata) ; t = -1 ; getint(ph, "xdata:", &t) ; if (t>=0) noxdata = 1-t ; getint(ph, "nostatslim:", &nostatslim) ; getint(ph, "popsizelimit:", &popsizelimit) ; getint(ph, "minallelecnt:", &minallelecnt) ; getint(ph, "chrom:", &xchrom) ; getint(ph, "lopos:", &lopos) ; getint(ph, "hipos:", &hipos) ; getint(ph, "checksizemode:", &checksizemode) ; getint(ph, "pubmean:", &pubmean) ; getint(ph, "fstonly:", &fstonly) ; getint(ph, "fsthiprecision:", &fsthiprec) ; getint(ph, "ldregress:", &ldregress) ; getint(ph, "nsnpldregress:", &ldregress) ; /* changed 11/02/06 */ getdbl(ph, "ldlimit:", &ldlimit) ; /* in morgans */ getdbl(ph, "maxdistldregress:", &ldlimit) ; /* in morgans */ /* changed 11/02/06 */ getint(ph, "minleneig:", &nostatslim) ; getint(ph, "malexhet:", &malexhet) ; getint(ph, "nomalexhet:", &malexhet) ; /* changed 11/02/06 */ getint(ph, "familynames:", &familynames) ; getint(ph, "numoutliter:", &numoutliter) ; getint(ph, "numoutlieriter:", &numoutliter) ; /* changed 11/02/06 */ getint(ph, "numoutleigs", &numoutleigs) ; getint(ph, "numoutlierevec:", &numoutleigs) ; /* changed 11/02/06 */ getdbl(ph, "outlthresh:", &outlthresh) ; getdbl(ph, "outliersigmathresh:", &outlthresh) ; /* changed 11/02/06 */ getdbl(ph, "blgsize:", &blgsize) ; getstring(ph, "indoutfilename:", &indoutfilename) ; getstring(ph, "indivoutname:", &indoutfilename) ; /* changed 11/02/06 */ getstring(ph, "snpoutfilename:", &snpoutfilename) ; getstring(ph, "snpoutname:", &snpoutfilename) ; /* changed 11/02/06 */ getstring(ph, "genooutfilename:", &genooutfilename) ; getstring(ph, "genotypeoutname:", &genooutfilename) ; /* changed 11/02/06 */ getstring(ph, "outputformat:", &omode) ; getstring(ph, "outputmode:", &omode) ; getint(ph, "outputgroup:", &ogmode) ; getint(ph, "packout:", &packout) ; /* now obsolete 11/02/06 */ getstring(ph, "twxtabname:", &twxtabname) ; getdbl(ph, "r2thresh:", &r2thresh) ; getdbl(ph, "r2genlim:", &r2genlim) ; getdbl(ph, "r2physlim:", &r2physlim) ; getint(ph, "killr2:", &killr2) ; getint(ph, "numchrom:", &numchrom) ; printf("### THE INPUT PARAMETERS\n"); printf("##PARAMETER NAME: VALUE\n"); writepars(ph); }
void readcommands(int argc, char **argv) { int i,haploid=0; phandle *ph ; char str[5000] ; char *tempname ; int n, t ; while ((i = getopt (argc, argv, "f:b:p:g:s:o:vVx")) != -1) { switch (i) { case 'p': parname = strdup(optarg) ; break; case 'f': snpdetailsname = strdup(optarg) ; break; case 'g': graphname = strdup(optarg) ; break; case 'o': graphoutname = strdup(optarg) ; break; case 's': seed = atoi(optarg) ; break; case 'b': baseval = atof(optarg) ; break; case 'v': printf("version: %s\n", WVERSION) ; break; case 'x': doanalysis = NO ; break; case 'V': verbose = YES ; break; case '?': printf ("Usage: bad params.... \n") ; fatalx("bad params\n") ; } } if (parname==NULL) { fprintf(stderr, "no parameters\n") ; return ; } pcheck(parname,'p') ; printf("parameter file: %s\n", parname) ; ph = openpars(parname) ; dostrsub(ph) ; getstring(ph, "genotypename:", &genotypename) ; getstring(ph, "snpname:", &snpname) ; getstring(ph, "indivname:", &indivname) ; getstring(ph, "graphname:", &graphname) ; getstring(ph, "graphoutname:", &graphoutname) ; int numeg = 4 ; getstring(ph, "snpdetailsname:", &snpdetailsname) ; getstring(ph, "outpop:", &outpop) ; getstring(ph, "output:", &outputname) ; getstring(ph, "badsnpname:", &badsnpname) ; getstring(ph, "popfilename:", &popfilename) ; getstring(ph, "f3log:", &f3name) ; getstring(ph, "root:", &rootname) ; getdbl(ph, "blgsize:", &blgsize) ; getdbl(ph, "diag:", &diag) ; getdbl(ph, "f2diag:", &f2diag) ; getdbl(ph, "minvar:", &minvar) ; getint(ph, "bigiter:", &bigiter) ; getint(ph, "inbreed:", &inbreed) ; getint(ph, "startiter:", &startiter) ; getint(ph, "fancynorm:", &fancynorm) ; getint(ph, "noxdata:", &noxdata) ; t = -1 ; getint(ph, "xdata:", &t) ; if (t>=0) noxdata = 1-t ; getint(ph, "chrom:", &xchrom) ; getint(ph, "nochrom:", &zchrom) ; getint(ph, "doanalysis:", &doanalysis) ; getint(ph, "quartet:", &quartet) ; getint(ph, "nostatslim:", &nostatslim) ; getint(ph, "popsizelimit:", &popsizelimit) ; getint(ph, "gfromp:", &gfromp) ; // gen dis from phys getint(ph, "seed:", &seed) ; getint(ph, "details:", &details) ; getint(ph, "forcezmode:", &forcezmode) ; getint(ph, "dzeromode:", &dzeromode) ; getdbl(ph, "baseval:", &baseval) ; getdbl(ph, "jackquart:", &jackquart) ; getint(ph, "jackweight:", &jackweight) ; getint(ph, "pubjack:", &pubjack) ; getstring(ph, "dumpname:", &dumpname) ; getstring(ph, "loadname:", &loadname) ; printf("### THE INPUT PARAMETERS\n"); printf("##PARAMETER NAME: VALUE\n"); writepars(ph); }
void readcommands(int argc, char **argv) { int i,haploid=0; char *parname = NULL ; phandle *ph ; char str[5000] ; char *tempname ; int n ; while ((i = getopt (argc, argv, "p:vVf")) != -1) { switch (i) { case 'p': parname = strdup(optarg) ; break; case 'v': printf("version: %s\n", WVERSION) ; break; case 'V': verbose = YES ; break; case 'f': phasedmode = YES ; break; case '?': printf ("Usage: bad params.... \n") ; fatalx("bad params\n") ; } } pcheck(parname,'p') ; printf("parameter file: %s\n", parname) ; ph = openpars(parname) ; dostrsub(ph) ; getstring(ph, "geno1:", &geno1) ; getstring(ph, "snp1:", &snp1) ; getstring(ph, "ind1:", &ind1) ; getstring(ph, "geno2:", &geno2) ; getstring(ph, "snp2:", &snp2) ; getstring(ph, "ind2:", &ind2) ; getstring(ph, "indoutfilename:", &indoutfilename) ; getstring(ph, "indivoutname:", &indoutfilename) ; getstring(ph, "snpoutfilename:", &snpoutfilename) ; getstring(ph, "snpoutname:", &snpoutfilename) ; getstring(ph, "genooutfilename:", &genooutfilename) ; getstring(ph, "genotypeoutname:", &genooutfilename) ; getstring(ph, "outputformat:", &omode) ; getint(ph, "docheck:", &docheck) ; getint(ph, "hashcheck:", &hashcheck) ; getint(ph, "strandcheck:", &strandcheck) ; getint(ph, "phasedmode:", &phasedmode) ; writepars(ph) ; closepars(ph) ; }
void readcommands(int argc, char **argv) { int i,haploid=0; char *parname = NULL ; phandle *ph ; char str[5000] ; char *tempname ; int n ; while ((i = getopt (argc, argv, "p:vV")) != -1) { switch (i) { case 'p': parname = strdup(optarg) ; break; case 'v': printf("version: %s\n", WVERSION) ; break; case 'V': verbose = YES ; break; case '?': printf ("Usage: bad params.... \n") ; fatalx("bad params\n") ; } } pcheck(parname,'p') ; printf("parameter file: %s\n", parname) ; ph = openpars(parname) ; dostrsub(ph) ; /** DIR2: /fg/nfiles/admixdata/ms2 SSSS: DIR2/outfiles genotypename: DIR2/autos_ccshad_fakes eglistname: DIR2/eurlist output: eurout */ getstring(ph, "genotypename:", &genotypename) ; getstring(ph, "genotypelist:", &genotypelist) ; getstring(ph, "snpname:", &snpname) ; getstring(ph, "indivname:", &indivname) ; getstring(ph, "badsnpname:", &badsnpname) ; getstring(ph, "flipsnpname:", &flipsnpname) ; getstring(ph, "flipstrandname:", &flipstrandname) ; getstring(ph, "indoutfilename:", &indoutfilename) ; getstring(ph, "indivoutname:", &indoutfilename) ; /* changed 11/02/06 */ getstring(ph, "snpoutfilename:", &snpoutfilename) ; getstring(ph, "snpoutname:", &snpoutfilename) ; /* changed 11/02/06 */ getstring(ph, "genooutfilename:", &genooutfilename) ; getstring(ph, "genotypeoutname:", &genooutfilename) ; /* changed 11/02/06 */ getstring(ph, "outputformat:", &omode) ; getstring(ph, "outputmode:", &omode) ; getstring(ph, "polarize:", &polarid) ; getint(ph, "zerodistance:", &zerodistance) ; getint(ph, "checksizemode:", &checksizemode) ; getint(ph, "badpedignore:", &badpedignore) ; getint(ph, "numchrom:", &numchrom) ; getstring(ph, "xregionname:", &xregionname) ; getdbl(ph, "hwfilter:", &nhwfilter) ; getstring(ph, "deletesnpoutname:", &deletesnpoutname); getint(ph, "outputgroup:", &ogmode) ; getint(ph, "malexhet:", &malexhet) ; getint(ph, "nomalexhet:", &malexhet) ; /* changed 11/02/06 */ getint(ph, "tersemode:", &tersem) ; getint(ph, "familynames:", &familynames) ; getint(ph, "packout:", &packout) ; /* now obsolete 11/02/06 */ getint(ph, "decimate:", &decim) ; getint(ph, "dmindis:", &dmindis) ; getint(ph, "dmaxdis:", &dmaxdis) ; getint(ph, "fastdup:", &fastdup) ; getint(ph, "flipreference:", &flipreference) ; getint(ph, "fastdupnum:", &fastdupnum) ; getdbl(ph, "fastdupthresh:", &fastdupthresh) ; getdbl(ph, "fastdupkill:", &fastdupkill) ; getint(ph, "killr2:", &killr2) ; getint(ph, "hashcheck:", &hashcheck) ; getint(ph, "outputall:", &outputall) ; getint(ph, "sevencolumnped:", &sevencolumnped) ; getint(ph, "phasedmode:", &phasedmode) ; getdbl(ph, "r2thresh:", &r2thresh) ; getdbl(ph, "r2genlim:", &r2genlim) ; getdbl(ph, "r2physlim:", &r2physlim) ; getint(ph, "chrom:", &xchrom) ; getint(ph, "lopos:", &lopos) ; getint(ph, "hipos:", &hipos) ; getint(ph, "minchrom:", &minchrom) ; getint(ph, "maxchrom:", &maxchrom) ; getdbl(ph, "maxmissfrac:", &maxmissfrac) ; getint(ph, "maxmissing:", &maxmiss) ; getstring(ph, "poplistname:", &poplistname) ; getstring(ph, "newsnpname:", &newsnpname) ; getstring(ph, "newindivname:", &newindivname) ; getint(ph, "deletedup:", &deletedup) ; getint(ph, "mkdiploid:", &mkdiploid) ; writepars(ph) ; closepars(ph) ; }