Skip to content

Commit

Permalink
fixed: warning after changes in R 4.0.0 as class(emat) is now longer …
Browse files Browse the repository at this point in the history
…of length 1
  • Loading branch information
peterawe committed Jun 11, 2020
1 parent 2d7860e commit cdb8559
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
3 changes: 2 additions & 1 deletion R/ematAdjust.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#' @seealso \code{\link[base]{scale}}, \code{\link[limma]{voom}},
#' \code{\link[limma]{normalizeBetweenArrays}}
#' @examples
#' library(Biobase)
#' emat <- ematAdjust(crcTCGAsubset[1:100,], normMethod = "quantile")
#' mean(Biobase::exprs(crcTCGAsubset)) # E[>2]
#' mean(emat,na.rm=TRUE) # E[~0]
Expand All @@ -40,7 +41,7 @@ ematAdjust <- function(emat, center = TRUE, scale = TRUE, normMethod = NULL,

# checkInput ##############################################################
if (is.data.frame(emat)) emat <- as.matrix(emat)
if (class(emat) == "ExpressionSet") emat <- Biobase::exprs(emat)
if (class(emat)[1] == "ExpressionSet") emat <- Biobase::exprs(emat)
if (!is.null(normMethod)) {
if (normMethod %in% subData$methods.voom) {
emat <- limma::normalizeBetweenArrays(log2(emat+.25),
Expand Down
2 changes: 1 addition & 1 deletion R/ntp.R
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ ntp <- function(emat, templates, nPerm = 1000, distance = "cosine",
# checkInput ##############################################################

# emat tests
if (class(emat) == "ExpressionSet")
if (class(emat)[1] == "ExpressionSet")
emat <- suppressPackageStartupMessages(Biobase::exprs(emat))
if (is.data.frame(emat) | is.vector(emat)) emat <- as.matrix(emat)
if (is.null(rownames(emat))) stop("missing emat rownames, check input")
Expand Down
4 changes: 1 addition & 3 deletions R/subCamera.R
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ subCamera <- function(emat, class, keepN = TRUE, batch = NULL,
# checkInput ##############################################################

fallback.xKey <- NULL
if (class(emat) == "ExpressionSet") {
if (class(emat)[1] == "ExpressionSet") {
fallback.xKey <- suppressPackageStartupMessages(Biobase::fData(emat))
emat <- Biobase::exprs(emat)
}
Expand Down Expand Up @@ -169,8 +169,6 @@ subCamera <- function(emat, class, keepN = TRUE, batch = NULL,
colnames(design) <- gsub("group", "", colnames(design))

if (doVoom == TRUE) emat <- voomTransform(emat, normMethod, design)
fit <- limma::lmFit(emat, design)
fit2 <- limma::eBayes(fit)
mm <- levels(df$group)

# performCamera #######################################################
Expand Down
2 changes: 1 addition & 1 deletion R/subDEG.R
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ subDEG <- function(emat, class, batch=NULL, keepN=TRUE, doPairwise = FALSE,
# test/fix/clean input
###########################################################################

if (class(emat) == "ExpressionSet") {
if (class(emat)[1] == "ExpressionSet") {
if (is.null(feat)) feat <- Biobase::fData(emat)
emat <- Biobase::exprs(emat)
}
Expand Down

0 comments on commit cdb8559

Please sign in to comment.