Skip to content

Commit

Permalink
[FIX] - force dataframe format for pca_plotly input
Browse files Browse the repository at this point in the history
  • Loading branch information
leopoldguyot committed Jul 18, 2024
1 parent 3095aea commit 448b148
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions R/server_module_qc_metrics.R
Original file line number Diff line number Diff line change
Expand Up @@ -126,18 +126,18 @@ server_module_pca_box <- function(id, single_assay, method, transpose) {
dataframe <- reactive({
req(pca_result())
req(color_data())
merge(
as.data.frame(merge(
data.frame(scores(pca_result())),
color_data(),
by = "row.names"
)
))
})

output$pca <- renderPlotly({
req(dataframe())
req(pca_result())
# TODO: Add a table with the selected points.
error_handler( # ERROR make infinite loops
error_handler(
pca_plotly,
component_name = "PCA quality control plot",
df = dataframe(),
Expand Down
2 changes: 1 addition & 1 deletion R/utils_global.R
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ page_assays_subset <- function(qfeatures, pattern) {
#' @importFrom viridisLite viridis
#'
pca_plotly <- function(df, pca_result, color_name, show_legend) {
stopifnot(is.data.frame(df))
plotly <- plot_ly(df,
x = ~PC1,
y = ~PC2,
Expand Down Expand Up @@ -323,7 +324,6 @@ pca_plotly <- function(df, pca_result, color_name, show_legend) {
#' @importFrom QFeatures addAssayLink

add_assays_to_global_rv <- function(processed_qfeatures, step_number, type) {
print(names(processed_qfeatures))
for (name in names(processed_qfeatures)) {
new_name <- paste0(
strsplit(name, "_(QFeaturesGUI#", fixed = TRUE)[[1]][[1]],
Expand Down

0 comments on commit 448b148

Please sign in to comment.