Commit c0483617 authored by Simon CHEVOLLEAU's avatar Simon CHEVOLLEAU 💻
Browse files

Add return_plot parameter to plotMultipleOneDimension function

parent 4cc64bc5
......@@ -414,7 +414,8 @@ plotCompressedUmapAllKit <- function(dir_path, pdf_path, desired_annots, annotCo
ggsave(paste0(dir_path, "/compressed_", pdf_path), marrangeGrob(plot_list_compressed, nrow= nrow, ncol= ncol))
}
plotMultipleOneDimension <- function(table, pseudotimes, dir_path, colors = NULL, size_point = 1, legend_title = TRUE, jitter_amount = 0.3) {
plotMultipleOneDimension <- function(table, pseudotimes, dir_path, colors = NULL, size_point = 1, legend_title = TRUE, jitter_amount = 0.3, return_plot = T) {
plots <- list()
for (gene in rownames(table)){
psdtp_list <- list(); annot_list <- list(); text_annot <- list()
......@@ -440,6 +441,8 @@ plotMultipleOneDimension <- function(table, pseudotimes, dir_path, colors = NULL
color <- NULL
}
ggsave(paste0(dir_path, "/", gene, ".pdf"), one_dimension(psdtp_list, annot_list, text_annot, gene, colors = color, size_point = 1, legend_title, jitter_amount = jitter_amount))
plots[[gene]] <- one_dimension(psdtp_list, annot_list, text_annot, gene, colors = color, size_point = 1, legend_title, jitter_amount = jitter_amount)
ggsave(paste0(dir_path, "/", gene, ".pdf"), plots[[gene]])
}
return(plots)
}
Supports Markdown
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