HyPhy message board
http://www.hyphy.org/cgi-bin/hyphy_forums/YaBB.pl
Methodology Questions >> How to >> inferring topologies
http://www.hyphy.org/cgi-bin/hyphy_forums/YaBB.pl?num=1129909573

Message started by konrad on Oct 21st, 2005 at 8:46am

Title: inferring topologies
Post by konrad on Oct 21st, 2005 at 8:46am
Hi Sergei,

The GUI allows me to infer tree topologies under a variety of nucleotide models, using neighbour-joining or maximum likelihood with different search techniques. How do I do these using batch files? (It looks like TopologySearch.bf does exhaustive search only; SingleBreakPointRecomb.bf seems to do neighbour-joining - is that right, and which parts of this file do I need for this? Simply copying the functions TreeMatrix2TreeString, ComputeDistanceFormula and InferTreeTopology into my file is not enough.)

Also, is it possible to infer ML trees using codon models, or is this just a bad idea due to excessive computational requirements?

thanks,
Konrad

Title: Re: inferring topologies
Post by Sergei on Oct 21st, 2005 at 3:50pm
Dear Conrad,

First, a disclaimer. HyPhy was not intended to be a fast topology inference package (the exception is NJ, which is fairly quick). You can do some topology inference with codon models; I would recommend getting a starting NJ tree and then branch swapping (using TopologyInference:BranchSwap.bf), preferrably on a cluster.

To answer your question about including NJ code into your analysis: look at the NeighborJoining.bf in TemplateBatchFiles and, specifically at the InferTreeTopology function for the general case (which prompts for models and such). This function depends on the data being in the [bf]ds[/bf] dataset object and functions in distanceMethodNPBootstrap.bf.

The minimalist function for using NJ (based on SingleBreakPointRecomb.bf) will need to include the following functions:

InitializeDistances
ComputeDistanceFormula
TreeMatrix2TreeString
InferTreeTopology

The sequence of calls to build a tree would be

[code]
DataSetFilter filteredData = CreateFilter ... /* make your filter */
InferTreeTopology (0); /* do NJ and return internal tree representation */
treeString=TreeMatrix2TreeString(0); /* convert to string */
Tree givenTree = treeString; /* build a tree object */
[/code]

HTH,
Sergei

Title: Re: inferring topologies
Post by konrad on Oct 24th, 2005 at 7:26am
Thanks! This works now.

HyPhy message board » Powered by YaBB 2.5.2!
YaBB Forum Software © 2000-2022. All Rights Reserved.