Set metadata entries in a SummarizedExperiment object so that it can be used as a weitrix.

bless_weitrix(object, x_name, weights_name)

Arguments

object

A SummarizedExperiment object.

x_name

Name of the assay containing the observations.

weights_name

Name of the assay containing the weights.

Value

A SummarizedExperiment object with metadata fields marking it as a weitrix.

Examples

mat <- matrix(c(1,2,NA,3,NA,4), ncol=2) weights <- matrix(c(1,0.5,0,2,0,1), ncol=2) se <- SummarizedExperiment(assays=list(foo=mat, bar=weights)) weitrix <- bless_weitrix(se, "foo", "bar") metadata(weitrix)
#> $weitrix #> $weitrix$x_name #> [1] "foo" #> #> $weitrix$weights_name #> [1] "bar" #> #>
weitrix_x(weitrix)
#> [,1] [,2] #> [1,] 1 3 #> [2,] 2 NA #> [3,] NA 4
weitrix_weights(weitrix)
#> [,1] [,2] #> [1,] 1.0 2 #> [2,] 0.5 0 #> [3,] 0.0 1