annotate small_rna_clusters.r @ 1:160e35e432a0 draft default tip

"planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit 51dc6c56c7d95fc229ffee958354211cd454fd36"
author artbio
date Sun, 09 May 2021 17:10:29 +0000
parents 8028521b6e4f
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
8028521b6e4f "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit f38805cf151cbda1cf7de0a92cdfeb5978f26547"
artbio
parents:
diff changeset
1 ## Setup R error handling to go to stderr
1
160e35e432a0 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit 51dc6c56c7d95fc229ffee958354211cd454fd36"
artbio
parents: 0
diff changeset
2 options(show.error.messages = F,
160e35e432a0 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit 51dc6c56c7d95fc229ffee958354211cd454fd36"
artbio
parents: 0
diff changeset
3 error = function() {
160e35e432a0 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit 51dc6c56c7d95fc229ffee958354211cd454fd36"
artbio
parents: 0
diff changeset
4 cat(geterrmessage(), file = stderr()); q("no", 1, F)
160e35e432a0 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit 51dc6c56c7d95fc229ffee958354211cd454fd36"
artbio
parents: 0
diff changeset
5 }
160e35e432a0 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit 51dc6c56c7d95fc229ffee958354211cd454fd36"
artbio
parents: 0
diff changeset
6 )
0
8028521b6e4f "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit f38805cf151cbda1cf7de0a92cdfeb5978f26547"
artbio
parents:
diff changeset
7 options(warn = -1)
1
160e35e432a0 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit 51dc6c56c7d95fc229ffee958354211cd454fd36"
artbio
parents: 0
diff changeset
8
0
8028521b6e4f "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit f38805cf151cbda1cf7de0a92cdfeb5978f26547"
artbio
parents:
diff changeset
9 library(RColorBrewer)
8028521b6e4f "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit f38805cf151cbda1cf7de0a92cdfeb5978f26547"
artbio
parents:
diff changeset
10 library(lattice)
8028521b6e4f "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit f38805cf151cbda1cf7de0a92cdfeb5978f26547"
artbio
parents:
diff changeset
11 library(latticeExtra)
8028521b6e4f "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit f38805cf151cbda1cf7de0a92cdfeb5978f26547"
artbio
parents:
diff changeset
12 library(grid)
8028521b6e4f "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit f38805cf151cbda1cf7de0a92cdfeb5978f26547"
artbio
parents:
diff changeset
13 library(gridExtra)
8028521b6e4f "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit f38805cf151cbda1cf7de0a92cdfeb5978f26547"
artbio
parents:
diff changeset
14 library(optparse)
8028521b6e4f "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit f38805cf151cbda1cf7de0a92cdfeb5978f26547"
artbio
parents:
diff changeset
15
8028521b6e4f "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit f38805cf151cbda1cf7de0a92cdfeb5978f26547"
artbio
parents:
diff changeset
16 option_list <- list(
1
160e35e432a0 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit 51dc6c56c7d95fc229ffee958354211cd454fd36"
artbio
parents: 0
diff changeset
17 make_option(c("-f", "--first_dataframe"), type = "character", help = "path to first dataframe"),
160e35e432a0 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit 51dc6c56c7d95fc229ffee958354211cd454fd36"
artbio
parents: 0
diff changeset
18 make_option("--first_plot_method", type = "character", help = "How additional data should be plotted"),
160e35e432a0 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit 51dc6c56c7d95fc229ffee958354211cd454fd36"
artbio
parents: 0
diff changeset
19 make_option("--output_pdf", type = "character", help = "path to the pdf file with plots")
0
8028521b6e4f "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit f38805cf151cbda1cf7de0a92cdfeb5978f26547"
artbio
parents:
diff changeset
20 )
8028521b6e4f "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit f38805cf151cbda1cf7de0a92cdfeb5978f26547"
artbio
parents:
diff changeset
21
8028521b6e4f "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit f38805cf151cbda1cf7de0a92cdfeb5978f26547"
artbio
parents:
diff changeset
22 parser <- OptionParser(usage = "%prog [options] file", option_list = option_list)
1
160e35e432a0 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit 51dc6c56c7d95fc229ffee958354211cd454fd36"
artbio
parents: 0
diff changeset
23 args <- parse_args(parser)
0
8028521b6e4f "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit f38805cf151cbda1cf7de0a92cdfeb5978f26547"
artbio
parents:
diff changeset
24
8028521b6e4f "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit f38805cf151cbda1cf7de0a92cdfeb5978f26547"
artbio
parents:
diff changeset
25 # data frames implementation
8028521b6e4f "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit f38805cf151cbda1cf7de0a92cdfeb5978f26547"
artbio
parents:
diff changeset
26
8028521b6e4f "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit f38805cf151cbda1cf7de0a92cdfeb5978f26547"
artbio
parents:
diff changeset
27 ## first table
1
160e35e432a0 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit 51dc6c56c7d95fc229ffee958354211cd454fd36"
artbio
parents: 0
diff changeset
28 table <- read.delim(args$first_dataframe, header = T, row.names = NULL)
160e35e432a0 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit 51dc6c56c7d95fc229ffee958354211cd454fd36"
artbio
parents: 0
diff changeset
29 colnames(table)[1] <- "Dataset"
0
8028521b6e4f "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit f38805cf151cbda1cf7de0a92cdfeb5978f26547"
artbio
parents:
diff changeset
30 dropcol <- c("Strandness", "z.score") # not used by this Rscript and is dropped for backward compatibility
1
160e35e432a0 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit 51dc6c56c7d95fc229ffee958354211cd454fd36"
artbio
parents: 0
diff changeset
31 table <- table[, !(names(table) %in% dropcol)]
0
8028521b6e4f "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit f38805cf151cbda1cf7de0a92cdfeb5978f26547"
artbio
parents:
diff changeset
32 if (args$first_plot_method == "Counts" | args$first_plot_method == "Size") {
1
160e35e432a0 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit 51dc6c56c7d95fc229ffee958354211cd454fd36"
artbio
parents: 0
diff changeset
33 table <- within(table, Counts[Polarity == "R"] <- (Counts[Polarity == "R"] * -1))
0
8028521b6e4f "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit f38805cf151cbda1cf7de0a92cdfeb5978f26547"
artbio
parents:
diff changeset
34 }
1
160e35e432a0 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit 51dc6c56c7d95fc229ffee958354211cd454fd36"
artbio
parents: 0
diff changeset
35 n_samples <- length(unique(table$Dataset))
160e35e432a0 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit 51dc6c56c7d95fc229ffee958354211cd454fd36"
artbio
parents: 0
diff changeset
36 samples <- unique(table$Dataset)
160e35e432a0 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit 51dc6c56c7d95fc229ffee958354211cd454fd36"
artbio
parents: 0
diff changeset
37 genes <- unique(table$Chromosome)
160e35e432a0 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit 51dc6c56c7d95fc229ffee958354211cd454fd36"
artbio
parents: 0
diff changeset
38 per_gene_readmap <- lapply(genes, function(x) subset(table, Chromosome == x))
160e35e432a0 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit 51dc6c56c7d95fc229ffee958354211cd454fd36"
artbio
parents: 0
diff changeset
39 per_gene_limit <- lapply(genes, function(x) c(1, unique(subset(table, Chromosome == x)$Chrom_length)))
160e35e432a0 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit 51dc6c56c7d95fc229ffee958354211cd454fd36"
artbio
parents: 0
diff changeset
40 n_genes <- length(per_gene_readmap)
0
8028521b6e4f "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit f38805cf151cbda1cf7de0a92cdfeb5978f26547"
artbio
parents:
diff changeset
41
8028521b6e4f "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit f38805cf151cbda1cf7de0a92cdfeb5978f26547"
artbio
parents:
diff changeset
42 ## functions
1
160e35e432a0 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit 51dc6c56c7d95fc229ffee958354211cd454fd36"
artbio
parents: 0
diff changeset
43 plot_unit <- function(df, method = args$first_plot_method, ...) {
160e35e432a0 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit 51dc6c56c7d95fc229ffee958354211cd454fd36"
artbio
parents: 0
diff changeset
44 p <- xyplot(Counts ~ Coordinate | factor(Dataset, levels = unique(Dataset)) + factor(Chromosome, levels = unique(Chromosome)),
160e35e432a0 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit 51dc6c56c7d95fc229ffee958354211cd454fd36"
artbio
parents: 0
diff changeset
45 data = df,
160e35e432a0 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit 51dc6c56c7d95fc229ffee958354211cd454fd36"
artbio
parents: 0
diff changeset
46 type = "h",
160e35e432a0 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit 51dc6c56c7d95fc229ffee958354211cd454fd36"
artbio
parents: 0
diff changeset
47 lwd = 1.5,
160e35e432a0 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit 51dc6c56c7d95fc229ffee958354211cd454fd36"
artbio
parents: 0
diff changeset
48 scales = list(relation = "free", x = list(rot = 0, cex = 0.7, axs = "i", tck = 0.5), y = list(tick.number = 4, rot = 90, cex = 0.7)),
160e35e432a0 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit 51dc6c56c7d95fc229ffee958354211cd454fd36"
artbio
parents: 0
diff changeset
49 xlab = NULL, main = NULL, ylab = NULL,
160e35e432a0 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit 51dc6c56c7d95fc229ffee958354211cd454fd36"
artbio
parents: 0
diff changeset
50 as.table = T,
0
8028521b6e4f "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit f38805cf151cbda1cf7de0a92cdfeb5978f26547"
artbio
parents:
diff changeset
51 origin = 0,
1
160e35e432a0 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit 51dc6c56c7d95fc229ffee958354211cd454fd36"
artbio
parents: 0
diff changeset
52 horizontal = FALSE,
160e35e432a0 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit 51dc6c56c7d95fc229ffee958354211cd454fd36"
artbio
parents: 0
diff changeset
53 group = Polarity,
160e35e432a0 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit 51dc6c56c7d95fc229ffee958354211cd454fd36"
artbio
parents: 0
diff changeset
54 col = c("red", "blue"),
160e35e432a0 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit 51dc6c56c7d95fc229ffee958354211cd454fd36"
artbio
parents: 0
diff changeset
55 par.strip.text = list(cex = 0.7),
0
8028521b6e4f "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit f38805cf151cbda1cf7de0a92cdfeb5978f26547"
artbio
parents:
diff changeset
56 ...)
1
160e35e432a0 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit 51dc6c56c7d95fc229ffee958354211cd454fd36"
artbio
parents: 0
diff changeset
57 p <- combineLimits(p)
0
8028521b6e4f "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit f38805cf151cbda1cf7de0a92cdfeb5978f26547"
artbio
parents:
diff changeset
58 }
8028521b6e4f "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit f38805cf151cbda1cf7de0a92cdfeb5978f26547"
artbio
parents:
diff changeset
59
8028521b6e4f "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit f38805cf151cbda1cf7de0a92cdfeb5978f26547"
artbio
parents:
diff changeset
60 ## function parameters
1
160e35e432a0 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit 51dc6c56c7d95fc229ffee958354211cd454fd36"
artbio
parents: 0
diff changeset
61 par_settings_firstplot <- list(layout.heights = list(top.padding = -2, bottom.padding = -2), strip.background = list(col = c("lightblue", "lightgreen")))
160e35e432a0 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit 51dc6c56c7d95fc229ffee958354211cd454fd36"
artbio
parents: 0
diff changeset
62 title_first_method <- list(Counts = "Read Counts", Coverage = "Coverage depths", Median = "Median sizes", Mean = "Mean sizes", Size = "Size Distributions")
160e35e432a0 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit 51dc6c56c7d95fc229ffee958354211cd454fd36"
artbio
parents: 0
diff changeset
63 legend_first_method <- list(Counts = "Read count", Coverage = "Coverage depth", Median = "Median size", Mean = "Mean size", Size = "Read count")
160e35e432a0 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit 51dc6c56c7d95fc229ffee958354211cd454fd36"
artbio
parents: 0
diff changeset
64 bottom_first_method <- list(Counts = "Coordinates (nucleotides)", Coverage = "Coordinates (nucleotides)", Median = "Coordinates (nucleotides)", Mean = "Coordinates (nucleotides)", Size = "Sizes of reads")
0
8028521b6e4f "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit f38805cf151cbda1cf7de0a92cdfeb5978f26547"
artbio
parents:
diff changeset
65
8028521b6e4f "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit f38805cf151cbda1cf7de0a92cdfeb5978f26547"
artbio
parents:
diff changeset
66 ## Plotting Functions
8028521b6e4f "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit f38805cf151cbda1cf7de0a92cdfeb5978f26547"
artbio
parents:
diff changeset
67 single_plot <- function(...) {
1
160e35e432a0 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit 51dc6c56c7d95fc229ffee958354211cd454fd36"
artbio
parents: 0
diff changeset
68 width <- 8.2677 * n_samples / 2
160e35e432a0 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit 51dc6c56c7d95fc229ffee958354211cd454fd36"
artbio
parents: 0
diff changeset
69 rows_per_page <- 8
160e35e432a0 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit 51dc6c56c7d95fc229ffee958354211cd454fd36"
artbio
parents: 0
diff changeset
70 graph_heights <- c(rep(40, 8), 10)
160e35e432a0 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit 51dc6c56c7d95fc229ffee958354211cd454fd36"
artbio
parents: 0
diff changeset
71 pdf(file = args$output_pdf, paper = "special", height = 15, width = width)
160e35e432a0 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit 51dc6c56c7d95fc229ffee958354211cd454fd36"
artbio
parents: 0
diff changeset
72 for (i in seq(1, n_genes, rows_per_page)) {
160e35e432a0 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit 51dc6c56c7d95fc229ffee958354211cd454fd36"
artbio
parents: 0
diff changeset
73 start <- i
160e35e432a0 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit 51dc6c56c7d95fc229ffee958354211cd454fd36"
artbio
parents: 0
diff changeset
74 end <- i + rows_per_page - 1
160e35e432a0 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit 51dc6c56c7d95fc229ffee958354211cd454fd36"
artbio
parents: 0
diff changeset
75 if (end > n_genes) {
160e35e432a0 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit 51dc6c56c7d95fc229ffee958354211cd454fd36"
artbio
parents: 0
diff changeset
76 end <- n_genes
160e35e432a0 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit 51dc6c56c7d95fc229ffee958354211cd454fd36"
artbio
parents: 0
diff changeset
77 }
160e35e432a0 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit 51dc6c56c7d95fc229ffee958354211cd454fd36"
artbio
parents: 0
diff changeset
78 if (end - start + 1 < 8) {
160e35e432a0 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit 51dc6c56c7d95fc229ffee958354211cd454fd36"
artbio
parents: 0
diff changeset
79 graph_heights <- c(rep(c(40), end - start + 1), 10, rep(c(40), 8 - (end - start + 1)))
160e35e432a0 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit 51dc6c56c7d95fc229ffee958354211cd454fd36"
artbio
parents: 0
diff changeset
80 }
160e35e432a0 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit 51dc6c56c7d95fc229ffee958354211cd454fd36"
artbio
parents: 0
diff changeset
81 first_plot_list <- lapply(per_gene_readmap[start:end], function(x) update(useOuterStrips(plot_unit(x, par.settings = par_settings_firstplot), strip.left = strip.custom(par.strip.text = list(cex = 0.5)))))
160e35e432a0 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit 51dc6c56c7d95fc229ffee958354211cd454fd36"
artbio
parents: 0
diff changeset
82 plot.list <- rbind(first_plot_list)
160e35e432a0 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit 51dc6c56c7d95fc229ffee958354211cd454fd36"
artbio
parents: 0
diff changeset
83 args_list <- c(plot.list, list(nrow = rows_per_page + 1, ncol = 1, heights = unit(graph_heights, rep("mm", 9)),
160e35e432a0 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit 51dc6c56c7d95fc229ffee958354211cd454fd36"
artbio
parents: 0
diff changeset
84 top = textGrob("Cluster Read Counts (Peaks in middle of clusters)", gp = gpar(cex = 1), vjust = 0, just = "top"),
160e35e432a0 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit 51dc6c56c7d95fc229ffee958354211cd454fd36"
artbio
parents: 0
diff changeset
85 left = textGrob("Read Counts", gp = gpar(cex = 1), vjust = 0, hjust = 0, x = 1, y = (-0.41 / 7) * (end - start - (6.23 / 0.41)), rot = 90),
160e35e432a0 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit 51dc6c56c7d95fc229ffee958354211cd454fd36"
artbio
parents: 0
diff changeset
86 sub = textGrob("Coordinates (nucleotides)", gp = gpar(cex = 1), just = "bottom", vjust = 2)
0
8028521b6e4f "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit f38805cf151cbda1cf7de0a92cdfeb5978f26547"
artbio
parents:
diff changeset
87 )
8028521b6e4f "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit f38805cf151cbda1cf7de0a92cdfeb5978f26547"
artbio
parents:
diff changeset
88 )
8028521b6e4f "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit f38805cf151cbda1cf7de0a92cdfeb5978f26547"
artbio
parents:
diff changeset
89 do.call(grid.arrange, args_list)
8028521b6e4f "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit f38805cf151cbda1cf7de0a92cdfeb5978f26547"
artbio
parents:
diff changeset
90 }
1
160e35e432a0 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit 51dc6c56c7d95fc229ffee958354211cd454fd36"
artbio
parents: 0
diff changeset
91 devname <- dev.off()
0
8028521b6e4f "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit f38805cf151cbda1cf7de0a92cdfeb5978f26547"
artbio
parents:
diff changeset
92 }
8028521b6e4f "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit f38805cf151cbda1cf7de0a92cdfeb5978f26547"
artbio
parents:
diff changeset
93
8028521b6e4f "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit f38805cf151cbda1cf7de0a92cdfeb5978f26547"
artbio
parents:
diff changeset
94 # main
8028521b6e4f "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_clusters commit f38805cf151cbda1cf7de0a92cdfeb5978f26547"
artbio
parents:
diff changeset
95 single_plot()