File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -123,6 +123,9 @@ sanitize_datatable <- function(df, ...) {
123
123
# This code will load from bcbio or nf-core folder
124
124
# NOTE make sure to set numerator and denominator
125
125
coldata <- load_coldata(coldata_fn)
126
+ # Change this line to change the levels to the desired order.
127
+ # It will affect downstream colors in plots.
128
+ coldata[[factor_of_interest]] <- as.factor(coldata[[factor_of_interest]])
126
129
coldata$sample <- row.names(coldata)
127
130
128
131
counts <- load_counts(counts_fn)
@@ -470,7 +473,7 @@ colma <- colma[rownames(vst_cor), ]
470
473
colma <- colma %>% dplyr::select(.data[[factor_of_interest]])
471
474
anno_colors <- lapply(colnames(colma), function(c) {
472
475
l.col <- grafify:::graf_palettes[["kelly"]][1:length(unique(colma[[c]]))]
473
- names(l.col) <- unique (colma[[c]])
476
+ names(l.col) <- levels (colma[[c]])
474
477
l.col
475
478
})
476
479
names(anno_colors) <- colnames(colma)
You can’t perform that action at this time.
0 commit comments