Fixed Newick Tree ... Failing to Import Node Names?

75 views
Skip to first unread message

Paul Maier

unread,
Aug 23, 2021, 9:43:28 AM8/23/21
to IQ-TREE
Hello,

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!
Paul

Minh Bui

unread,
Sep 1, 2021, 8:24:16 PM9/1/21
to IQ-TREE, Paul Maier
Hi Paul,

Thanks for reporting this. And also looking at the code — however I don’t think that part of the code is relevant. It could be because of the outgroup option -o: The tree is rerooted and node names might be lost due to this rerooting process.

Can you try running again without -o?

Minh

--
You received this message because you are subscribed to the Google Groups "IQ-TREE" group.
To unsubscribe from this group and stop receiving emails from it, send an email to iqtree+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/iqtree/bccaab09-8e59-4811-90c6-a1a3d82dbdafn%40googlegroups.com.

Paul Maier

unread,
Jan 20, 2022, 11:48:52 AM1/20/22
to Minh Bui, IQ-TREE
Hi Minh,

Thanks for the reply, and sorry for the long delay.

Unfortunately, the outgroup option is necessary in my analysis. For now I have built a solution in a wrapper script that compares the two trees (before and after ASR), and links node names based on identical leaves in each clade. But still, this seems unnecessary, is it possible to retain node names, despite rerooting with the --outgroup option? In principle (e.g., as in the ape package) rerooting shouldn't prevent this, right?

Best,
Paul

---------------------------------------
Paul Maier, Ph.D.

Evolutionary Bio./Genomics
Email: mai...@gmail.com
www.mountainmanmaier.com
---------------------------------------

Reply all
Reply to author
Forward
0 new messages