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