Perform a fast version of the ruv::RUVIII algorithm for scRNA-Seq data noise estimation
fastRUVIII(
Y,
M,
ctl,
k = NULL,
eta = NULL,
svd_k = 50,
include.intercept = TRUE,
average = FALSE,
BPPARAM = SerialParam(),
BSPARAM = ExactParam(),
fullalpha = NULL,
return.info = FALSE,
inputcheck = TRUE
)
The unnormalised scRNA-Seq data matrix. A m by n matrix, where m is the number of observations and n is the number of features.
The replicate 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. See ruv::RUVIII for more details.
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 remove. This is inherited from the ruvK argument from the scMerge::scMerge function.
Gene-wise (as opposed to sample-wise) covariates. See ruv::RUVIII for details.
If BSPARAM is set to RandomParam
or IrlbaParam
class from BiocSingular
package, then
svd_k
will be used to used to reduce the computational cost of singular value decomposition. Default to 50.
When eta is specified (not NULL) but does not already include an intercept term, this will automatically include one. See ruv::RUVIII for details.
Average replicates after adjustment. See ruv::RUVIII for details.
A BiocParallelParam
class object from the BiocParallel
package is used. Default is SerialParam().
A BiocSingularParam
class object from the BiocSingular
package is used. Default is ExactParam().
Not used. Please ignore. See ruv::RUVIII for details.
Additional information relating to the computation of normalised matrix. We recommend setting this to true.
We recommend setting this to true.
A normalised matrix of the same dimensions as the input matrix Y.
L = ruvSimulate(m = 200, n = 500, nc = 400, nCelltypes = 3, nBatch = 2, lambda = 0.1, sce = FALSE)
Y = L$Y; M = L$M; ctl = L$ctl
improved1 = scMerge::fastRUVIII(Y = Y, M = M, ctl = ctl,
k = 20, BSPARAM = BiocSingular::ExactParam())
improved2 = scMerge::fastRUVIII(Y = Y, M = M, ctl = ctl,
k = 20, BSPARAM = BiocSingular::RandomParam(), svd_k = 50)
old = ruv::RUVIII(Y = Y, M = M, ctl = ctl, k = 20)
all.equal(improved1, old)
#> [1] "Modes: S4, numeric"
#> [2] "Attributes: < Names: 2 string mismatches >"
#> [3] "Attributes: < Component 1: Modes: character, numeric >"
#> [4] "Attributes: < Component 1: Lengths: 1, 2 >"
#> [5] "Attributes: < Component 1: Attributes: < Modes: list, NULL > >"
#> [6] "Attributes: < Component 1: Attributes: < Lengths: 1, 0 > >"
#> [7] "Attributes: < Component 1: Attributes: < names for target but not for current > >"
#> [8] "Attributes: < Component 1: Attributes: < current is not list-like > >"
#> [9] "Attributes: < Component 1: target is character, current is numeric >"
#> [10] "Attributes: < Component 2: Modes: S4, list >"
#> [11] "Attributes: < Component 2: Lengths: 100000, 2 >"
#> [12] "Attributes: < Component 2: Attributes: < Modes: list, NULL > >"
#> [13] "Attributes: < Component 2: Attributes: < Lengths: 4, 0 > >"
#> [14] "Attributes: < Component 2: Attributes: < names for target but not for current > >"
#> [15] "Attributes: < Component 2: Attributes: < current is not list-like > >"
all.equal(improved2, old)
#> [1] "Modes: S4, numeric"
#> [2] "Attributes: < Names: 2 string mismatches >"
#> [3] "Attributes: < Component 1: Modes: character, numeric >"
#> [4] "Attributes: < Component 1: Lengths: 1, 2 >"
#> [5] "Attributes: < Component 1: Attributes: < Modes: list, NULL > >"
#> [6] "Attributes: < Component 1: Attributes: < Lengths: 1, 0 > >"
#> [7] "Attributes: < Component 1: Attributes: < names for target but not for current > >"
#> [8] "Attributes: < Component 1: Attributes: < current is not list-like > >"
#> [9] "Attributes: < Component 1: target is character, current is numeric >"
#> [10] "Attributes: < Component 2: Modes: S4, list >"
#> [11] "Attributes: < Component 2: Lengths: 100000, 2 >"
#> [12] "Attributes: < Component 2: Attributes: < Modes: list, NULL > >"
#> [13] "Attributes: < Component 2: Attributes: < Lengths: 4, 0 > >"
#> [14] "Attributes: < Component 2: Attributes: < names for target but not for current > >"
#> [15] "Attributes: < Component 2: Attributes: < current is not list-like > >"