View source: R/Seurat.Utils.Metadata.R
writeCombinedMetadataToTsvFromLsObj | R Documentation |
Formerly writeMetadataToTsv
. writeCombinedMetadataToTsvFromLsObj
takes a list of ls.Obj, extracts their @meta.data
slots,
removes specified columns, checks for column consistency, creates a barplot showing the number
of rows per object, and finally merges these into one large data frame.
writeCombinedMetadataToTsvFromLsObj(
ls.Obj,
cols.remove = character(),
save_as_qs = TRUE,
save_as_tsv = TRUE,
...
)
ls.Obj |
A list of objects, each containing a |
cols.remove |
A character vector of column names to be removed from each metadata data frame. Default is an empty character vector, meaning no columns will be removed. |
save_as_qs |
A logical indicating whether to save the merged metadata as a .qs object. |
save_as_tsv |
A logical indicating whether to save the merged metadata as a .tsv file. |
... |
Additional arguments to be passed to |
The function starts by validating the input to ensure it's a list. It then extracts the @meta.data
from each object, removing the specified columns. It checks if all data frames have the same columns
and issues a warning if not. A barplot is created to visualize the number of rows (cells) per object.
Finally, it merges all the metadata into one large data frame and prints its dimensions.
A large data frame that is the row-wise merge of all @meta.data
data frames.
This function is intended for use with S4 objects that have a @meta.data
slot.
The function currently contains a browser()
call for debugging purposes, which should be removed in production.
# Assuming a list of Seurat objects with meta.data
mergedMetaData <- writeMetadataToTsv(seuratObjectsList, cols.remove = c("column1", "column2"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.