Ejemplo n.º 1
0
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) ;

}
Ejemplo n.º 2
0
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) ;
}
Ejemplo n.º 3
0
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) ;

}
Ejemplo n.º 4
0
void
readcommands (int argc, char **argv)
{

  int i;
  char *parname = NULL;
  phandle *ph;

  while ((i = getopt (argc, argv, "i:o:p:n:m:t:V")) != -1)
    {

      switch (i)
        {

        case 'i':
          iname = strdup (optarg);
          break;

        case 'o':
          oname = strdup (optarg);
          break;

        case 't':
          twxtab = strdup (optarg);
          break;

        case 'n':
          nval = atof (optarg);
          break;

        case 'm':
          minleneig = atoi (optarg);
          break;

        case 'p':
          parname = strdup (optarg);
          break;

        case 'V':
          verbose = YES;
          break;

        case '?':
          printf ("Usage: bad params.... \n");
          fatalx ("bad params\n");
        }
    }

  if (parname == NULL)
    return;

  printf ("parameter file: %s\n", parname);
  ph = openpars (parname);

  getstring (ph, "input:", &iname);
  getstring (ph, "output:", &oname);
  getdbl (ph, "nval:", &nval);
  getint (ph, "minleneig:", &minleneig);

  writepars (ph);
  closepars (ph);

}
Ejemplo n.º 5
0
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) ;

}