com_factor | R Documentation |
This is a helper function for data/aSVGs involving three or more factors such as sample, time, condition. It combine factors in targets file to make composite factors.
com_factor(se, target, factors2com, sep = ".", factor.new)
se |
A |
target |
A |
factors2com |
A character vector of column names or a numeric vector of column indeces in the targets file. Entries in these columns are combined. |
sep |
The separator in the combined factors. One of |
factor.new |
The column name of the new combined factors. |
If se
is provided, a SummarizedExperiment
object is returned, where the colData
slot contains the new column of combined factors. Otherwise, adata.frame
object is returned, where the new column of combined factors is appended.
Jianhai Zhang jzhan067@ucr.edu
Dr. Thomas Girke thomas.girke@ucr.edu
Attilio, Peter J, Dustin M Snapper, Milan Rusnak, Akira Isaac, Anthony R Soltis, Matthew D Wilkerson, Clifton L Dalgard, and Aviva J Symes. 2021. “Transcriptomic Analysis of Mouse Brain After Traumatic Brain Injury Reveals That the Angiotensin Receptor Blocker Candesartan Acts Through Novel Pathways.” Front. Neurosci. 15 (March): 636259
library(SummarizedExperiment)
mus.se.pa <- system.file('extdata/shinyApp/data/mus_brain_vars_se.rds', package='spatialHeatmap')
mus.se <- readRDS(mus.se.pa); targets.info <- colData(mus.se)
targets.new <- com_factor(target=targets.info, factors2com=c('time', 'treatment', 'injury'), factor.new='comDim')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.