Skip to content

Commit

Permalink
Minor bug with colours
Browse files Browse the repository at this point in the history
  • Loading branch information
andreaskapou committed Nov 16, 2022
1 parent ea64e79 commit 0318edd
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions R/analysis.R
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,11 @@ cluster_analysis <- function(
}
names(col_pal) <- levels(seu$condition)
} else {
col_pal <- discrete_col_pal
if (nlevels(seu$condition) > 35) {
col_pal <- scales::hue_pal()(nlevels(seu$condition))
} else {
col_pal <- discrete_col_pal
}
}
cl_condition <- seu@meta.data |> dplyr::group_by(seurat_clusters, condition) |>
dplyr::summarise(n = dplyr::n()) |> dplyr::mutate(freq = n / sum(n))
Expand Down Expand Up @@ -643,7 +647,11 @@ cluster_analysis <- function(
}
names(col_pal) <- levels(seu$sample)
} else {
col_pal <- discrete_col_pal
if (nlevels(seu$sample) > 35) {
col_pal <- scales::hue_pal()(nlevels(seu$sample))
} else {
col_pal <- discrete_col_pal
}
}

cl_condition <- seu@meta.data |> dplyr::group_by(seurat_clusters, sample) |>
Expand Down

0 comments on commit 0318edd

Please sign in to comment.