Globally adjust data matrix using both negative controls and replicates.
RUVIII(Y, M, ctl, k = NULL, eta = NULL, include.intercept = TRUE,
average = FALSE, fullalpha = NULL, return.info = FALSE, inputcheck = TRUE)
The data. A m by n matrix, where m is the number of observations and n is the number of features.
The replicate structure. Represented internally as a mapping matrix. The mapping matrix has m rows (one for each observation), and each column represents a set of replicates. The (i, j)-th entry of the mapping matrix is 1 if the i-th observation is in replicate set j, and 0 otherwise. Each observation must be in exactly one set of replicates (some replicate sets may contain only one observation), and thus each row of M must sum to 1. M
may be the mapping matrix itself. Alternatively, M
may be a vector, factor, or dataframe, in which case it is converted to the mapping matrix by the replicate.matrix
function.
An index vector to specify the negative controls. Either a logical vector of length n or a vector of integers.
The number of unwanted factors to use. Can be 0, in which case no adjustment is made. Can also be NULL (the default value), in which case the maximum possible value of k is used; note that in this case no singular value decomposition is necessary and execution is faster.
Gene-wise (as opposed to sample-wise) covariates. These covariates are adjusted for by RUV-1 before any further analysis proceeds. Can be either (1) a matrix with n columns, (2) a matrix with n rows, (3) a dataframe with n rows, (4) a vector or factor of length n, or (5) simply 1, for an intercept term.
When eta
is specified (not NULL
) but does not already include an intercept term, this will automatically include one.
Average replicates after adjustment.
Can be included to speed up execution. Is returned by previous calls of RUVIII
(see below).
If FALSE
, only the adjusted data matrix is returned. If TRUE
, additional information is returned (see below).
Perform a basic sanity check on the inputs, and issue a warning if there is a problem.
If codereturn.info is TRUE
, a list is returned that contains:
The adjusted data matrix.
The replicate mapping matrix. Included for reference.
Can be used to speed up future calls to RUVIII