-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
70 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
Package: dsOmics | ||
Type: Package | ||
Title: DataSHIELD server site Omic functions | ||
Version: 1.0.17.9000 | ||
Version: 1.0.17.9001 | ||
Date: 2021-07-08 | ||
Authors@R: c(person("Yannick", "Marcon", , "[email protected]", role = "aut"), | ||
person("Xavier", "Esriba-Montagut", , "[email protected]", role = "aut"), | ||
|
@@ -38,7 +38,7 @@ AggregateMethods: | |
nSamplesDS, | ||
nFeaturesDS, | ||
tablePhenoDS, | ||
limmaDS, | ||
limmaDS2, | ||
getVariable, | ||
getChromosomeNamesDS, | ||
GWASDS, | ||
|
@@ -65,6 +65,7 @@ AssignMethods: | |
RNAseqPreprocDS, | ||
PRSDS, | ||
PRSDS_aux, | ||
limmaDS, | ||
make_valid_namesDS, | ||
fastGWAS_S, | ||
fastGWAS_getFitted.values, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#' | ||
#' @title Differential expression analysis using limma on the server-side | ||
#' @description Performs differential expression analysis using LIMMA | ||
#' @param Set either a \code{ExpressionSet} or a \code{RangedSummarizedExperiment} | ||
#' @param variable_names grouping variable used to perform differential expression analysis | ||
#' @param covariable_names name of variables used in the adjusted models | ||
#' @param type ... | ||
#' @param contrasts ... | ||
#' @param levels ... | ||
#' @param coef ... | ||
#' @param sva should differential expression analysis be adjusted by SVA? | ||
#' @param annotCols variables from the annotation data used in the output | ||
#' @param method String indicating the method used in the regression (e.g. lmFit function of limma: "ls" or | ||
#' "robust". (Default: "ls") | ||
#' @param robust Logical value indicating whether robust method is applied in the eBayes function of limma. Default is FALSE. | ||
#' @param normalization String indicating the normalize method used when using voom for RNAseq data (see normalized.method argument in limma::vomm) | ||
#' @param voomQualityWeights Logical value indicating whether limma::voomWithQualityWeights should be used instead of | ||
#' limma::voom. | ||
#' @param big Logical value indicating whether SmartSVA should be used instead of SVA | ||
#' (TRUE recommended for methylation or when having large number of samples). | ||
#' | ||
#' | ||
#' @return a matrix with genes ordered by p-value | ||
#' @author Gonzalez, JR. | ||
#' | ||
#' @import dplyr | ||
#' @export | ||
#' | ||
limmaDS2 <- function(Set, res, type, contrasts, | ||
coef, annotCols, robust, sort.by){ | ||
|
||
temp <- MEAL::getProbeResults(res, fNames=annotCols, coef = coef, | ||
contrast = contrasts, robust = robust, sort.by = sort.by) | ||
if(any(class(temp) == 'simpleError')){stop(paste(temp))} | ||
if(type == 1){ | ||
if(inherits(Set, "ExpressionSet")){ | ||
Set.counts <- Biobase::exprs(Set) | ||
} | ||
else if (inherits(Set, c("SummarizedExperiment","RangedSummarizedExperiment"))){ | ||
Set.counts <- SummarizedExperiment::assay(Set) | ||
} | ||
} | ||
n <- apply(Set.counts, 1, function(x) sum(!is.na(x))) | ||
ans <- tibble::as_tibble(temp) %>% tibble::add_column(.before=1, id=rownames(temp)) %>% | ||
tibble::add_column(.after = 1, n=n) %>% dplyr::rename("beta" = "logFC") %>% | ||
dplyr::select(id, tail(names(.), length(annotCols)), everything()) %>% | ||
dplyr::select(id, n, beta, SE, t, P.Value, adj.P.Val, annotCols) | ||
return(ans) | ||
} |