Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
07b817e
refactor: batch-5 matrix server functions
timcadman Apr 15, 2026
0e5a8e7
refactor: batch-6 factor and recoding server functions
timcadman Apr 15, 2026
415966d
refactor: batch-7 first-pass modelling server functions
timcadman Apr 15, 2026
07b11e1
refactor: batch-7 second-pass modelling server functions
timcadman Apr 15, 2026
22b9b09
refactor: batch-8 server-side RNG and sampling functions
timcadman Apr 16, 2026
6600043
refactor: batch-9 server-side plotting functions
timcadman Apr 16, 2026
1ee564c
docs: updated authorship
timcadman Apr 16, 2026
ce63304
docs: updated authorship
timcadman Apr 16, 2026
70cf83f
docs: redocumented
timcadman Apr 16, 2026
5906be8
docs: redocumented
timcadman Apr 16, 2026
8aa7033
tidied up PR
timcadman Jul 17, 2026
598e7c6
added stuart as author
timcadman Jul 17, 2026
12d90f6
Merge branch 'v7.0-dev' of github.com:datashield/dsBase into refactor…
timcadman Jul 17, 2026
95b2bbc
Merge branch 'v7.0-dev' of github.com:datashield/dsBase into refactor…
timcadman Jul 17, 2026
7df33f4
restored lost test coverage
timcadman Jul 17, 2026
55bed4e
fixed mistaken copywright addition
timcadman Jul 17, 2026
7cb57fc
add disclosure check for matrix assign function
timcadman Jul 23, 2026
3ce7ef8
revert: add back in list check
timcadman Jul 23, 2026
670a9f8
Merge pull request #500 from datashield/fix/matrix-disclosure
timcadman Jul 27, 2026
94a223d
Merge pull request #497 from datashield/refactor/perf-batch-5
timcadman Jul 27, 2026
7b55676
Integrate new approach to R package deployment, but Tim Cadman
StuartWheater Aug 31, 2026
3ec9398
Integrate new approach to R package deployment, by Tim Cadman
StuartWheater Aug 31, 2026
04e965e
Integrate new approach to R package deployment, by Tim Cadman
StuartWheater Aug 31, 2026
662e933
Remove old package installation
StuartWheater Aug 31, 2026
a53d7b4
Merge pull request #503 from StuartWheater/v6.3.6-dev
StuartWheater Sep 1, 2026
dd3a383
Merge branch 'v7.0-dev' of github.com:datashield/dsBase into refactor…
timcadman Sep 3, 2026
2c8dc02
Upgrade to Roxygen 8.1.0
StuartWheater Sep 3, 2026
ab8320b
Merge branch 'datashield:v7.0-dev' into v7.0-dev
StuartWheater Sep 3, 2026
d8f56e3
Updates to DESCRIPTION and NAMESPACE
StuartWheater Sep 3, 2026
02274f9
Merge pull request #504 from datashield/v6.3.6-dev
StuartWheater Sep 3, 2026
46f3bea
Merge pull request #498 from datashield/refactor/perf-batch-6
timcadman Sep 3, 2026
e836f5a
Merge pull request #505 from StuartWheater/v7.0-dev
StuartWheater Sep 3, 2026
1eb433d
Merge branch 'v7.0-dev' of github.com:datashield/dsBase into refactor…
timcadman Sep 8, 2026
21e9252
added missing unit test coverage
timcadman Sep 8, 2026
5bf1b1a
fix: redact glmSummaryDS.as fields by name, not index
timcadman Sep 8, 2026
18bf201
fix: use resolved offset/weights in lmerSLMADS.assign fit
timcadman Sep 8, 2026
64239af
use .loadServersideObject
timcadman Sep 8, 2026
1fff700
fixed environment issue
timcadman Sep 8, 2026
f1cd778
Delete Rplots.pdf that entered by mistake
timcadman Sep 11, 2026
bbe0dca
Merge pull request #507 from datashield/refactor/perf-batch-7
timcadman Sep 11, 2026
9b67668
Merge branch 'v7.0-dev' of github.com:datashield/dsBase into refactor…
timcadman Sep 14, 2026
7ffc44d
fixed tests and docs
timcadman Sep 14, 2026
5004184
Merge branch 'v7.0-dev' of github.com:datashield/dsBase into refactor…
timcadman Sep 14, 2026
a94e23d
added back missing class checks
timcadman Sep 14, 2026
24f9939
removed mistakenly added copywright
timcadman Sep 15, 2026
7d281d0
Merge pull request #510 from datashield/refactor/perf-batch-8
timcadman Sep 15, 2026
2ecd3b0
Merge branch 'v7.0-dev' of github.com:datashield/dsBase into refactor…
timcadman Sep 15, 2026
9f54867
Merge pull request #511 from datashield/refactor/perf-batch-9
timcadman Sep 17, 2026
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 @@ -79,7 +79,7 @@ Imports:
Suggests:
spelling,
testthat (>= 3.0.0)
RoxygenNote: 8.0.0
Encoding: UTF-8
Language: en-GB
Config/testthat/edition: 3
Config/roxygen2/version: 8.1.0
36 changes: 23 additions & 13 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -146,17 +146,27 @@ import(dplyr)
import(gamlss)
import(gamlss.dist)
import(mice)
importFrom(dplyr,"%>%")
importFrom(dplyr,across)
importFrom(dplyr,mutate)
importFrom(dplyr,select)
importFrom(gamlss.dist,pST3)
importFrom(gamlss.dist,qST3)
importFrom(glue,glue)
importFrom(glue,glue_collapse)
importFrom(purrr,imap)
importFrom(purrr,map)
importFrom(purrr,set_names)
importFrom(dplyr,
"%>%",
across,
mutate,
select
)
importFrom(gamlss.dist,
pST3,
qST3
)
importFrom(glue,
glue,
glue_collapse
)
importFrom(purrr,
imap,
map,
set_names
)
importFrom(tibble,as_tibble)
importFrom(tidyselect,all_of)
importFrom(tidyselect,peek_vars)
importFrom(tidyselect,
all_of,
peek_vars
)
3 changes: 2 additions & 1 deletion R/asFactorDS1.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#' are of type character.
#' @param input.var.name the name of the variable that is to be converted to a factor.
#' @return the levels of the input variable.
#' @author Tim Cadman, Genomics Coordination Centre, UMCG, Netherlands
#' @export
#'
asFactorDS1 <- function(input.var.name=NULL){
Expand All @@ -24,7 +25,7 @@ asFactorDS1 <- function(input.var.name=NULL){
nfilter.levels.max <- as.numeric(thr$nfilter.levels.max) #
##################################################################

input.var <- eval(parse(text=input.var.name), envir = parent.frame())
input.var <- .loadServersideObject(input.var.name)
factor.levels.present.in.source <- levels(factor(input.var))
num.levels<-length(factor.levels.present.in.source)

Expand Down
3 changes: 2 additions & 1 deletion R/asFactorDS2.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@
#' @param baseline.level a number indicating the baseline level to be used in the creation of the
#' matrix of dummy variables.
#' @return an object of class factor
#' @author Tim Cadman, Genomics Coordination Centre, UMCG, Netherlands
#' @export
#'
asFactorDS2 <- function(input.var.name=NULL, all.unique.levels.transmit=NULL, fixed.dummy.vars=NULL, baseline.level=NULL){

input.var <- eval(parse(text=input.var.name), envir = parent.frame())
input.var <- .loadServersideObject(input.var.name)

code.input <- all.unique.levels.transmit
code.c <- unlist(strsplit(code.input, split=","))
Expand Down
3 changes: 2 additions & 1 deletion R/asFactorSimpleDS.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@
#' of these things you will have to use the ds.asFactor function.
#' @param input.var.name the name of the variable that is to be converted to a factor.
#' @return an object of class factor
#' @author Tim Cadman, Genomics Coordination Centre, UMCG, Netherlands
#' @export
#'
asFactorSimpleDS <- function(input.var.name=NULL){

input.var <- eval(parse(text=input.var.name), envir = parent.frame())
input.var <- .loadServersideObject(input.var.name)

factor.obj <- factor(input.var)

Expand Down
11 changes: 7 additions & 4 deletions R/boxPlotGGDS.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#' parameters are passed. There are three different cases depending if there are grouping variables.
#' The outliers are also removed from the graphical parameters.
#'
#' @param data_table \code{data frame} Table that holds the information to be plotted, arranged as: \cr
#' @param data_table.name \code{character} Name of a server-side data frame that holds the information to be plotted, arranged as: \cr
#'
#' Column 'x': Names on the X axis of the boxplot, aka variables to plot \cr
#' Column 'value': Values for that variable (raw data of columns rbinded) \cr
Expand All @@ -18,11 +18,14 @@
#' @return \code{list} with: \cr
#' -\code{data frame} Geometrical parameters (identity stats of ggplot) \cr
#' -\code{character} Type of plot (single_group, double_group or no_group) \cr
#'
#'
#' @author Tim Cadman, Genomics Coordination Centre, UMCG, Netherlands
#' @export

boxPlotGGDS <- function(data_table, group = NULL, group2 = NULL){

boxPlotGGDS <- function(data_table.name, group = NULL, group2 = NULL){

data_table <- .loadServersideObject(data_table.name)

###################################################################
# MODULE 1: CAPTURE THE subset filter SETTINGS #
thr <- dsBase::listDisclosureSettingsDS() #
Expand Down
32 changes: 18 additions & 14 deletions R/boxPlotGG_data_TreatmentDS.R
Original file line number Diff line number Diff line change
@@ -1,42 +1,46 @@
#' @title Arrange data frame to pass it to the boxplot function
#'
#' @param table \code{data frame} Table that holds the information to be plotted later
#' @param table.name \code{character} Name of a server-side data frame that holds the information to be plotted later
#' @param variables \code{character vector} Name of the column(s) of the data frame to include on the boxplot
#' @param group \code{character} (default \code{NULL}) Name of the first grouping variable.
#' @param group2 \code{character} (default \code{NULL}) Name of the second grouping variable.
#' @param group \code{character} (default \code{NULL}) Name of the first grouping variable.
#' @param group2 \code{character} (default \code{NULL}) Name of the second grouping variable.
#'
#' @return \code{data frame} with the following structure: \cr
#'
#'
#' Column 'x': Names on the X axis of the boxplot, aka variables to plot \cr
#' Column 'value': Values for that variable (raw data of columns rbinded) \cr
#' Column 'group': (Optional) Values of the grouping variable \cr
#' Column 'group2': (Optional) Values of the second grouping variable \cr
#'
#'
#' @author Tim Cadman, Genomics Coordination Centre, UMCG, Netherlands
#' @export

boxPlotGG_data_TreatmentDS <- function(table, variables, group = NULL, group2 = NULL){
boxPlotGG_data_TreatmentDS <- function(table.name, variables, group = NULL, group2 = NULL){

table <- .loadServersideObject(table.name)

for(variable in variables){
.checkClass(obj = table[[variable]], obj_name = variable, permitted_classes = c("numeric", "integer"))
}

if(is.null(group) & !is.null(group2)){
group <- group2
group2 <- NULL
}

if(is.null(group2)){
if(is.null(group)){
data <- table[, c(variables)]
}
else{
if(! any(c("factor") %in% class(table[[group]]))) {
stop("Grouping variable must be of class factor")
}
.checkClass(obj = table[[group]], obj_name = group, permitted_classes = c("factor"))
data <- table[, c(variables, group)]
}

}
else{
if((! any(c("factor") %in% class(table[[group]]))) | (! any(c("factor") %in% class(table[[group2]])))){
stop("Grouping variable must be of class factor")
}
.checkClass(obj = table[[group]], obj_name = group, permitted_classes = c("factor"))
.checkClass(obj = table[[group2]], obj_name = group2, permitted_classes = c("factor"))
data <- table[, c(variables, group, group2)]
# Handle case group == group2
if(group == group2){
Expand Down
22 changes: 13 additions & 9 deletions R/boxPlotGG_data_Treatment_numericDS.R
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
#' @title Arrange vector to pass it to the boxplot function
#'
#' @param vector \code{numeric vector} Vector to arrange to be plotted later
#' @param vector.name \code{character} Name of a server-side numeric vector to arrange to be plotted later
#'
#' @return \code{data frame} with the following structure: \cr
#'
#' Column 'x': Names on the X axis of the boxplot, aka name of the vector (vector argument) \cr
#'
#' Column 'x': Names on the X axis of the boxplot, aka name of the vector (vector.name argument) \cr
#' Column 'value': Values for that variable \cr
#'
#'
#' @author Tim Cadman, Genomics Coordination Centre, UMCG, Netherlands
#' @export

boxPlotGG_data_Treatment_numericDS <- function(vector){

data <- data.frame(x = deparse(substitute(vector)), value = vector)

boxPlotGG_data_Treatment_numericDS <- function(vector.name){

vector <- .loadServersideObject(vector.name)
.checkClass(obj = vector, obj_name = vector.name, permitted_classes = c("numeric", "integer"))

data <- data.frame(x = vector.name, value = vector)

return(data)

}
18 changes: 11 additions & 7 deletions R/changeRefGroupDS.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,20 @@
#' as this can introduce a mismatch of values if the vector is put back
#' into a table that is not reordered in the same way. Such mismatch
#' can render the results of operations on that table invalid.
#' @param xvect a factor vector
#' @param x a character string, the name of a factor vector.
#' @param ref a character, the reference level
#' @param reorderByRef a boolean that tells whether or not the new
#' @param reorderByRef a boolean that tells whether or not the new
#' vector should be ordered by the reference group.
#' @return a factor of the same length as xvect
#' @return a factor of the same length as the input vector
#' @author Isaeva, J., Gaye, A.
#' @author Tim Cadman, Genomics Coordination Centre, UMCG, Netherlands
#' @export
#'
changeRefGroupDS <- function(xvect, ref=NULL, reorderByRef=NULL){

changeRefGroupDS <- function(x, ref=NULL, reorderByRef=NULL){

xvect <- .loadServersideObject(x)
.checkClass(obj = xvect, obj_name = x, permitted_classes = "factor")

if(reorderByRef){
temp_xvect = stats::relevel(xvect, ref)
# now reorder puting the ref group first
Expand All @@ -26,7 +30,7 @@ changeRefGroupDS <- function(xvect, ref=NULL, reorderByRef=NULL){
}else{
new_xvect <- stats::relevel(xvect, ref)
}

return(new_xvect)

}
29 changes: 18 additions & 11 deletions R/densityGridDS.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,31 @@
#' @description Generates a density grid that can then be used for heatmap or contour plots.
#' @details Invalid cells (cells with count < to the set filter value for the minimum allowed
#' counts in table cells) are turn to 0.
#' @param xvect a numerical vector
#' @param yvect a numerical vector
#' @param x a character string providing the name of a server-side numerical vector
#' @param y a character string providing the name of a server-side numerical vector
#' @param limits a logical expression for whether or not limits of the density grid are defined by
#' a user. If \code{limits} is set to "FALSE", min and max of xvect and yvect are used as a range.
#' a user. If \code{limits} is set to "FALSE", min and max of x and y are used as a range.
#' If \code{limits} is set to "TRUE", limits defined by x.min, x.max, y.min and y.max are used.
#' @param x.min a minimum value for the x axis of the grid density object, if needed
#' @param x.max a maximum value for the x axis of the grid density object, if needed
#' @param y.min a minimum value for the y axis of the grid density object, if needed
#' @param y.max a maximum value for the y axis of the grid density object, if needed
#' @param numints a number of intervals for the grid density object, by default is 20
#' @return a grid density matrix
#' @return a list with the grid density matrix (\code{grid}) and the classes of the x and y inputs
#' (\code{class.x} and \code{class.y})
#' @author Julia Isaeva, Amadou Gaye, Demetris Avraam for DataSHIELD Development Team
#' @author Tim Cadman, Genomics Coordination Centre, UMCG, Netherlands
#' @export
#'
densityGridDS <- function(xvect, yvect, limits=FALSE, x.min=NULL, x.max=NULL, y.min=NULL, y.max=NULL, numints=20){

#'
densityGridDS <- function(x, y, limits=FALSE, x.min=NULL, x.max=NULL, y.min=NULL, y.max=NULL, numints=20){

xvect <- .loadServersideObject(x)
yvect <- .loadServersideObject(y)
.checkClass(obj = xvect, obj_name = x, permitted_classes = c("numeric", "integer"))
.checkClass(obj = yvect, obj_name = y, permitted_classes = c("numeric", "integer"))

#############################################################
# MODULE 1: CAPTURE THE nfilter SETTINGS
# MODULE 1: CAPTURE THE nfilter SETTINGS
thr <- dsBase::listDisclosureSettingsDS()
nfilter.tab <- as.numeric(thr$nfilter.tab)
#nfilter.glm <- as.numeric(thr$nfilter.glm)
Expand Down Expand Up @@ -93,9 +100,9 @@ densityGridDS <- function(xvect, yvect, limits=FALSE, x.min=NULL, x.max=NULL, y

names(dimnames(grid.density.obj))[2] <- title.text
names(dimnames(grid.density.obj))[1] <- ''
return(grid.density.obj)

return(list(grid=grid.density.obj, class.x=class(xvect), class.y=class(yvect)))

}
# AGGREGATE FUNCTION
# densityGridDS
10 changes: 6 additions & 4 deletions R/gamlssDS.R
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
#' residuals (the normalised quantile residuals of the model) are not disclosed to
#' the client-side.
#' @author Demetris Avraam for DataSHIELD Development Team
#' @author Tim Cadman, Genomics Coordination Centre, UMCG, Netherlands
#' @import gamlss
#' @import gamlss.dist
#' @export
Expand All @@ -81,8 +82,9 @@ gamlssDS <- function(formula=formula, sigma.formula=sigma.formula, nu.formula=nu

thr <- dsBase::listDisclosureSettingsDS()
nfilter.glm <- as.numeric(thr$nfilter.glm)

data <- eval(parse(text = data), envir = parent.frame())

data <- .loadServersideObject(data)
.checkClass(obj = data, obj_name = "data", permitted_classes = c("data.frame", "matrix"))

family <- gsub("left_parenthesis", "(", family, fixed = TRUE)
family <- gsub("right_parenthesis", ")", family, fixed = TRUE)
Expand Down Expand Up @@ -187,8 +189,8 @@ gamlssDS <- function(formula=formula, sigma.formula=sigma.formula, nu.formula=nu
base::assign(newobj, results$residuals, envir = parent.frame())

if(centiles==TRUE){
xvar <- eval(parse(text=xvar), envir = parent.frame())
centiles_out <- gamlss::centiles(obj = results, xvar = xvar, points = FALSE,
xvar <- .loadServersideObject(xvar)
centiles_out <- gamlss::centiles(obj = results, xvar = xvar, points = FALSE,
save = TRUE)
}else{
centiles_out <- NA
Expand Down
4 changes: 3 additions & 1 deletion R/glmDS1.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#' @return List with values from GLM model.
#'
#' @author Burton PR for DataSHIELD Development Team
#' @author Tim Cadman, Genomics Coordination Centre, UMCG, Netherlands
#' @export
#'
glmDS1 <- function(formula, family, weights, offset, data){
Expand All @@ -41,7 +42,8 @@ nfilter.glm <- as.numeric(thr$nfilter.glm)
if(is.null(data)){
dataTable <- NULL
}else{
dataTable <- eval(parse(text=data), envir = parent.frame())
dataTable <- .loadServersideObject(data)
.checkClass(obj = dataTable, obj_name = data, permitted_classes = c("data.frame", "matrix"))
}

formulatext <- Reduce(paste, deparse(formula))
Expand Down
4 changes: 3 additions & 1 deletion R/glmDS2.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#' the data to be analysed under the specified model same
#'
#' @author Paul Burton, for DataSHIELD Development Team
#' @author Tim Cadman, Genomics Coordination Centre, UMCG, Netherlands
#'
#' @return List with values from GLM model
#' @export
Expand All @@ -39,7 +40,8 @@ glmDS2 <- function (formula, family, beta.vect, offset, weights, dataName) {
# Same is done for offset and weights lower down function

if(!is.null(dataName)){
dataDF <- eval(parse(text=dataName), envir = parent.frame())
dataDF <- .loadServersideObject(dataName)
.checkClass(obj = dataDF, obj_name = dataName, permitted_classes = c("data.frame", "matrix"))
}else{
dataDF <- NULL
}
Expand Down
7 changes: 3 additions & 4 deletions R/glmPredictDS.ag.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#' ds.glmPredict and glmPredict.as and help in native R for predict.glm
#' predict.glm in native R
#' @author Paul Burton for DataSHIELD Development Team (20/7/20)
#' @author Tim Cadman, Genomics Coordination Centre, UMCG, Netherlands
#' @export
#'
glmPredictDS.ag <- function(glmname.transmit, newdataname.transmit,
Expand Down Expand Up @@ -148,13 +149,11 @@ if(!string.safe)
}

#Activate all arguments
#glmobj<-eval(parse(text=glmname.transmit))
glmobj<-get(glmname.transmit)
glmobj <- .loadServersideObject(glmname.transmit)

if(!is.null(newdataname.transmit))
{
newdf<-get(newdataname.transmit)
# newdf<-geeval(parse(text=newdataname.transmit))
newdf <- .loadServersideObject(newdataname.transmit)
}else{
newdf<-NULL
}
Expand Down
Loading
Loading