nclark-lab / RERconverge

Analysis of convergence between organismal traits and DNA/protein sequences
GNU General Public License v3.0
46 stars 26 forks source link

Pseudorooting of Genetrees #62

Open kjf319 opened 3 years ago

kjf319 commented 3 years ago

We are working with a dataset of laurasiatheria species that does not include a human reference. When using this culled tree as the master tree in the ReadTrees function, it created an object with a clade as the pseudoroot, not a species. The resulting error was: ''Error in matchNodesInject(tree1, tree2) : Incorrect pseudorooting detected - use fixPseudoroot() function to correct trait tree topology''

fixPseudoroot() didn't solve the problem, as the function is written to fix mismatched rooted species between the master tree and trait tree.

To solve this problem, we used: wtiplabel <- which(TREEobject$masterTree$tip.label=="tiplabel.manuallyselectedrootspecies") #find the number of gene trees for manually selected species so R can reroot the tree newMaster <- unroot(reroot(TREEobject$masterTree,wtiplabel)) #reroot the tree using the horse as root

The phenotype tree before rooting and after is attached.

RerootedLauraMaster.txt Culled_LauraTree_Phen.txt