This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| tinytex::tlmgr_install(c("amsfonts", "amsmath", "lm", "unicode-math", "iftex", "listings", "fancyvrb", "longtable", "booktabs", "graphicx", "hyperref", "xcolor", "soul", "geometry", "setspace", "babel", "fontspec", "upquote", "microtype", "csquotes", "natbib", "biblatex", "bibtex", "parskip", "xurl", "bookmark", "footnotehyper", "footnote")) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Libraries | |
| library(readr) | |
| library(devtools) | |
| library(SpiecEasi) | |
| library(phyloseq) | |
| library(tibble) | |
| library(igraph) | |
| library(dplyr) | |
| library(stringr) | |
| library(tidyr) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Libraries | |
| library(readr) | |
| library(SpiecEasi) | |
| library(phyloseq) | |
| library(tibble) | |
| library(igraph) | |
| library(dplyr) | |
| library(stringr) | |
| library(tidyr) | |
| library(ggplot2) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Vectorised version of the private function getAncestor in ggtree | |
| require(ggtree) | |
| get_ancestors <- function(tree, nodes) { | |
| return( | |
| unique( | |
| unlist(lapply(nodes, function(node) ggtree:::getAncestor(tree, node))) | |
| ) | |
| ) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Vectorised version of ggtree::expand | |
| require(ggtree) | |
| expand_vectorised <- function(tree_view = NULL, nodes) { | |
| if (length(nodes) == 1) { | |
| return(ggtree::expand(tree_view, nodes)) | |
| } else { | |
| return(ggtree::expand( | |
| expand_vectorised(tree_view, nodes[-1]), | |
| nodes[1] | |
| )) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Vectorised version of ggtree::collapse | |
| require(ggtree) | |
| collapse_vectorised <- function(tree_view = NULL, nodes) { | |
| if (length(nodes) == 1) { | |
| return(ggtree::collapse(tree_view, nodes)) | |
| } else { | |
| return(ggtree::collapse( | |
| collapse_vectorised(tree_view, nodes[-1]), | |
| nodes[1] | |
| )) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| multiplot_file <- function(plots = NULL, file, cols = 1, layout = NULL, width = 100, height = 100) { | |
| require(grid) | |
| mm <- function(mm) {return(0.0393701 * mm)} | |
| numPlots = length(plots) | |
| if (is.null(layout)) { | |
| layout <- matrix( | |
| seq(1, cols * ceiling(numPlots/cols)), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Libraries | |
| library(readr) | |
| library(SpiecEasi) | |
| library(phyloseq) | |
| library(tibble) | |
| library(igraph) | |
| library(dplyr) | |
| library(stringr) | |
| library(tidyr) | |
| library(ggplot2) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Libraries | |
| library(readr) | |
| library(SpiecEasi) | |
| library(phyloseq) | |
| library(tibble) | |
| library(igraph) | |
| library(dplyr) | |
| library(stringr) | |
| library(tidyr) | |
| library(ggplot2) |
NewerOlder