View source: R/wrap_add_expression.R
add_expression | R Documentation |
Add count and normalised expression values to a dataset
add_expression(
dataset,
counts,
expression,
feature_info = NULL,
expression_future = NULL,
...
)
is_wrapper_with_expression(dataset)
get_expression(dataset, expression_source = "expression")
dataset |
A dataset created by |
counts |
The counts values of genes (columns) within cells (rows). This can be both a dense and sparse matrix. |
expression |
The normalised expression values of genes (columns) within cells (rows). This can be both a dense and sparse matrix. |
feature_info |
Optional meta-information of the features, a dataframe with at least feature_id as column |
expression_future |
Projected expression using RNA velocity of genes (columns) within cells (rows). This can be both a dense and sparse matrix. |
... |
extra information to be stored in the dataset |
expression_source |
The source of expression, can be "counts", "expression", an expression matrix, or another dataset which contains expression |
A dynwrap object with the expression added.
cell_ids <- c("A", "B", "C")
counts <- matrix(sample(0:10, 3*10, replace = TRUE), nrow = 3)
rownames(counts) <- cell_ids
colnames(counts) <- letters[1:10]
expression <- log2(counts + 1)
dataset <- wrap_data(id = "my_awesome_dataset", cell_ids = cell_ids)
dataset <- add_expression(dataset, counts = counts, expression = expression)
str(dataset$expression)
str(dataset$counts)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.