nclark-lab / RERconverge

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

readTrees() and subsequent getAllResiduals errors #58

Open 1221li opened 3 years ago

1221li commented 3 years ago

Hi RERconverge team,

I'm running into a couple of errors/issues when I try to run RERconverge with my data. Issues1:when I ues the function of readTrees , It will prompt me with the following information: Read 13910.5 items max is 34 Rotating trees Not enough genes with all species present: master tree has no edge.lengths Naming columns of paths matrix I don't know how to deal with this problem:Not enough genes with all species present: master tree has no edge.lengths So I hope you can give me some advice Issues2: when I ues the function of getAllResiduals , The system will prompt the following error:

mamRERw = getAllResiduals(toyTrees,useSpecies=names(Run.RData),transform = "sqrt", weighted = T, scale = T) cutoff is set to 0.00417806792 Error in plot.window(xlim = xlim, ylim = ylim, log = log, yaxs = pars$yaxs) : need finite 'ylim' values In addition: Warning messages: 1: In min(x) : no non-missing arguments to min; returning Inf 2: In max(x) : no non-missing arguments to max; returning -Inf I don't know what caused it , could you give me some suggestions. Looking forward to your positive response. My tree file is attached here. I'd appreciate any insight! Thanks.

(tree111.txt)

jimcohen1000 commented 3 years ago

Hello, I am running into the same problem (issue 1) as 1221li. I am loading my trees into R using the readTrees function, and the program recognizes the correct number of trees and number of taxa; however, I get the message stating that there are not enough genes with all species present. I received this message before when I was using a different dataset that had only 9 trees (out of 300) with all taxa, but with this current set, each tree of the 149 trees includes all 52 taxa (file attached). I would certainly appreciate any advice that you could offer in order to get the program to appropriately read the tree file. Thank you very much. 52_sp_trees_rerconverge3.txt

cybokat commented 3 years ago

Same problem as 122IlI and jimcohen1000. I fixed the problem by manually pasting a master Tree object from a larger analysis into the TreeObj from read.trees via dput and dget, but the next issue is the

Error in plot.window(xlim = xlim, ylim = ylim, log = log, yaxs = pars$yaxs) : need finite 'ylim' values In addition: Warning messages: 1: In min(x) : no non-missing arguments to min; returning Inf 2: In max(x) : no non-missing arguments to max; returning -Inf etc.

This is a plot error so if you set plot = F in getAllResiduals you will be able to see the error related to why the analysis can't run.

nclark-lab commented 3 years ago

Hello, I took a look at your '52_sp_trees_rerconverge3.txt' file. It looks like the trees have different species topologies. For RERconverge to calculate relative rates, all trees need to have the same connectivity (topology) otherwise our methods aren't able to normalize branch lengths. There are a few suggested ways to generate trees with one topology. We have been using phangorn, which allows the user to supply the species tree topology as input. Phangorn then quickly estimates the branch lengths for each gene. We provide a wrapper function to do this called 'estimatePhangornTreeAll'.
It is found here: https://github.com/nclark-lab/RERconverge/blob/master/R/estimateTreeFuncs.R

I hope this resolves the issues.