Skip to content

Commit

Permalink
Row data order sample by example
Browse files Browse the repository at this point in the history
  • Loading branch information
seraidarian committed Jun 13, 2024
1 parent a208a07 commit e1e8b68
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions R/class-AbundancePlot.R
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ setMethod(".defineDataInterface", "AbundancePlot", function(x, se, select_info)
list(.checkboxInput.iSEE(x, field="use_relative", label="Use relative values",
value=slot(x, "use_relative")),
.radioButtons.iSEE(x, field="order_sample", label="Ordering sample:",
inline=TRUE, choices=c("None", "Column data"),
inline=TRUE, choices=c("None", "Column data", "Row data"),
selected=slot(x, "order_sample")),
.conditionalOnRadio(
paste0(panel_name, "_order_sample"), "Column data",
Expand All @@ -94,7 +94,12 @@ setMethod(".defineDataInterface", "AbundancePlot", function(x, se, select_info)
label="Order sample by", choices=names(colData(se)),
selected=slot(x, "order_sample_by")),
iSEE:::.checkboxInputHidden(x, field="decreasing",
label="Order decreasingly", value=slot(x, "decreasing")))))
label="Order decreasingly", value=slot(x, "decreasing")))),
.conditionalOnRadio(
paste0(panel_name, "_order_sample"), "Row data",
iSEE:::.selectInputHidden(x, field="order_sample_by",
label="Order sample by", choices=unique(rowData(se)$Phylum),
selected=slot(x, "order_sample_by"))))
})

#' @importFrom methods callNextMethod
Expand Down Expand Up @@ -158,8 +163,12 @@ setMethod(".generateOutput", "AbundancePlot",
args[["use_relative"]] <- deparse(slot(x, "use_relative"))

if (slot(x, "order_sample") == "Column data") {
args[["order_sample_by"]] <- deparse(slot(x, "order_sample_by"))
args[["decreasing"]] <- deparse(slot(x, "decreasing"))
args[["order_sample_by"]] <- deparse(slot(x, "order_sample_by"))
args[["decreasing"]] <- deparse(slot(x, "decreasing"))
}

if (slot(x, "order_sample") == "Row data") {
args[["order_sample_by"]] <- deparse(slot(x, "order_sample_by"))
}

args <- sprintf("%s=%s", names(args), args)
Expand Down

0 comments on commit e1e8b68

Please sign in to comment.