knitr::opts_chunk$set(echo = TRUE)

Connect to server

require('DSI')
require('DSOpal')
require('dsBaseClient')

builder <- DSI::newDSLoginBuilder()
builder$append(server = "study1",
   url = "https://opal-demo.obiba.org/",
   user = "dsuser", password = "password",
   driver = "OpalDriver")
logindata <- builder$build()
connections <- DSI::datashield.login(logins = logindata)

Assign resources and resolve them

# Assign resources to the R session
datashield.assign.resource(connections, "RNAseq_resource", "RSRC.RNAseq_EGA")
datashield.assign.resource(connections, "RNAseq_pheno_resource", "RSRC.RNAseq_pheno_EGA")
# Resolve resources
datashield.assign.expr(conns = conns, symbol = "RNAseq", expr = quote(as.resource.object(RNAseq_resource)))
datashield.assign.expr(conns = conns, symbol = "RNAseq_pheno", expr = quote(as.resource.data.frame(RNAseq_pheno_resource)))

Create RangedSummarizedExperiment (RSE) with the two tables

In order to create a RSE, the RNAseq file, has to comply with the following:

ds.colnames('RNAseq_pheno')

The selected resource complies with the requirements. We can now proceed to merge the RNAseq with the phenotypes file into a RSE.

ds.createRSE('RNAseq', 'RNAseq_pheno')

Study of RSE

ds.dim('RSE')
name.features <- ds.featureNames("RSE")
lapply(name.features, head)
name.vars <- ds.featureData("RSE")
lapply(name.vars, head, n=15)
ans.gender <- ds.limma(model =  ~ gender, 
                       Set = "RSE", type.data = "RNAseq", 
                       sva = FALSE)


isglobal-brge/dsOmicsClient documentation built on March 20, 2023, 3:52 p.m.