Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom colors for option Biostrings.coloring #115

Open
kmakat opened this issue Sep 1, 2024 · 1 comment
Open

Custom colors for option Biostrings.coloring #115

kmakat opened this issue Sep 1, 2024 · 1 comment

Comments

@kmakat
Copy link

kmakat commented Sep 1, 2024

Hello,

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

Thanks for considering,
Kemal

@ahl27
Copy link
Collaborator

ahl27 commented Oct 11, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants