Skip to content

Commit 8a57e18

Browse files
author
Leire Abarrategui Martinez
committed
ds.acme changes
1 parent 997bfcb commit 8a57e18

3 files changed

Lines changed: 80 additions & 0 deletions

File tree

NAMESPACE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Generated by roxygen2: do not edit by hand
22

33
export(ds.Boole)
4+
export(ds.acme)
45
export(ds.asCharacter)
56
export(ds.asDataMatrix)
67
export(ds.asFactor)

R/ds.acme.R

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
#'
2+
#' @title ds.acme function template
3+
#' @description example aggregate function template
4+
#' @details Client-side acme example aggregate function template
5+
#' This file is to be placed in server-sides R directory.
6+
#' @param name a character vector containing "a name"
7+
#' @param datasources specifies the particular 'connection object(s)' to use.
8+
#' @return character vector containing "a message"
9+
#' @author Ever, Who.
10+
#' @export
11+
#'
12+
13+
ds.acme <- function(model, Set, type.data = "SummarizedExperiment", threshold = NULL,
14+
reference = NULL, annotCols=NULL, datasources=NULL)
15+
{
16+
# if no opal login details are provided look for 'opal' objects in the environment
17+
if (is.null(datasources))
18+
{
19+
datasources <- DSI::datashield.connections_find()
20+
}
21+
type <- charmatch(type.data, c("SummarizedExperiment", "matrix", "htseq"))
22+
23+
if(is.na(type))
24+
{
25+
stop("type.data must be 'SummarizedExperiment', 'matrix', 'htseq'")
26+
}
27+
28+
mt <- all.vars(model)
29+
variable_names <- mt[1]
30+
31+
if (length(mt)>1)
32+
{
33+
covariable_names <- paste(mt[-1], collapse=",")
34+
}
35+
36+
else
37+
{
38+
covariable_names <- NULL
39+
}
40+
41+
if (!is.null(annotCols))
42+
{
43+
annotCols <- paste(annotCols, collapse=",")
44+
}
45+
46+
# call the server side function
47+
calltext <- call("acmeDS",Set, type,variable_names, covariable_names, annotCols, threshold, reference)
48+
49+
output <- datashield.aggregate(datasources, calltext)
50+
51+
return(output)
52+
}
53+
#ds.acme

man/ds.acme.Rd

Lines changed: 26 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)