Skip to content

Commit

Permalink
Create plotTree.R
Browse files Browse the repository at this point in the history
  • Loading branch information
noriakis committed Sep 1, 2023
1 parent 40b7016 commit c5cb621
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions R/plotTree.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#' plotTree
#'
#' infer the tree and plot
#'
#' @param stana
#' @param species
#'
#' @export
plotTree <- function(stana, species, cl=NULL) {
if (is.null(cl)) {cl <- stana@cl}
tre <- stana@fastaList[[species]]
dm <- dist.ml(tre, "F81")
tre <- NJ(dm)
stana@treeList[[species]] <- tre
tre <- groupOTU(tre, cl)
tp <- ggtree(tre,
layout='circular',branch.length = "none") + # Return cladogram by default
geom_tippoint(size=3, aes(color=.data$group)) +
ggtitle(species)+
scale_color_manual(values=stana@colors)
stana@treePlotList[[species]] <- tp
stana
}

0 comments on commit c5cb621

Please sign in to comment.