Learn R Programming

distcomp

This package is described in detail in the paper Software for Distributed Computation on Medical Databases: A Demonstration Project.

Installation

Install this package the usual way in R or via:

library(devtools)
install_github("bnaras/distcomp")

Then, you will find a document that describes several examples installed under the R library tree. For example:

list.files(system.file("doc", package = "distcomp")) 
list.files(system.file("doc_src", package = "distcomp"))

The examples described in the reference below are available as follows:

list.files(system.file("ex", package = "distcomp"))

Use of this package requires some configuration. In particular, to run the examples on a local machine where a single opencpu server will be emulating several sites, a suitable R profile needs to be set up. That profile will be something along the lines of

library(distcomp) 
distcompSetup(workspace = "full_path_to_workspace_directory",
              ssl_verifyhost = 0L, ssl_verifypeer = 0L)

where the workspace is a directory that the opencpu server can serialize objects to. On Unix or Mac, the above can be inserted into an .Rprofile file, but on Windows, we find that the Rprofile.site file needs to contain the above lines.

The effect of this is that every R process (including the opencpu process) has access to the distcomp library and the workspace.

Prototyping New Computations

Refer to the vignette in the package for some tips on developing new distributed computations.

References

Balasubramanian Narasimhan and Daniel Rubin and Samuel Gross and Marina Bendersky and Philip Lavori. Software for Distributed Computation on Medical Databases: A Demonstration Project. Journal of Statistical Software, Volume 77, Issue 13, (2017). DOI

Copy Link

Version

Install

install.packages('distcomp')

Monthly Downloads

293

Version

1.3-3

License

LGPL (>= 2)

Last Published

September 1st, 2022

Functions in distcomp (1.3-3)

SVDMaster

R6 class for SVD master object to control worker objects generated by SVDWorker()
QueryCountWorker

R6 worker object for use as a worker with master objects generated by QueryCountMaster()
SVDWorker

R6 class for a SVD worker object to use with master objects generated by SVDMaster()
QueryCountMaster

Create a master object to control worker objects generated by QueryCountWorker()
CoxMaster

Create a master object to control CoxWorker worker objects
CoxWorker

R6 class for object to use as a worker with CoxMaster master objects
HEQueryCountMaster

Create a homomorphic computation query count master object to employ worker objects generated by HEQueryCountWorker()
HEMaster

Create a HEMaster process for use in a distributed homomorphic encrypted (HE) computation
HEQueryCountWorker

Create a homomorphic computation query count worker object for use with master objects generated by HEQueryCountMaster()
NCP

R6 object to use as non-cooperating party in a distributed homomorphic computation
createHEWorkerInstance

Given the definition identifier of an object, instantiate and store object in workspace
createNCPInstance

Given the definition identifier of an object, instantiate and store object in workspace
createWorkerInstance

Given the definition identifier of an object, instantiate and store object in workspace
availableDataSources

Return currently implemented data sources
distcomp

Distributed Computing with R
dccoxph

Functions copied and modified from survival package
.makeOpencpuURL

Make an appropriate opencpu URL for a specified function and url prefix for the distcomp package
availableComputations

Return the currently available (implemented) computations
defineNewComputation

Define a new computation
destroyInstanceObject

Destroy an instance object given its identifier
makeNCP

Instantiate an noncooperating party
makeMaster

Make a master object given a definition
generateId

Generate an identifier for an object
executeMethod

Given the id of a serialized object, invoke a method on the object with arguments
uploadNewComputation

Upload a new computation and data to an opencpu server
uploadNewNCP

Upload a new Non-Cooperating Party (NCP) information and sites to an opencpu server
setupMaster

Setup a computation master
writeCode

Write the code necessary to run a master process
setupWorker

Setup a worker site
resetComputationInfo

Clear the contents of the global store
makeWorker

Make a worker object given a definition and data
runDistcompApp

Run a specified distcomp web application
getComputationInfo

Get the value of a variable from the global store
saveNewComputation

Save a computation instance, given the computation definition, associated data and possibly a data file name to use
getConfig

Return the workspace and configuration setup values
executeHEMethod

Given the id of a serialized object, invoke a method on the object with arguments using homomorphic encryption
saveNewNCP

Save an NCP instance, given the sites as associated data and possibly a data file name to use
setComputationInfo

Set a name to a value in a global variable
distcompSetup

Setup a workspace and configuration for a distributed computation
makeHEMaster

Instantiate a master process for HE operations
makeDefinition

Make a computation definition given the computation type