Welcome, Guest. Please Login
YaBB - Yet another Bulletin Board
 
  HomeHelpSearchLogin  
 
ML distances (Read 2239 times)
Sarah
YaBB Newbies
*
Offline



Posts: 47
ML distances
Sep 14th, 2007 at 12:55pm
 
Is there an easy way in HyPhy to print a table of the strain-to-strain (including ancestors) ML distances calculated by a given model?

I know there's an option to calculate distances under standard analyses. In this case, I submitted a tree and a partition, specified the model (MG94xHKY85), and optimized the likelihood. I'm wondering it's possible to view a table of distances in HyPhy at this point.
Back to top
 
 
IP Logged
 
Sergei
YaBB Administrator
*****
Offline


Datamonkeys are forever...

Posts: 1658
UCSD
Gender: male
Re: ML distances
Reply #1 - Sep 16th, 2007 at 6:11am
 
Dear Sarah,

There is not a built-in .BF to do this (you can compute all pairwise tip-tip distances from the tree viewer, but that will not include ancestral sequences). You can right a very simple post-processor module (to drop into UserAddIns and be accessible via the console gears button), which would use the command:

Code:
BranchLength(tree,"node1;node2");
 



to compute the cumulative branch length between any nodes in the tree.
Here's a little working code example

Code:
function getAllPairwiseBranchLengths (treeID)
{
	ExecuteCommands ("allBranches = BranchName("+treeID+",-1);");
	_branchCount = Columns(allBranches)-1;
	outString = "";
	outString * 128;
	outString * "Node1,Node2,Distance";
	for (_b1 = 0; _b1 < _branchCount; _b1 = _b1+1)
	{
		bn1 = allBranches[_b1];
		for (_b2 = _b1+1; _b2 < _branchCount; _b2 = _b2+1)
		{
			bn2 = allBranches[_b2];
			ExecuteCommands ("bl=BranchLength("+treeID+",\""+bn1+";"+bn2+"\");");
			outString * ("\n"+bn1+","+bn2+","+bl);
		}
	}
	outString * 0;
	return outString;
}


Tree t = ((a:0.1,b:0.2)anc1:0.2,c:0.05,d:0.125);
fprintf (stdout, getAllPairwiseBranchLengths ("t"));
 



Cheers,
Sergei
Back to top
 

Associate Professor
Division of Infectious Diseases
Division of Biomedical Informatics
School of Medicine
University of California San Diego
WWW WWW  
IP Logged
 
Sarah
YaBB Newbies
*
Offline



Posts: 47
Re: ML distances
Reply #2 - Sep 17th, 2007 at 8:05am
 
Thanks! Will try.
Back to top
 
 
IP Logged