View source: R/aggregate_rows.R
aggregate_rows | R Documentation |
Aggregate rows of a matrix for many:1 mappings, using a grouping vector.
aggregate_rows(
X,
groupings,
agg_fun = "sum",
agg_method = c("monocle3", "stats"),
as_sparse = TRUE,
as_DelayedArray = TRUE,
dropNA = TRUE,
verbose = TRUE
)
X |
Input matrix. |
groupings |
Gene groups of the same length as |
agg_fun |
Aggregation function. |
agg_method |
Aggregation method. |
as_sparse |
Convert aggregated matrix to sparse matrix. |
as_DelayedArray |
Convert aggregated matrix to DelayedArray. |
dropNA |
Drop genes assigned to |
verbose |
Print messages. |
Aggregated matrix
data("exp_mouse_enst")
X <- exp_mouse_enst
gene_map <- map_genes(genes = rownames(X),species = "mouse")
X_agg <- orthogene:::aggregate_rows(X = X,
groupings = gene_map$name)
sum(duplicated(rownames(exp_mouse))) # 0
sum(duplicated(rownames(X))) # 1215
sum(duplicated(rownames(X_agg))) # 0
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.