-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
162 additions
and
100 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
Package: PhyloProfile | ||
Version: 1.21.0 | ||
Date: 2024-10-28 | ||
Version: 1.21.1 | ||
Date: 2024-11-01 | ||
Title: PhyloProfile | ||
Authors@R: c( | ||
person("Vinh", "Tran", role = c("aut", "cre"), email = "[email protected]", comment=c(ORCID="0000-0001-6772-7595")), | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -256,14 +256,16 @@ createUmapPlotData <- function( | |
#' Create UMAP cluster plot | ||
#' @export | ||
#' @usage plotUmap(plotDf = NULL, legendPos = "bottom", colorPalette = "Set2", | ||
#' transparent = 0, textSize = 12, font = "Arial", highlightTaxa = NULL) | ||
#' transparent = 0, textSize = 12, font = "Arial", highlightTaxa = NULL, | ||
#' dotZoom = 0) | ||
#' @param plotDf data for UMAP plot | ||
#' @param legendPos position of legend. Default: "right" | ||
#' @param colorPalette color palette. Default: "Set2" | ||
#' @param transparent transparent level (from 0 to 1). Default: 0 | ||
#' @param textSize size of axis and legend text. Default: 12 | ||
#' @param font font of text. Default = Arial" | ||
#' @param highlightTaxa list of taxa to be highlighted | ||
#' @param dotZoom dot size zooming factor. Default: 0 | ||
#' @return A plot as ggplot object | ||
#' @author Vinh Tran [email protected] | ||
#' @seealso \code{\link{prepareUmapData}}, \code{\link{umapClustering}}, | ||
|
@@ -280,7 +282,8 @@ createUmapPlotData <- function( | |
|
||
plotUmap <- function( | ||
plotDf = NULL, legendPos = "bottom", colorPalette = "Set2", | ||
transparent = 0, textSize = 12, font = "Arial", highlightTaxa = NULL | ||
transparent = 0, textSize = 12, font = "Arial", highlightTaxa = NULL, | ||
dotZoom = 0 | ||
) { | ||
if (is.null(plotDf)) stop("Input data cannot be NULL!") | ||
X <- Y <- Label <- Freq <- NULL | ||
|
@@ -302,13 +305,14 @@ plotUmap <- function( | |
) | ||
} | ||
# adapt plot height based on number of labels | ||
|
||
# generate plot | ||
plot <- ggplot(plotDf, aes(x = X, y = Y, color = Label)) + | ||
geom_point(aes(size = Freq), alpha = 1 - transparent) + | ||
geom_rug(alpha = 1) + | ||
theme_minimal() + | ||
labs(x = "", y = "") | ||
labs(x = "", y = "")+ | ||
scale_radius(range = c(1 + dotZoom, 6 + dotZoom)) | ||
# change legend title | ||
if ("ncbiID" %in% colnames(plotDf)) { | ||
plot <- plot + guides( | ||
|
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.