/* THIS HyPhy BATCH LANGUAGE FILE IS PROVIDED AS AN EXAMPLE/TOOL FOR THE 2nd EDITION OF 'The Phylogenetic Handbook' Written by Sergei L Kosakovsky Pond (spond@ucsd.edu) Art FY Poon (apoon@ucsd.edu) Simon DW Frost (sdfrost@ucsd.edu) */ RequireVersion ("0.9920060830"); VERBOSITY_LEVEL = -1; /*---------------------------------------------------------------------------------------------------------------------------------------------*/ fprintf (stdout, "\n\nThis example analysis fits the local & global Muse-Gaut 94 model with the \nuser selected nucleotide correction to a small codon dataset", "\nestimates omega for each branch and reports", "\nconfidence intervals and sampling properties for each.", "\nThe analysis also performs a LRT for branch-by-branch rate variation.\n"); ExecuteAFile (HYPHY_LIB_DIRECTORY+"TemplateBatchFiles"+DIRECTORY_SEPARATOR+"Utility"+DIRECTORY_SEPARATOR+"DescriptiveStatistics.bf"); ExecuteAFile (HYPHY_LIB_DIRECTORY+"TemplateBatchFiles"+DIRECTORY_SEPARATOR+"TemplateModels"+DIRECTORY_SEPARATOR+"chooseGeneticCode.def"); ModelMatrixDimension = 64; for (k=0; k<64; k=k+1) { if (_Genetic_Code[k] == 10) { ModelMatrixDimension = ModelMatrixDimension -1; } } ExecuteAFile (HYPHY_LIB_DIRECTORY+"TemplateBatchFiles"+DIRECTORY_SEPARATOR+"2RatesAnalyses"+DIRECTORY_SEPARATOR+"MG94xREV.mdl"); ChoiceList (freqs, "Alignment", 1, SKIP_NONE, "Flu H5N1 HA", "Use the example Influenza H5N1 heamagglutinin alignment (5 sequences)", "Drospophila adh", "Use the example Drosophila ADH alignment (6 sequences).", "Custom", "Load your own coding alignment."); if (freqs < 0) { return 0; } if (freqs == 2) { SetDialogPrompt ("Choose a nucleotide alignment"); DataSet ds = ReadDataFile (PROMPT_FOR_FILE); } else { if (freqs == 1) { DataSet ds = ReadDataFile (PATH_TO_CURRENT_BF + '/datasets/Drosophilia_adh.nex'); } else { DataSet ds = ReadDataFile (PATH_TO_CURRENT_BF + '/datasets/H5N1_HA_5.nex'); } } DataSetFilter filteredData = CreateFilter (ds,3,"","",GeneticCodeExclusions); SKIP_MODEL_PARAMETER_LIST = 1; done = 0; while (!done) { fprintf (stdout,"\nPlease enter a 6 character model designation (e.g:010010 defines HKY85):"); fscanf (stdin,"String", modelDesc); if (Abs(modelDesc)==6) { done = 1; } } modelType = 0; ExecuteAFile (HYPHY_LIB_DIRECTORY+"TemplateBatchFiles"+DIRECTORY_SEPARATOR+"TemplateModels"+DIRECTORY_SEPARATOR+"MG94custom.mdl"); SKIP_MODEL_PARAMETER_LIST = 0; ExecuteAFile (HYPHY_LIB_DIRECTORY+"TemplateBatchFiles"+DIRECTORY_SEPARATOR+"queryTree.bf"); internalNodes = BranchCount(givenTree); leafNodes = TipCount(givenTree); choiceMatrix = {internalNodes+leafNodes,2}; for (bc=0; bc0) { fprintf (stdout, "Estimated branch omega for ", myBrName, " to be ", v1/v2, "\n"); } else { if (v1>0) { fprintf (stdout, "Estimated branch omega for ", myBrName, " to be infinite (alpha=0)\n"); } else if (v1>0) { fprintf (stdout, "Estimated branch omega for ", myBrName, " to be indeterminate (alpha and beta =0)\n"); } } return 0; }