Collapse a vector of gene names
collapseGenes(
x,
sort = TRUE,
dedup = TRUE,
format = "_",
sep = ", ",
last = " and ",
numeric = TRUE,
width = Inf,
...
)
character vector representing gene names
logical(1) Should the names be sorted alphabetically
logical(1) Should duplicate names be removed
character string for markdown formatting of each element
separator between vector elements
character string to place before the last element
logical(1) sort digits numerically, instead of as strings
The maximum width of the string before truncating to ...
passed to str_sort
a glue object
Convenience function to collapse a vector of gene names into a character/glue object of length 1. By default, symbols are deduplicated, sorted alpha-numerically and italicised with an underscore.
genes <- c("FOXP3", "BRCA1", "TP53")
collapseGenes(genes)
#> _BRCA1_, _FOXP3_ and _TP53_