Presentation is loading. Please wait.

Presentation is loading. Please wait.

Ben Stöver WS 2012/2013 Model and hypothesis testing with HyPhy Molecular Phylogenetics – exercise.

Similar presentations


Presentation on theme: "Ben Stöver WS 2012/2013 Model and hypothesis testing with HyPhy Molecular Phylogenetics – exercise."— Presentation transcript:

1 Ben Stöver WS 2012/2013 Model and hypothesis testing with HyPhy Molecular Phylogenetics – exercise

2 Ben Stöver Model and hypothesis testing with HyPhy Fortgeschrittenenmodul Molecular Phylogenetics Winter term 2012/2013 26.02.2012 1 The HyPhy batch language (HBL) Titel der Präsentation 2 Existed before the GUI of HyPhy. All analysis can also be performed using a batch file. More analyses procedures than in the GUI are available. A once defined analysis can be repeated with any dataset without having to click everything again in the GUI. Some steps of the analyses might take very long, so you would not want to sit in front of the GUI and wait until you can click on the next button. HyPhy scripts are saved as text files. They can be executed by selecting „File“ -> „Open“ -> „Open Batch File“ from the HyPhy main menu.

3 Ben Stöver Model and hypothesis testing with HyPhy Fortgeschrittenenmodul Molecular Phylogenetics Winter term 2012/2013 26.02.2012 1.1 Loading a data file and creating a filter 1. HyPhy batch laguage (HBL) 3 DataSet myData = ReadDataFile("data/four.seq"); DataSetFilter myFilter = CreateFilter(myData,1); Loads a data file and stores it in the variable myData which has the type DataSet. Creates a filter on the loaded data. The parameter „1“ defines the raster length. (For codons, you could specify „3“.) (A list of the positions of each raster element could be passed as additional parameters.) CreateFilter(myData, 3, 1, 2); Example

4 Ben Stöver Model and hypothesis testing with HyPhy Fortgeschrittenenmodul Molecular Phylogenetics Winter term 2012/2013 26.02.2012 1.2 Specifying a substitution model 4 1. HyPhy batch laguage (HBL) F81RateMatrix = {{*,mu,mu,mu} {mu,*,mu,mu} {mu,mu,*,mu} {mu,mu,mu,* }}; HarvestFrequencies (obsFreqs, myFilter, 1, 1, 1); Model F81 = (F81RateMatrix, obsFreqs); In the variable F81RateMatrix a rate matrix is stored. The * indicates that this value is calculated from the other values in that row. Since there is only one parameter name specifies in the matrix, a single substitution rate will be modeled. The procedure HarvestFrequencies calculates the base frequencies (π A, π T, π G and π C ) from the loaded alignment. In the last line the whole model is stored in the variable F81.

5 Ben Stöver Model and hypothesis testing with HyPhy Fortgeschrittenenmodul Molecular Phylogenetics Winter term 2012/2013 26.02.2012 1.3 Defining a tree and optimzing a likelihood function 5 Tree myTree = ((a,b),c,d); A tree can e.g. be defined as a newick string. Like in the GUI the variable myTree will also store the branch lengths. LikelihoodFunction theLikFun = (myFilter, myTree); Optimize (MLEs, theLikFun); fprintf(stdout,theLikFun); The variable theLikFun represents the likelihood function as you create it in the GUI by selecting „Likelihood“ -> „Build“. The procedure Optimize optimizes this function and save the parameter values in the variable MLEs. fprintf prints out the result of the optimization (lnL of the tree, branch lengths) on the HyPhy command line. Instead of stdout a file name could also be specified. 1. HyPhy batch laguage (HBL)

6 Ben Stöver Model and hypothesis testing with HyPhy Fortgeschrittenenmodul Molecular Phylogenetics Winter term 2012/2013 26.02.2012 1.4 Further information 6 Additional information on the HBL can be found on the homepage of the software: http://www.hyphy.org/w/index.php/HyPhy_Batch_Language http://www.hyphy.org/w/index.php/Category:HBL_Command (There was only a very brief overview on the HBL given here.) 1. HyPhy batch laguage (HBL)


Download ppt "Ben Stöver WS 2012/2013 Model and hypothesis testing with HyPhy Molecular Phylogenetics – exercise."

Similar presentations


Ads by Google