Commit e68a8732 authored by Bagueneau Mathias's avatar Bagueneau Mathias
Browse files

- Ajout du choix de la palette de couleur pour les plots de classes (dans visualization et compare)

- Optimisations du code (+ fonctions dans fichiers séparés)
parent ccd50e8a
This diff is collapsed.
......@@ -88,3 +88,13 @@ presets.listgenes.grid <- function(shiny_session, input.presets) {
updateSelectizeInput(shiny_session, "genes_list_grid", selected=c("CD3D","CD8A","CD4","NCAM1","FCGR3A","CD14","HLA-DRA","ITGAX","ITGAM","CD79A","CD19","MS4A1","SDC1","IRF8","IL3RA","FCER1A","HBA1"))
}
}
## Color palettes ----
color.palettes <- function(inputname) {
selectInput(inputId = as.character(inputname),
label="Choose a color palette :",
choices = list(`Ggplot` = c("Dark2", "Set1", "Set2", "Set3", "Pastel1", "Pastel2", "Paired", "Accent", "Spectral"),
`Ggpubr` = c("npg", "aaas", "lancet", "jco", "ucscgb"),
`Misc` = c("simpsons", "rickandmorty")),
selected = "npg")
}
......@@ -19,6 +19,8 @@ install.packages("RColorBrewer")
install.packages("data.table")
install.packages("devtools")
install.packages("BiocManager")
install.packages("ggpubr")
install.packages("colourpicker")
BiocManager::install("clusterProfiler")
BiocManager::install("MAST")
BiocManager::install("org.Hs.eg.db")
......
......@@ -9,11 +9,19 @@
assign.colors <- function(obj, ident, palette){
ident <- as.factor(ident)
nr.groups <- length(levels(ident))
colors <- colorRampPalette(brewer.pal(8, palette))(nr.groups)
colors <- colorRampPalette(get_palette(palette, 8))(nr.groups)
colors.df <- data.frame(group=levels(ident), color=colors)
return(colors.df)
}
## Function which use assign.colors to give a color for each group of each class ----
all.class.colors <- function(obj, palette) {
coldf <- lapply(obj@meta.data[,sapply(obj@meta.data, class) %in% c("factor","character")],
assign.colors,
obj = obj,
palette = palette)
return(coldf)
}
## Uptade Gene lists function ----
update.geneslist <- function(obj, shiny_session, genes_list, inputname, selected_choice = "IGKC") {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment