I'm trying to conduct ancestral sequence reconstruction AFTER running other analyses with IQ-TREE2 and other programs, hence I have some node values that I would like to keep track of and join with the ASR output. The --ancestral flag can be used with the -te (fixed tree) flag, which says that node names can be read in from a fixed newick tree:
"Specify a user-defined tree to determine ancestral sequences along this tree. You can assign each node of this tree with a node name, and IQ-TREE will report the ancestral sequences of the corresponding nodes. If nodes do not have names, IQ-TREE will automatically assign node namdes as Node1, Node2, etc."
However, when I run iqtree v2.1.3 like so...
iqtree2 --prefix prefix -T 2 -p best_model.nex -te fixed_tree.tre -o outgroup --ancestral --redo
...My fixed tree node names are replaced. Here is an example of before and after:
(A1a:0.0001291728,(A1a1_1:0.0001293153,A1a1_2:0.0003899609)6980:0.000129465)6979:0.0002590121
(A1a:0.0001324957,(A1a1_1:0.0001326635,A1a1_2:0.0003997956)Node14:0.0001328086)Node13:0.0002658183
Does anyone know how I can keep the node names, so I can successfully identify the same nodes after the analysis?
Looking briefly at the code, these functions seem to be relevant:
double IQTree::inputTree2PLL(string treestring, bool computeLH) {
double res = 0.0;
// read in the tree string from IQTree kernel
pllNewickTree *newick = pllNewickParseString(treestring.c_str());
pllTreeInitTopologyNewick(pllInst, newick, PLL_FALSE);
pllNewickParseDestroy(&newick);
if (computeLH) {
pllEvaluateLikelihood(pllInst, pllPartitions, pllInst->start, PLL_TRUE, PLL_FALSE);
res = pllInst->likelihood;
}
return res;
}
void pllTreeInitTopologyNewick (pllInstance * tr, pllNewickTree * newick, int useDefaultz) {
linkTaxa (tr, newick, tr->nameHash && checkTreeInclusion (tr, newick));
if (p->next->x) return p->next;
return p->next->next;
}
Thanks in advance!