Convert a Seurat marker table into plain-text lines of the form
cluster_<id>:geneA,geneB,..., one line per cluster.
Arguments
- markers_tbl
A tibble / data.frame containing at least the columns
cluster,gene, and the column named inorder_by.- top_n
Integer. Number of genes to keep for each cluster (default 10).
- order_by
Column used to rank genes within each cluster. Accepts either a character string (e.g.
"avg_log2FC") or a bare column name (unquoted). Default"avg_log2FC".- verbose
Logical. Print
leo_log()messages? Default TRUE.
Examples
top10 <- data.frame(
cluster = rep(1:2, each = 2),
gene = c("GeneA", "GeneB", "GeneC", "GeneD"),
p_val_adj = c(0.01, 0.05, 0.001, 0.02),
avg_log2FC = c(1.5, 1.2, 2.0, 1.8),
avg_logFC = c(1.5, 1.2, 2.0, 1.8)
)
txt <- format_markers_for_upload(top10, top_n = 15, order_by = "p_val_adj")
#> ℹ [05:05:59] Website for uploading: http://xteam.xbio.top/ACT/index.jsp
#> ℹ [05:05:59] Backup website: http://biocc.hrbmu.edu.cn/ACT/index.jsp
#> ✔ [05:05:59] Marker list formatted
cat(txt)
#> cluster_1:GeneB,GeneA
#> cluster_2:GeneD,GeneC
## tidy-eval style (bare name):
txt2 <- format_markers_for_upload(top10, order_by = avg_log2FC)
#> ℹ [05:05:59] Website for uploading: http://xteam.xbio.top/ACT/index.jsp
#> ℹ [05:05:59] Backup website: http://biocc.hrbmu.edu.cn/ACT/index.jsp
#> ✔ [05:05:59] Marker list formatted