Skip to content

Commit

Permalink
Now the named lists in do_DotPlot are plotted in the right order.
Browse files Browse the repository at this point in the history
  • Loading branch information
enblacar committed Aug 21, 2024
1 parent faa14b0 commit ebc5e86
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions R/do_DotPlot.R
Original file line number Diff line number Diff line change
Expand Up @@ -270,10 +270,11 @@ do_DotPlot <- function(sample,
# Get the length of the longest list.
max_len <- max(lengths(features.use))
# Get a padded list
df.map <- as.data.frame(lapply(features.use, function(x) c(x, rep(NA, max_len - length(x))))) %>%
df.map <- as.data.frame(lapply(features.use, function(x) c(x, rep(NA, max_len - length(x)))), check.names = FALSE) %>%
tidyr::pivot_longer(cols = dplyr::everything(),
names_to = "Name",
values_to = "Gene")
values_to = "Gene") %>%
dplyr::mutate("Name" = factor(.data$Name, levels = names(features)))


features.use <- unique(unlist(unname(features)))[!duplicated(unique(unlist(unname(features))))]
Expand Down

0 comments on commit ebc5e86

Please sign in to comment.