I am seeking a way to find the immediate descendants of the root node in a phylogenetic tree such as with the function
from auteur or geiger libraries in R. However, this function doesn't seem to exist anymore, and I have struggled and failed to find ways to use the function from earlier versions.
For the immediate descendants, I eventually need to get the names of all the terminals in the two or more descendant clades. However, I can work up to that from something else, such as the node numbers, a list of all descendant node numbers on either side of the root, or something else.
I can think of plenty of rather forced ways to get what I want, such as finding the smallest node number in R, and then the next smallest two. This would work for bifurcating trees most of the time, though I am a little nervous about node numbers in R and worry that the smallest would not always be the root. Moreover, it would not work for trees that are not bifurcating at the root, unless I already knew how many nodes to expect.
I could also get a list of terminals in all clades using biopython and try to use the terminals within the largest clade to find its sister, where those terminals (and only those) should be missing. However that would not work if the tree is not bifurcating from the root.
I would like a way that's not so forced and more easily applicable to a wide breath of tree types.
Any help is appreciated, and thanks in advance.