kfuku52 / RADTE

Divergence time estimation in the complex history of gene family evolution
MIT License
8 stars 2 forks source link

2 distinct errors #4

Closed fka21 closed 3 years ago

fka21 commented 3 years ago

Hello,

Some gene trees seem to give two distinct error messages and I could not figure out why. I used default setting and the same species tree in both cases. Here it is the first one:

Setting initial dates...
Fitting in progress... get a first set of estimates
Error in if (sum(freq) > 1) return(-1e+100) :
  missing value where TRUE/FALSE needed
All attempts for divergence time estimation were failed. Exiting.

And the other one:

NULL
Error in `[<-.data.frame`(`*tmp*`, ind, "lower_sp_node", value = c("s23",  :
  replacement has 2 rows, data has 1
Calls: [<- -> [<-.data.frame
Execution halted

I have attached 2 gene trees which produce the two distinct errors, with the species tree. errorneous_gene_trees.zip

Thank you for your help in advance!

Cheers

kfuku52 commented 3 years ago

I keep getting different errors, so not sure which is which. I suspect some differences in packages or R itself. Anyway, it would be great if you could post multiple issues separately next time. But there seems to be two nodes identically named as n880 in OG0000001_binary.txt.reconciled. Could you correct it and retry?

fka21 commented 3 years ago

Sorry for the confusion, next time I will do so. After correcting the naming of the nodes I still get the error:

NULL
Error in `[<-.data.frame`(`*tmp*`, ind, "lower_sp_node", value = c("s23",  :
  replacement has 2 rows, data has 1
Calls: [<- -> [<-.data.frame
Execution halted
kfuku52 commented 3 years ago

Could you share the corrected data?

fka21 commented 3 years ago

node_corrected.zip

kfuku52 commented 3 years ago

I got a successful run with R 3.6.3 and ape 5.4_1. I aslo tried 4.0.2 and the result was the same. I updated radte.r, which now returns an error for nodes with the identical name, but this change does nothing to do with the other behaviors. So you may end up getting the same error but could you retry with the new radte.r? issue_4_2.zip

fka21 commented 3 years ago

Retired it with the update, but unfortunately it did not change anything. I use R 4.0.3 and ape 5.4-1 so it should not cause too much of a problem. It seems that OrthoFinder generated gene trees are all over the place, I might need to do some adjustments upstream then.

kfuku52 commented 3 years ago

Could you provide the full record of stderr and stdout so I can guess where the error comes from? Also, it would be great if you could share a couple of more trees/parsable files that cause the same error.

fka21 commented 3 years ago

Here it is, included are some gene trees which produce the errors and the log files. Hope it will help figuring out what might be the underlying cause of it. erroneous_gene_trees.zip

kfuku52 commented 3 years ago

The input gene trees seem to have either polytomy or zero branch length. With the latest radte.r, the former will receive an error message but the latter should run successfully. I confirmed the expected behavior for all trees you provided. Please let me know if it works in your environment.

fka21 commented 3 years ago

Thank you for the update, I checked the latest update and it indeed does report zero branch lengths. As for polytomies I need to resolve them beforehand, apparently my approach did not fully work. Thank you very much for the help!