get_design: Retrieve Design Matrix

Description Usage Arguments Details Value Methods (by class) Examples

Description

Given a SconeExperiment object created by a call to scone, it will return the design matrix of the selected method.

Usage

1
2
3
4
5
6
7
get_design(x, method)

## S4 method for signature 'SconeExperiment,character'
get_design(x, method)

## S4 method for signature 'SconeExperiment,numeric'
get_design(x, method)

Arguments

x

a SconeExperiment object containing the results of scone.

method

character or numeric. Either a string identifying the normalization scheme to be retrieved, or a numeric index with the rank of the normalization method to retrieve (according to scone ranking of normalizations).

Details

The numeric method will always return the design matrix corresponding to row method of the scone_params slot. This means that if scone was run with eval=TRUE, get_design(x, 1) will return the top ranked method. If scone was run with eval=FALSE, get_design(x, 1) will return the first normalization in the order saved by scone.

Value

The design matrix.

Methods (by class)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
set.seed(42)
mat <- matrix(rpois(500, lambda = 5), ncol=10)
colnames(mat) <- paste("X", 1:ncol(mat), sep="")
obj <- SconeExperiment(mat, bio = factor(rep(c(1,2),each = 5)),
           batch = factor(rep(c(1,2),times = 5)))
res <- scone(obj, scaling=list(none=identity, uq=UQ_FN),
           evaluate=TRUE, k_ruv=0, k_qc=0, 
           adjust_batch = "yes", adjust_bio = "yes",
           eval_kclust=2, bpparam = BiocParallel::SerialParam())
design_top = get_design(res,1)

scone documentation built on Nov. 8, 2020, 5:20 p.m.