Description Usage Arguments Value Examples
Return the dimension of an ondisc_matrix
, metadata_ondisc_matrix
, or multimodal_ondisc_matrix
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | ## S4 method for signature 'ondisc_matrix'
dim(x)
## S4 method for signature 'metadata_ondisc_matrix'
dim(x)
## S4 method for signature 'multimodal_ondisc_matrix'
dim(x)
ncol(x)
nrow(x)
## S4 method for signature 'multimodal_ondisc_matrix'
ncol(x)
## S4 method for signature 'multimodal_ondisc_matrix'
nrow(x)
|
x |
an |
If x
is an ondisc_matrix
or metadata_ondisc_matrix
, length-two integer vector containing
the dimension of x
; if x
is a multimodal_ondisc_matrix
, a list of integer vectors containing the dimensions
of the constituent modalities of x
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | # NOTE: You must create the RDS files "expressions.rds" and
# "perturbations.rds" to run this example. Navigate to the help file of
# "create_ondisc_matrix_from_mtx" (via ?create_ondisc_matrix_from_mtx),
# and execute both code blocks.
# dimension of an ondisc_matrix
h5_fp <- paste0(tempdir(), "/expressions.h5")
if (file.exists(h5_fp)) {
odm <- ondisc_matrix(h5_file = h5_fp)
dim(odm)
}
# dimension of a metadata_ondic_matrix
expressions_fp <- paste0(tempdir(), "/expressions.rds")
if (file.exists(expressions_fp)) {
expressions <- readRDS(expressions_fp)
dim(expressions)
}
# dimension of a multimodal_ondisc_matrix
expression_fp <- paste0(tempdir(), "/expressions.rds")
perturbations_fp <- paste0(tempdir(), "/perturbations.rds")
if (file.exists(expression_fp) && file.exists(perturbations_fp)) {
crispr_experiment <- multimodal_ondisc_matrix(list(expressions = readRDS(expression_fp),
perturbations = readRDS(perturbations_fp)))
dim(crispr_experiment)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.