From 031f10a1722d7a34c245e7d7dd48dfdb00aa0514 Mon Sep 17 00:00:00 2001 From: Anastasiia Hryhorzhevska Date: Mon, 11 Apr 2022 17:24:17 +0200 Subject: [PATCH] added R script for exercise 3 --- plot.R | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 plot.R diff --git a/plot.R b/plot.R new file mode 100644 index 0000000..3f502a4 --- /dev/null +++ b/plot.R @@ -0,0 +1,15 @@ +library(ggplot2) + +gene <- read.csv2(snakemake@input[[1]], dec = ",") +colnames(gene) <- "id" +gene$id <- as.numeric(gene$id) + +print(paste0("I'm plotting the file ", snakemake@wildcards[["file"]])) + +pdf(file = snakemake@output[[1]]) + +ggplot(gene, aes(x = id)) + + geom_density(alpha = .2, fill = "#FF6666") + + ggtitle(paste0("Plot "), snakemake@wildcards[["file"]]) + +dev.off() \ No newline at end of file