Biostrings icon indicating copy to clipboard operation
Biostrings copied to clipboard

Custom colors for option Biostrings.coloring

Open kmakat opened this issue 1 year ago • 2 comments

Hello,

any chance to add an option to assign custom colors for nucleotide/AA coloring in XString/XStringSets?

Thanks for considering, Kemal

kmakat avatar Sep 01 '24 19:09 kmakat

Sorry for the slow response. This should be easily doable. I have a relatively long task list to get through for the next Bioc release, but I'll see if I can fit this in. Happy to review a PR as well if you get to it before me.

Notes for myself for later so I don't forget how to fix this when I get back to it

colors are built in make_AA_COLORED_LETTERS and make_DNA_COLORED_LETTERS. Add a function update_DNA_COLORED_LETTERS, update_AA_COLORED_LETTERS that takes as input color codes with names in the alphabet set and replaces the entries in DNA_AND_RNA_COLORED_LETTERS,AA_COLORED_LETTERS with the requested other colors. Accept no argument (or maybe also 'default') to reset to default. Should support input as a list too so that users can change foreground and background colors, e.g.:

# option 1
update_DNA_COLORED_LETTERS <- function(foreground=character(), background=character()) {
    ...
}

# option 2
update_DNA_COLORED_LETTERS <- function(list(foreground=character(), background=character())){
    ...
}

This won't persist across sessions but I don't think that's a major issue.

ahl27 avatar Oct 11 '24 17:10 ahl27

Fixed in PR #123

ahl27 avatar Jan 02 '25 18:01 ahl27