View source: R/find_markers_in_bulk.R
find_markers_in_bulk | R Documentation |
The goal of this function is to find relevant results from the given gene expression data and meta information.
find_markers_in_bulk(
pdata,
eset,
group,
id_pdata = "ID",
nfeatures = 2000,
top_n = 20,
thresh.use = 0.25,
only.pos = TRUE,
min.pct = 0.25,
npcs = 30
)
pdata |
A data frame containing the meta information of the samples. |
eset |
A matrix containing the gene expression data or signature score. |
group |
A string representing the column name for grouping. |
id_pdata |
A string representing the column name for sample IDs, default is "ID". |
nfeatures |
A numeric value indicating the top n features to select from the variable features, default is 2000. |
top_n |
A numeric value representing the top n markers to select in each cluster, default is 20. |
thresh.use |
A numeric value representing the marker selection threshold, default is 0.25. |
only.pos |
A logical value indicating whether to select only positive markers, default is TRUE. |
min.pct |
A numeric value representing the minimum percentage threshold for marker selection, default is 0.25. |
# loading expression data
data("eset_tme_stad", package = "IOBR")
colnames(eset_tme_stad) <- substring(colnames(eset_tme_stad), 1, 12)
data("pdata_sig_tme", package = "IOBR")
res <- find_markers_in_bulk(pdata = pdata_sig_tme, eset = eset_tme_stad, group = "TMEcluster")
# extracting top 15 markers of each TME clusters
top15 <- res$top_markers %>% dplyr:: group_by(cluster) %>% dplyr::top_n(15, avg_log2FC)
# visualization
cols <- c('#2692a4','#fc0d3a','#ffbe0b')
DoHeatmap(res$sce, top15$gene, group.colors = cols )+ scale_fill_gradientn(colours = rev(colorRampPalette(RColorBrewer::brewer.pal(11,"RdBu"))(256)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.