Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ipad 508 enable model designation for multimodel plots #21

Open
wants to merge 6 commits into
base: dev
Choose a base branch
from
Open
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
Expand Up @@ -11,7 +11,7 @@ Description:
deployed online to be explored by collaborators. The dashboard includes
'sortable' tables, interactive plots including network visualization, and
fine-grained filtering based on statistical significance.
Version: 1.13.16
Version: 1.13.20
Authors@R: c(
person("Terrence", "Ernst", role = c("aut"),
comment = "Web application"),
Expand Down
18 changes: 18 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
# 1.13.20

* The release tarball includes version 1.9.3 of the web app

* Fix bug in `importStudy()` that resulted in mapping table not being imported.

# 1.13.19

* The release tarball includes version 1.9.2 of the web app

# 1.13.18

* The release tarball includes version 1.9.1 of the web app

# 1.13.17

* The release tarball includes version 1.9.0 of the web app

* Update `getBarcodeData()` to pass lowest statistic value. Change enables barcode plot to accommodate negative numbers.

# 1.13.16
Expand Down
11 changes: 11 additions & 0 deletions R/check.R
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,17 @@ checkPlots <- function(plots) {
if (is.null(plotEntry[["displayName"]])) {
stop(sprintf("Must define displayName for plot \"%s\"", plotID))
}
# For multiModel plots, check if field 'models' is available and, if so,
# check if models != 'all' is associated with plotType multiModel
if (!is.null(plotEntry[["models"]])) {
models <- plotEntry[["models"]]
if ((length(models) > 1 || models != 'all') && !any(plotEntry[["plotType"]] %in% "multiModel")) {
stop(
sprintf("For field models != 'all' plotType field requires 'multiModel'.\n"),
sprintf("The custom plot \"%s\" has models \"%s\" and plotType \"%s\".", plotID, paste(c(models), collapse=', '), paste(c(plotEntry[["plotType"]]), collapse=', '))
)
}
}
}
}

Expand Down
1 change: 1 addition & 0 deletions R/import.R
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ importStudy <- function(study, libraries = NULL) {
plots = getPlots(study, quiet = TRUE, libraries = libraries),
barcodes = getBarcodes(study, quiet = TRUE, libraries = libraries),
reports = reports,
mapping = getMapping(study, quiet = TRUE, libraries = libraries),
resultsLinkouts = getResultsLinkouts(study, quiet = TRUE, libraries = libraries),
enrichmentsLinkouts = getEnrichmentsLinkouts(study, quiet = TRUE, libraries = libraries),
metaFeaturesLinkouts = getMetaFeaturesLinkouts(study, quiet = TRUE, libraries = libraries),
Expand Down
31 changes: 29 additions & 2 deletions R/validate.R
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,35 @@ validatePlots <- function(study) {
modelID <- models[i]
modelPlots <- getPlots(study, modelID, quiet = TRUE)
if (isEmpty(modelPlots)) next
# Validate concordance between plots field models (when models != 'all') and
# model names from mapping object
for (q in seq_along(modelPlots)) {
plotEntry <- names(modelPlots[[q]])
if (any(plotEntry %in% 'models')) {
plotModelNames <- modelPlots[[q]][['models']]

if (plotModelNames == 'all') next

mappingNames <- names(study[["mapping"]])
if (modelID %in% mappingNames) {
mapName <- modelID
} else {
mapName <- 'default'
}
map <- study[["mapping"]][[mapName]]
mapModelNames <- colnames(map)
if (any(!plotModelNames %in% mapModelNames)) {
stop(
sprintf("The custom plot \"%s\" has invalid model(s).\n", names(modelPlots)[q]),
sprintf("At least one element from field models (\"%s\") is not found in the mapping object \"%s\" column names (\"%s\").",
paste(c(plotModelNames), collapse=', '),
mapName,
paste(mapModelNames, collapse=', '))
)
}
}
}

# Custom plots no longer require assays, since they can plot columns from
# the results table. If assays are unavailable, send a message and then
# skip the rest of the validation between assays with
Expand Down Expand Up @@ -308,9 +337,7 @@ validatePlots <- function(study) {
stop("Some of the column names of the assays table are missing from the sampleID column in the samples table\n",
sprintf("modelID: %s", modelID))
}

} # outer loop of modelIDs

return(invisible(TRUE))
}

Expand Down
2 changes: 1 addition & 1 deletion R/zzz.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ OmicNavigatorPrefix <- "ONstudy"

# The R package is meant to be used with a specific version of the app. If a
# user has an older or newer version installed, send a warning.
versionAppPinned <- "1.8.9"
versionAppPinned <- "1.9.3"

# The extra packages required to run the app
appPackages <- c(
Expand Down