diff --git a/R/bio/diffex_commons.R b/R/bio/diffex_commons.R index 4e5c230e38132744cd67a7014242a614b9f3b0aa..b63d5aff4aad06108ae1fcb2de76e32e82e740da 100644 --- a/R/bio/diffex_commons.R +++ b/R/bio/diffex_commons.R @@ -32,6 +32,20 @@ guess_mart <- function(gene_id){ stop(paste("could not guess mart from ", an_id)) } } + +guess_pathview_species <- function(gene_id){ + an_id <-gene_id[1] + + if(str_detect(an_id, "ENSMUSG")){ + return("mmu") + }else if(str_detect(an_id, "ENSDARG")){ + return("dre") + }else if(str_detect(an_id, "ENSG")){ + return("hsa") + }else{ + stop(paste("could not guess mart from ", an_id)) + } +} #guess_mart("ENSCAFG00000000043") diff --git a/R/ggplot_commons.R b/R/ggplot_commons.R index a699dcdc6e244a4bb533b8c5e94a7944d1cfc14d..1f8159f0b54cfd7ea9f89e96e74b33b4e1b2deaf 100644 --- a/R/ggplot_commons.R +++ b/R/ggplot_commons.R @@ -149,7 +149,7 @@ makePcaPlot <- function(x = getData(), group = NA, items=rownames(x), title = "" ### Base-plot utils -plotPDF <- function(filename, expr){ pdf(paste0(filename, ".pdf")); expr; dev.off(); } +plotPDF <- function(fileBaseName, expr, ...){ pdf(paste0(fileBaseName, ".pdf"), ...); expr; dev.off(); } #plotPDF("test", plot(1:10))