sample_annotation_to_colors {proBatch} | R Documentation

## Generate colors for sample annotation

### Description

Convert the sample annotation data frame to list of colors the list is named as columns included to use in potting functions

### Usage

    sample_annotation_to_colors(sample_annotation,
      columns_for_plotting = NULL, sample_id_col = "FullRunName",
      factor_columns = c("MS_batch", "EarTag", "Strain", "Diet", "Sex"),
      not_factor_columns = "DateTime", numeric_columns = "order",
      rare_categories_to_other = TRUE, numeric_palette_type = "brewer",
      granularity = 10)

### Arguments

`sample_annotation` | data matrix with: `sample_id_col` (this can be repeated as row names) biological covariates technical covariates (batches etc)
`columns_for_plotting` | only consider these columns from sample_annotation
`sample_id_col` | name of the column in sample_annotation file, where the filenames (colnames of the data matrix are found)
`factor_columns` | columns of sample_annotation to be treated as factors. Note that factor and character columns are treated as factors by default.
`not_factor_columns` | don't treat these columns as factors. This can be used to override the default behaviour of considering factors and character columns as factors.
`numeric_columns` | columns of sample_annotation to be treated as continuous numeric values.
`rare_categories_to_other` | if True rare categories will be merged as 'other'
`numeric_palette_type` | palette to be used for numeric values coloring
`granularity` | number of colors to map to the number vector (equally spaced between minimum and maximum)

### Value

list of colors

### Examples

    color_scheme <- sample_annotation_to_colors (example_sample_annotation,
    factor_columns = c('MS_batch','EarTag', "Strain",
    "Diet", "digestion_batch", "Sex"),
    not_factor_columns = 'DateTime',
    numeric_columns = c('order'))

[Package proBatch version 1.0.0 Index]