The repository TreeToCongruency provides a R script called TreeToCongruency.R to compare two Newick trees through a tanglegram and estimations of congruency metrics (Cophenetic correlations, Robinson-Foulds index, tree distances and Fowlkes-Mallows index).
The R script TreeToCongruency.R was prepared and tested with R version 3.6.3.
- library(dplyr)
- library(ape)
- library(dendextend)
- library(viridis)
- library(phylogram)
- library(igraph)
- library(phytools)
- library(phangorn)
sudo apt-get update
sudo apt-get upgrade
sudo apt-cache showpkg r-base
sudo apt-get install r-base
R --version
git clone https://github.com/Nicolas-Radomski/TreeToCongruency.git
cd TreeToCongruency
The 4.3.2 users need to install the libglpk-dev Ubuntu library to be able to install properly the igraph R library.
sudo apt-get update
sudo apt-get -y install libglpk-dev
Then, install the needed R libraries.
R
install.packages("dplyr")
install.packages("ape")
install.packages("dendextend")
install.packages("viridis")
install.packages("phylogram")
install.packages("igraph")
install.packages("phytools")
install.packages("phangorn")
quit()
Rscript TreeToCongruency.R tree1.nwk tree2.nwk
Rscript TreeToCongruency.R TREE1.nwk TREE2.nwk
docker pull nicolasradomski/treetocongruency
docker run --name nicolas --rm -v /home/data:/data -v /home/output:/output nicolasradomski/treetocongruency:latest sh -c 'Rscript code/TreeToCongruency.R data/tree1.nwk data/tree2.nwk' > output/std.log 2>&1
sudo docker run --name nicolas --rm -v /home/data:/data -v /home/output:/output nicolasradomski/treetocongruency:latest sh -c 'Rscript code/TreeToCongruency.R data/TREE1.nwk data/TREE2.nwk' > output/std.log 2>&1
- Tanglegram.pdf
- Tanglegram.tiff
- Cophenetic correlation with Pearson method
- Cophenetic correlation with Kendall method
- Cophenetic correlation with Spearman method
- Robinson-Foulds distance
- Branch score difference
- Path difference
- Quadratic path difference
- Fowlkes-Mallows index
- First version: Henri C., P. Leekitcharoenphon, H.A. Carleton, N. Radomski, R. S. Kaas, J. F. Mariet, A. Felten, F. M. Aarestrup, P. G. Smidt, S. Roussel, L. Guillier, M.Y. Mistou and R.S. Hendriksen. An assessment of different genomic approaches for inferring phylogeny of Listeria monocytogenes. 2017, Frontiers Microbiology, 8(2351): 1-13, doi.org/10.3389/fmicb.2017.02351
- Second version: Vila Nova M, Durimel K., La K., Felten A., Bessières P., Mistou M.Y., Mariadassou M. and N. Radomski. Genetic and metabolic signatures of Salmonella enterica subsp. enterica associated with animal sources at the pangenomic scale. 2019, BMC Genomics, 20(1): 814, doi: 10.1186/s12864-019-6188-x
- Docker Hub: https://hub.docker.com/r/nicolasradomski/treetocongruency
My colleague Antonio Rinaldi for our fruitful exchanges about Rscript
Antonio Rinaldi and Nicolas Radomski