Skip to content

Commit

Permalink
Merge pull request #32 from microbiome/bioreview
Browse files Browse the repository at this point in the history
Generate panels when elements are available + warnings
  • Loading branch information
RiboRings authored Jul 16, 2024
2 parents 7eab2ab + 590957b commit 2332829
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 200 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Description:
TreeSummarizedExperiment objects. Not surprisingly, it also depends on the
generic panels from iSEE.
biocViews: Microbiome, Software, Visualization, DataImport
License: Artistic-2.0 + file LICENSE
License: Artistic-2.0
Encoding: UTF-8
Depends:
R (>= 4.4.0),
Expand Down
197 changes: 0 additions & 197 deletions LICENSE

This file was deleted.

11 changes: 9 additions & 2 deletions R/iSEE-default.R
Original file line number Diff line number Diff line change
Expand Up @@ -52,30 +52,37 @@ setGeneric("iSEE", iSEE::iSEE)
#' ComplexHeatmapPlot RowDataTable ColumnDataTable
#' @importFrom TreeSummarizedExperiment TreeSummarizedExperiment rowLinks
#' @importFrom SingleCellExperiment reducedDims
#' @importFrom SummarizedExperiment rowData colData
#' @importFrom mia taxonomyRanks
setMethod("iSEE", "TreeSummarizedExperiment",
function(se, initial = c(RowDataTable(), ColumnDataTable(), RowTreePlot(),
AbundancePlot(), AbundanceDensityPlot(), ReducedDimensionPlot(),
ComplexHeatmapPlot()), extra = NULL, colormap = ExperimentColorMap(),
landingPage = createLandingPage(), tour = NULL, appTitle = NULL,
runLocal = TRUE, voice = FALSE, bugs = FALSE, saveState = NULL, ...) {

initial <- .check_panel(se, initial, "RowDataTable", rowData)
initial <- .check_panel(se, initial, "ColumnDataTable", colData)
initial <- .check_panel(se, initial, "RowTreePlot", rowLinks)
initial <- .check_panel(se, initial, "AbundancePlot", taxonomyRanks)
initial <- .check_panel(se, initial, "ReducedDimensionPlot", reducedDims)

iSEE::iSEE(se, initial = initial, extra = extra, colormap = colormap,
iSEE::iSEE(se, initial = initial, extra = initial, colormap = colormap,
landingPage = landingPage, tour = tour, appTitle = appTitle,
runLocal = runLocal, voice = voice, bugs = bugs,
saveState = saveState, ...)
})

#' @importFrom S4Vectors isEmpty
#' @importFrom methods is
.check_panel <- function(se, panel_list, panel_class, panel_fun) {
.check_panel <- function(se, panel_list, panel_class, panel_fun, wtext) {

no_keep <- unlist(lapply(panel_list, function(x) is(x, panel_class)))

if( any(no_keep) && (is.null(panel_fun(se)) || isEmpty(panel_fun(se))) ){
panel_list <- panel_list[!no_keep]
warning("no valid ", as.character(substitute(panel_fun)),
" fields for ", panel_class, call. = FALSE)
}

return(panel_list)
Expand Down

0 comments on commit 2332829

Please sign in to comment.