ds.edgeR: Server-side Differential Expression Analysis using edgeR

View source: R/ds.edgeR.R

ds.edgeRR Documentation

Server-side Differential Expression Analysis using edgeR

Description

This function performs a non-disclosive Differential Expression Analysis using edgeR package functions from Bioconductor.

Usage

ds.edgeR(
  model,
  set,
  test = "QLF",
  dispersion = "both",
  normalization = "TMM",
  levels = "design",
  coef = 2,
  contrast = NULL,
  datasources = NULL
)

Arguments

model

formula indicating the condition and other covariates to be adjusted.

set

SummarizedExperiment object.

test

a character string specifying the test to carry out. test parameter can be set as "QLF" or LRT. Default "QLF". For more information see Details.

dispersion

a character string specifying the type of dispersion to estimate. This can be set as both, common or tagwise. For more information see Details. Default "both".

normalization

a character string specifying the normalization method to be used. This can be set as "TMM","TMMwsp","RLE","upperquartile" or "none". Default "TMM". For more information see Details.

levels

a character or factor vector specifying the names of the parameters to be used in contrast. Also, the design matrix can be specified. Default "design".

coef

an integer or character specifying the coefficients of the linear model to be tested equal to zero. Default 2.

contrast

the comparison to extract from the object to build the results table.

datasources

a list of DSConnection-class objects obtained after login. If the datasources argument is not specified the default set of connections will be used: see datashield.connections_default.

Details

Differential Expression Analysis of RNA-seq data based on genewise negative binomial generalized linear models using either likelihood ratio or quasi-likelihood F-tests.

The steps implemented by DataSHIELD ds.edgeR client-side and edgeRDS server-side function is the following:
(1) Create DGEList object
(2) Filter genes using Expression Level. Implemented by filterByExpr function from edgeR package.
(3) Calculate the Normalization Factors using calcNormFactors function. The normalization parameter can be set as follows:

  • "TMM": uses a trimmed mean of M-values between each pair of samples.

  • "TMMwsp": TMM with singleton pairing. A variant of TMM that performs better with a high proportion of zeros data

  • "RLE": relative log expression. The median library is calculated from the geometric mean of all columns and the median ratio of each sample to the median library is taken as the scale factor.

  • "upperquartile": the scale factors are calculated from the 75% quantile of the counts for each library, after removing genes that are zero in all libraries.

  • "none": the normalization factors are set to 1.

Note that normalization is only necessary for sample-specific effects.
(4) Estimate the dispersion. The dispersion parameter can be set as follows:

  • "both": estimate common and tagwise dispersions in one run (estimateDisp).

  • "common": estimate common dispersion (estimateCommonDisp).

  • "tagwise": estimate tagwise dispersions (estimateTagwiseDisp). Note that before needs to estimate common dispersion. This is done automatically when tagwise option is selected.

(5) Differential Expression Analysis. test can be set as follows:

  • "QLF": perform quasi-likelihood F-tests (glmQLFit and glmQLFTest). Highly recommended for differential expression analysis of RNA-seq.

  • "LRT": perform likelihood ratio tests (glmFit and glmLRT). Useful in single cell RNA-seq and datasets with no replicates.

Value

ds.edgeR returns to the client-side a data frame containing differential expression results for the top genes sorted by adjusted p-value.

Author(s)

L. Abarrategui, for DataSHIELD development team

Examples

 
## Not run: 
 #required packages

 library(DSI)
 library(DSOpal)
 library(dsBaseClient)
 library(dsOmicsClient)

 # Connecting to the Opal servers
 builder <- DSI::newDSLoginBuilder()
 builder$append(server = "study1", url = "https://opal-demo.obiba.org/", 
                user = "dsuser", password = "password", 
                resource = "RSRC.tcga_liver")

 logindata <- builder$build()

 conns <- datashield.login(logins = logindata, 
                           assign = TRUE, 
                           symbol = "res")
                           
 #coerce the resource to a RangedSummarizedExperiment

 datashield.assign.expr(conns = conns, 
                        symbol = "rse",
                        expr = quote(as.resource.object(res)))
                        
 #Differential Expression analysis
 
 ##Default settings
 ds.edgeR(model =~ gdc_cases.demographic.gender,set = "rse")

 # Clear the Datashield R sessions and logout  
  
  DSI::datashield.logout(conns) 
  
## End(Not run)


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