Add methods for generating colors for clone IDs.#172
Conversation
8c532f8 to
ea2f2ec
Compare
ea2f2ec to
438447a
Compare
| VignetteBuilder: knitr | ||
| LazyLoad: yes | ||
| LazyData: yes | ||
| RoxygenNote: 7.3.1 |
There was a problem hiding this comment.
@dan-knight I think I've brought up using Roxugen in the past, do we want to use this for the rest of the documentation as well? I think if we start using it, we should standardize it.
There was a problem hiding this comment.
Yeah, we're not using Roxygen in this package. It doesn't make sense to sneak it into this change.
There was a problem hiding this comment.
From our conversation, this came from running devtools::document() so I could use these functions locally. I don't intend to introduce Roxygen, so this can be removed.
R/utility.R
Outdated
| #' @param minimum.number.of.colours An integer specifying the minimum number of colors required. | ||
| #' | ||
| #' @return A named vector of colors assigned to each clone. | ||
| get.clone.colours <- function(clone.colours, clone.ids, minimum.number.of.colours = 0) { |
There was a problem hiding this comment.
Is it possible to consolidate this with get.colours? I think having two different colour functions are redundant and get.colours is already used in create.cluster.heatmap and create.clone.genome.distribution.plot
There was a problem hiding this comment.
Possibly. I didn't know there was already a get.colours. I will investigate and get back to you.
645bb85 to
1905cd8
Compare
1905cd8 to
1088f5b
Compare
|
@aholmes I updated |
a28bdc2 to
3c9d080
Compare
…uclahs-cds/package-CancerEvolutionVisualization into aholmes-add-clone-color-methods
These methods are used to generate a sequence of colors, maintaining an optional sequence of colors in the same order specified.
This means, for example, a sequence of 4 clone IDs
c('a','b','c','d')and 2 colorsc('red', 'black'), will return a new vectorc(a='red', b='black', c='random color', d='random color').See example usage.
get.clone.coloursandget.clone.colours.in.orderdefault to returningNULLwhen no sequence of initial colors are specified. This allows developers to pass the color result straight into BPG, allowing it to select colors itself, without requiring a check forNULLor some other odd color values.