"addData.MBdataDE" <- function(x,N=NULL,n,IDs=NULL,M,W=NULL,design=NULL) { isValid <- validObject(x) if(!is.null(N)) { x@N <- N if(is.null(IDs)) IDs <- rep(NA,N) } x@n <- x@n+n if(!is.null(IDs)) x@IDs <- as.character(IDs) if(!is.matrix(M)) M <- as.matrix(M) if(is.null(W)) W <- matrix(1,x@N,n) else if(!is.matrix(W)) W <- as.matrix(W) if(is.null(design)) design <- as.matrix(rep(1,n)) else if(!is.matrix(design)) design <- as.matrix(design) if(length(x@M)==0) x@M <- M else { if(nrow(x@M) != nrow(M)) stop("Number of genes of old/new @M data do not match") x@M <- cbind(x@M,M) } if(length(x@W)==0) x@W <- W else { if(nrow(x@W) != nrow(W)) stop("Number of genes of old/new @W data do not match") x@W <- cbind(x@W,W) } if(length(x@design)==0) x@design <- design else { if(ncol(x@design) != ncol(design)) stop("Number of coefficients of old/new @design matrices do not match") x@design <- rbind(x@design,design) } isValid <- validObject(x) return(x) }