Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: miaViz
Title: Microbiome Analysis Plotting and Visualization
Version: 1.21.0
Version: 1.21.1
Authors@R:
c(person(given = "Tuomas", family = "Borman", role = c("aut", "cre"),
email = "tuomas.v.borman@utu.fi",
Expand Down
10 changes: 9 additions & 1 deletion R/plotCCA.R
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,13 @@ setMethod("plotRDA", signature = c(x = "matrix"),
tse, vector_data, reduced_dim, ...){
# Extract covariate names from RDA/CCA object
rda_obj <- .get_rda_attribute(reduced_dim, "obj")

# Check if rda object exists. By default, this is the case, but user can
# also remove it, e.g., to save memory. In that case, we cannot
# match the mapping bwteeen rda object and colData.
if( !(!is.null(rda_obj) && is(rda_obj, "cca")) ){
return(vector_data)
}
rda_terms <- rda_obj[["terms"]]
factors_mat <- .get_rda_attribute(rda_terms, "factors")
# Build name_map from terms in the RDA/CCA model
Expand Down Expand Up @@ -737,7 +744,8 @@ setMethod("plotRDA", signature = c(x = "matrix"),
x = 0, y = 0, xend = .data[[xvar]], yend = .data[[yvar]],
group = .data[["group"]]),
arrow = arrow(length = unit(arrow.size, "cm")),
color = vec.color, linetype = vec.linetype, size = vec.size)
color = vec.color, linetype = vec.linetype,
linewidth = vec.size)
# Add vector labels (text or label)
# Make list of arguments for geom_text/geom_label
label_args <- list(
Expand Down
Loading