Exemplo n.º 1
0
void   emboss_getoptions(char *pgm, int argc, char *argv[])
{

  ajint numseqs=0;
  ajint numwts=0;
  AjPStr method = NULL;

  ancvar = false;
  dollo = true;
  jumble = false;
  njumble = 1;
  trout = true;
  usertree = false;
  goteof = false;
  weights = false;
  justwts = false;
  printdata = false;
  progress = true;
  treeprint = true;
  stepbox = false;
  ancseq = false;
  mulsets = false;
  msets = 1;

  embInitPV(pgm, argc, argv, "PHYLIPNEW",VERSION);

    phylostates = ajAcdGetDiscretestates("infile");


    while (phylostates[numseqs])
	numseqs++;


    phylotrees = ajAcdGetTree("intreefile");
    if (phylotrees)
    {
        numtrees = 0;
        while (phylotrees[numtrees])
            numtrees++;
        usertree = true;
    }

    phyloweights = ajAcdGetProperties("weights");
    if (phyloweights)
    {
      weights = true;
      numwts = ajPhyloPropGetSize(phyloweights);
    }

    if (numseqs > 1) {
      mulsets = true;
      msets = numseqs;
    }
    else if (numwts > 1) {
      mulsets = true;
      msets = numwts;
      justwts = true;
    }


    method = ajAcdGetListSingle("method");

    if(ajStrMatchC(method, "d")) dollo = true;
    else dollo = false;

   if(!usertree) {  
      njumble = ajAcdGetInt("njumble");
      if(njumble >0) {
        inseed = ajAcdGetInt("seed");
        jumble = true; 
        emboss_initseed(inseed, &inseed0, seed);
      }
      else njumble = 1;
    }

    if((mulsets) && (!jumble)) {
      jumble = true;
      inseed = ajAcdGetInt("seed");
      emboss_initseed(inseed, &inseed0, seed);
    }

    phyloanc = ajAcdGetProperties("ancfile");
    if(phyloanc) ancvar = true;


    threshold = ajAcdGetFloat("threshold");

    printdata = ajAcdGetBoolean("printdata");
    progress = ajAcdGetBoolean("progress");
    treeprint = ajAcdGetBoolean("treeprint");
    trout = ajAcdGetToggle("trout");
    stepbox = ajAcdGetBoolean("stepbox");
    ancseq = ajAcdGetBoolean("ancseq");

     embossoutfile = ajAcdGetOutfile("outfile");   
     emboss_openfile(embossoutfile, &outfile, &outfilename);
     
     if(trout) {
     embossouttree = ajAcdGetOutfile("outtreefile");
     emboss_openfile(embossouttree, &outtree, &outtreename);
     }

    printf("\nDollo and polymorphism parsimony algorithm, version %s\n\n", VERSION);


    fprintf(outfile,"\nDollo and polymorphism parsimony algorithm,");
    fprintf(outfile," version %s\n\n",VERSION);


}  /* emboss_getoptions */
Exemplo n.º 2
0
void emboss_getoptions(char *pgm, int argc, char *argv[])
{
  /* get from user the relevant parameters for the plotter and diagram */

  boolean getgrows;
  int m, n;
  AjPStr getstyle = NULL;
  AjPStr plottercode = NULL;
  AjPStr getpreviewer = NULL;
  AjPStr getnodeposition = NULL;
  
  embInitPV(pgm, argc, argv, "PHYLIPNEW",VERSION);

  n = (int)((pagex-hpmargin-0.01)/(paperx-hpmargin)+1.0);
  m = (int)((pagey-vpmargin-0.01)/(papery-vpmargin)+1.0);

    phylotrees = ajAcdGetTree("intreefile");
 
    plottercode = ajAcdGetListSingle("plotter");
    
    getplotter(ajStrGetCharFirst(plottercode));

    preview = true;
    getpreviewer = ajAcdGetListSingle("previewer"); /* sets plotter variable */

    if(ajStrMatchC(getpreviewer, "n")) {
      preview = false;
      previewer = other;   /* Added by Dan F. */
    }
    else if(ajStrMatchC(getpreviewer, "i")) previewer = ibm;
    else if(ajStrMatchC(getpreviewer, "m")) previewer = mac;
    else if(ajStrMatchC(getpreviewer, "x")) previewer = xpreview;
    else if(ajStrMatchC(getpreviewer, "w")) previewer = winpreview;
    else if(ajStrMatchC(getpreviewer, "i")) previewer = tek; 
    else if(ajStrMatchC(getpreviewer, "i")) previewer = decregis;
    else if(ajStrMatchC(getpreviewer, "o")) previewer = other;

    getgrows = ajAcdGetBoolean("grows");
    if(getgrows) grows = horizontal;
    else grows = vertical;


    getstyle = ajAcdGetListSingle("style");
    if(ajStrMatchC(getstyle, "c")) style = cladogram;
    else if(ajStrMatchC(getstyle, "p")) style = phenogram;
    else if(ajStrMatchC(getstyle, "e")) style = eurogram;
    else if(ajStrMatchC(getstyle, "s")) style = swoopogram;
    else if(ajStrMatchC(getstyle, "v")) style = curvogram;
    else if(ajStrMatchC(getstyle, "o")) {
      style = circular;
      treedepth = 1.0;
    }



    uselengths = ajAcdGetBoolean("lengths");

    labelrotation = ajAcdGetFloat("labelrotation");

    if(plotter==ray) {
      xmargin = ajAcdGetFloat("xrayshade");
      ymargin = ajAcdGetFloat("yrayshade");
    }
    else {
      xmargin = ajAcdGetFloat("xmargin");
      ymargin = ajAcdGetFloat("ymargin");
    }


    rescaled = ajAcdGetToggle("rescaled");
    if(rescaled) bscale = ajAcdGetFloat("bscale");

    treedepth = ajAcdGetFloat("treedepth");
    stemlength = ajAcdGetFloat("stemlength");
    nodespace = ajAcdGetFloat("nodespace");
    nodespace = 1.0 / nodespace;



    m = ajAcdGetFloat("pagesheight");
    n = ajAcdGetFloat("pageswidth"); 

    paperx = ajAcdGetFloat("paperx");
    papery = ajAcdGetFloat("papery");

    hpmargin = ajAcdGetFloat("hpmargin");
    vpmargin = ajAcdGetFloat("vpmargin");

    pagex = ((double)n * (paperx-hpmargin)+hpmargin);
    pagey = ((double)m * (papery-vpmargin)+vpmargin);
 

    getnodeposition = ajAcdGetListSingle("nodeposition");

    if(ajStrMatchC(getnodeposition, "i"))  nodeposition = intermediate;
    else if(ajStrMatchC(getnodeposition, "w")) nodeposition = weighted;
    else if(ajStrMatchC(getnodeposition, "c")) nodeposition = centered;
    else if(ajStrMatchC(getnodeposition, "i")) nodeposition = inner;
    else if(ajStrMatchC(getnodeposition, "v")) nodeposition = vshaped;

  embossplotfile = ajAcdGetOutfile("plotfile");
  emboss_openfile(embossplotfile, &plotfile, &pltfilename);

}  /* getparms */
Exemplo n.º 3
0
void emboss_getoptions(char *pgm, int argc, char *argv[])
{ 

  AjPStr datatype = NULL;

  global = false;
  jumble = false;
  njumble = 1;
  lengths = false;
  outgrno = 1;
  outgropt = false;
  all = true;
  contchars = false;
  trout = true;
  usertree = false;
  printdata = false;
  progress = true;
  treeprint = true;
  mulsets = false;
  datasets = 1;

  embInitPV (pgm, argc, argv, "PHYLIPNEW",VERSION);

    phylofreq = ajAcdGetFrequencies("infile");

    phylotrees = ajAcdGetTree("intreefile");
    if (phylotrees)
    {
        numtrees = 0;
        while (phylotrees[numtrees])
            numtrees++;
        usertree = true;
        lengths = ajAcdGetBoolean("lengths");
    }

   datatype = ajAcdGetListSingle("datatype");
   if(ajStrMatchC(datatype, "c")) contchars = true;

   outgrno = ajAcdGetInt("outgrno");
   if(outgrno != 0) outgropt = true;
   else outgrno = 1;

   if(!usertree) {
      global = ajAcdGetBoolean("global"); 
      njumble = ajAcdGetInt("njumble");
      if(njumble >0) {
        inseed = ajAcdGetInt("seed");
        jumble = true; 
        emboss_initseed(inseed, &inseed0, seed);
      }
      else njumble = 1;
    }

    printdata = ajAcdGetBoolean("printdata");
    progress = ajAcdGetBoolean("progress");
    treeprint = ajAcdGetBoolean("treeprint");
    trout = ajAcdGetToggle("trout");

    embossoutfile = ajAcdGetOutfile("outfile");   
    embossouttree = ajAcdGetOutfile("outtreefile");

    emboss_openfile(embossoutfile, &outfile, &outfilename);
    if(trout) emboss_openfile(embossouttree, &outtree, &outtreename);

    fprintf(outfile, "\nContinuous character Maximum Likelihood");
    fprintf(outfile, " method version %s\n\n",VERSION);

    ajStrDel(&datatype);
}  /* emboss_getoptions */
Exemplo n.º 4
0
void emboss_getoptions(char *pgm, int argc, char *argv[])
{

  AjPStr disttype = NULL;
  AjPStr tree_p = NULL;
  AjPStr style = NULL;

  dtype          = PHYLIPBSD;
  tree_pairing   = ADJACENT_PAIRS;
  output_scheme  = VERBOSE;
  ibmpc          = IBMCRT;
  ansi           = ANSICRT;
  didreroot      = false;
  spp            = 0;
  grbg           = NULL;
  col            = 0;


  noroot = true;
  numopts = 0;
  outgrno = 1;
  outgropt = false;
  progress = true;

  /* The following are not used by treedist, but may be used
     in functions in cons.c, so we set them here. */
  treeprint = false;
  trout = false;
  prntsets = false;

  embInitPV(pgm, argc, argv, "PHYLIPNEW",VERSION);

    phylotrees = ajAcdGetTree("intreefile");

    trees_in_1 = 0;
    while (phylotrees[trees_in_1])  trees_in_1++;

    progress = ajAcdGetBoolean("progress");

    outgrno = ajAcdGetInt("outgrno");
    if(outgrno != 0) outgropt = true;
    else outgrno = 1;

    disttype = ajAcdGetListSingle("dtype");

    if(ajStrMatchC(disttype, "s")) dtype = PHYLIPSYMMETRIC;
    else dtype = PHYLIPBSD;

    noroot = !ajAcdGetBoolean("noroot");

    tree_p = ajAcdGetListSingle("pairing");

    if(ajStrMatchC(tree_p, "a")) tree_pairing = ADJACENT_PAIRS;
    else if(ajStrMatchC(tree_p, "p")) tree_pairing = ALL_IN_FIRST;

    style = ajAcdGetListSingle("style"); 
    if(ajStrMatchC(style, "f")) output_scheme = FULL_MATRIX;
    else if(ajStrMatchC(style, "s")) output_scheme = SPARSE;
    else if(ajStrMatchC(style, "v")) output_scheme = VERBOSE;
 

    embossoutfile = ajAcdGetOutfile("outfile");   
    emboss_openfile(embossoutfile, &outfile, &outfilename);        

} /* embosss_getoptions */