70 likes | 239 Views
Model and hypothesis testing with HyPhy Molecular Phylogenetics – exercise. 1 The HyPhy batch language (HBL). 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 .
E N D
Model andhypothesistestingwithHyPhyMolecularPhylogenetics – exercise
Titel der Präsentation 1 The HyPhybatchlanguage (HBL) • Existedbeforethe GUI ofHyPhy. • All analysiscan also beperformedusing a batchfile. • More analysesproceduresthan in the GUI areavailable. • A oncedefinedanalysiscanberepeatedwithanydatasetwithouthavingtoclickeverythingagain in the GUI. • Somestepsoftheanalysesmighttakeverylong, so youwould not wanttosit in front ofthe GUI andwaituntilyoucanclickon thenextbutton. • HyPhyscriptsaresavedastextfiles. • Theycanbeexecutedbyselecting „File“ -> „Open“ -> „Open Batch File“ fromtheHyPhymainmenu.
1. HyPhybatchlaguage (HBL) 1.1 Loading a datafileandcreating a filter DataSetmyData = ReadDataFile("data/four.seq"); DataSetFiltermyFilter = CreateFilter(myData,1); • Loads a datafileandstoresit in the variable myDatawhichhasthe type DataSet. • Creates a filter on theloadeddata. • The parameter „1“ definestherasterlength. (Forcodons, youcouldspecify „3“.) • (A listofthepositionsofeachrasterelementcouldbepassedas additional parameters.) • Example CreateFilter(myData, 3, 1, 2);
1. HyPhybatchlaguage (HBL) 1.2 Specifying a substitutionmodel 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 matrixisstored. • The *indicatesthatthisvalueiscalculatedfromtheothervalues in thatrow. • Sincethereisonlyoneparameternamespecifies in thematrix, a singlesubstitution rate will bemodeled. • The procedureHarvestFrequenciescalculatesthebasefrequencies (πA, πT, πGand πC) fromtheloadedalignment. • In the last linethewholemodelisstored in the variable F81.
1. HyPhybatchlaguage (HBL) 1.3 Defining a treeandoptimzing a likelihoodfunction TreemyTree = ((a,b),c,d); • A treecan e.g. bedefinedas a newick string. • Like in the GUI the variable myTree will also storethebranchlengths. LikelihoodFunctiontheLikFun = (myFilter, myTree); Optimize(MLEs, theLikFun); fprintf(stdout,theLikFun); • The variable theLikFunrepresentsthelikelihoodfunctionasyoucreateit in the GUI byselecting „Likelihood“ -> „Build“. • The procedureOptimizeoptimizesthisfunctionand save theparametervalues in the variable MLEs. • fprintfprints out theresultoftheoptimization(lnLofthetree, branchlengths) on theHyPhycommandline. • Insteadofstdout a filenamecould also bespecified.
1. HyPhybatchlaguage (HBL) 1.4 Further information • Additional information on the HBL canbefound on thehomepageofthesoftware: • http://www.hyphy.org/w/index.php/HyPhy_Batch_Language • http://www.hyphy.org/w/index.php/Category:HBL_Command • (There was only a verybriefoverview on the HBL givenhere.)