federateRCCA: Federated RCCA

View source: R/server_func.R

federateRCCAR Documentation

Federated RCCA

Description

Perform the regularized canonical correlation analysis for the virtual cohort.

Usage

federateRCCA(loginFD,
                    logins,
                    func,
                    symbol,
                    ncomp = 2,
                    lambda1 = 0,
                    lambda2 = 0,
                    chunk = 500L,
                    mc.cores = 1,
                    tune = FALSE,
                    tune_param = .encode.arg(
                        list(nfold = 5,
                             grid1 = seq(0.001, 1, length = 5),
                             grid2 = seq(0.001, 1, length = 5))))

Arguments

loginFD

Login information of the FD server (one of the servers containing cohort data).

logins

Login information of servers containing cohort data.

func

Encoded definition of a function for preparation of raw data matrices. Two arguments are required: conns (list of Opal connections), symbol (names of the two R symbols) (see datashield.assign).

symbol

Encoded vector of names of the two R symbols to assign in the DataSHIELD R session on each server in logins. The two assigned R variables will be used as the input raw data to compute covariance matrices for CCA. Other assigned R variables in func are ignored.

ncomp

Number of components (covariates). Default, 2.

lambda1

Non-negative regularized parameter value for first data set. Default, 0. If there are more variables than samples, it should be > 0.

lambda2

Non-negative regularized parameter value for second data set. Default, 0. If there are more variables than samples, it should be > 0.

chunk

Size of chunks into what the SSCP matrix is partitioned. Default, 500L.

mc.cores

Number of cores for parallel computing. Default, 1.

tune

Logical value indicating whether the tuning for lambda values will be performed. Default, FALSE, no tuning.

tune_param

Tuning parameters. nfold n-fold cross-validation. grid1 tuning values for lambda1. grid2 tuning values for lambda2.

Value

RCCA object

Examples

## Not run: 
dataProc <- function(conns, symbol) {
    datashield.assign(conns, symbol[1], 'test.CNSIM', variables=c('LAB_TSC', 'LAB_TRIG', 'LAB_HDL'))
    datashield.assign(conns, symbol[2], 'test.CNSIM', variables=c('LAB_GLUC_ADJUSTED', 'PM_BMI_CONTINUOUS'))
}
federateRCCA(.encode.arg(loginFD), .encode.arg(logins), 
             .encode.arg(dataProc, serialize.it = T), 
             .encode.arg(c("rawDataX", "rawDataY")))

## End(Not run)

vanduttran/dsSSCP documentation built on Jan. 17, 2025, 1:47 a.m.