# Input -------------------------------------------
#' Add cell wise data to seurat object
#'
#' Takes in a matrix containing information about each cell in a single cell
#' seurat object and and adds the data to the matrix. This method allows
#' metadata to be added to the object in bulk.
#'
#' @param seurat_object A seurat object
#' @param data_matrix A factor x cell matrix with cell wise data
#'
#' @import Seurat
#' @return A seurat object with all the data from data_matrix added
#' @export
AddMetaDataMatrix <- function(seurat_object, data_matrix) {
for (i in 1:nrow(data_matrix)) {
seurat_object[[rownames(data_matrix)[i]]] <- data_matrix[i,]
}
return(seurat_object)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.