Navigation Banner
  next up previous
Next: Read a data file. Up: Basics Previous: Basics

Looking for a DOS Batch File reference? Try this.


Simple Batch Files

Most batch files will include a few key elements:

1.
Read a data file
2.
Select the species and characters to be analyzed (Filter the data)
3.
Tabulate or define frequencies of characters
4.
Describe the form of a substitution matrix
5.
Combine the character frequencies and substitution matrix into an evolutionary model for your characters
6.
Describe a phylogenetic tree
7.
Define a likelihood function based on the tree, data, and model.
8.
Maximize the likelihood function
9.
Print the results to the screen and/or an output file.

Let us begin with a very simple example. In the following batch file we will fit a set of DNA sequence data from 4 species to an unrooted tree using the F81 (Felsenstein 1981) model of sequence evolution. (The batch file is named "basics.bf" and should be in the Tutorial directory of the Hy-Phy distribution.)

DataSet myData = ReadDataFile ("data/demo.seq");
DataSetFilter myFilter = CreateFilter (myData,1);
HarvestFrequencies (obsFreqs, myFilter, 1, 1, 1);
F81RateMatrix = 
                {{* ,mu,mu,mu}
                 {mu,* ,mu,mu}
                 {mu,mu,* ,mu}
                 {mu,mu,mu,* }};
Model F81 = (F81RateMatrix, obsFreqs);
Tree myTree = ((a,b),c,d);
LikelihoodFunction theLikFun = (myFilter, myTree, obsFreqs);
Optimize (paramValues, theLikFun);
fprintf  (stdout, theLikFun);

First of all, notice that the nine lines of code in "basics.bf" (the comment lines have been removed in the above display) correspond to the nine steps enumerated previously. Let us consider each of them.




next up previous
Next: Read a data file. Up: Basics Previous: Basics
Spencer Muse
2000-05-31
 
Sergei L. Kosakovsky Pond and Spencer V. Muse, 1997-2002