View source: R/getVariantsColors.R
getVariantsColors | R Documentation |
Given the reference and alternative for a set of variants, assigns a color to each of them
getVariantsColors(ref, alt, color.table=NULL, color.schema=c("cell21breast"))
ref |
(character vector) The reference nucleotides of the variants. It has to have the same length as |
alt |
(character vector) The alternative nucleotides of the variants. It has to have the same length as |
color.table |
(named character vector) if present, its used to assign colors to the nucleotide substitutions. |
color.schema |
(character) The name of the color schema to use: |
The function creates an nucleotide substitution identifier with for each variant and uses it to query the color.table lookup table. If color.table is NULL, a color.table based in the selected color.schema is used. All unkwonwn nucleotide substitutions are assigned a gray color. Color table needs to have entries for C>A, C>G, C>T, T>A, T>C and T>G (and optionally "others"), since other changes can be reverse complemented to these.
a named character vector with the colors associated to each variant
plotKaryotype
, kpPlotRainfall
ref <- c("A", "A", "C", "T", "G", "A")
alt <- c("G", "C", "T", "A", "A", "-")
getVariantsColors(ref, alt)
col.table <- c("C>A"="#FF0000", "C>G"="#000000", "C>T"="#00FF00", "T>A"="#0000FF", "T>C"="#BB00BB", "T>G"="#00BBBB", "other"="#888888")
getVariantsColors(ref, alt, col.table)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.