annotate signature.r @ 11:8d3ca9652a5b draft

"planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 8691f2575cacd71c971338658198a1324e5f9370"
author artbio
date Sat, 23 Oct 2021 22:55:19 +0000
parents a35e6f9c1d34
children aa5e2c64dff8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a35e6f9c1d34 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 6719543c5017d581ae012b864d7c9088f0767fc8
artbio
parents:
diff changeset
1 ## Setup R error handling to go to stderr
11
8d3ca9652a5b "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 8691f2575cacd71c971338658198a1324e5f9370"
artbio
parents: 0
diff changeset
2 options(show.error.messages = F,
8d3ca9652a5b "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 8691f2575cacd71c971338658198a1324e5f9370"
artbio
parents: 0
diff changeset
3 error = function() {
8d3ca9652a5b "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 8691f2575cacd71c971338658198a1324e5f9370"
artbio
parents: 0
diff changeset
4 cat(geterrmessage(), file = stderr())
8d3ca9652a5b "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 8691f2575cacd71c971338658198a1324e5f9370"
artbio
parents: 0
diff changeset
5 q("no", 1, F)
8d3ca9652a5b "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 8691f2575cacd71c971338658198a1324e5f9370"
artbio
parents: 0
diff changeset
6 }
8d3ca9652a5b "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 8691f2575cacd71c971338658198a1324e5f9370"
artbio
parents: 0
diff changeset
7 )
0
a35e6f9c1d34 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 6719543c5017d581ae012b864d7c9088f0767fc8
artbio
parents:
diff changeset
8 warnings()
a35e6f9c1d34 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 6719543c5017d581ae012b864d7c9088f0767fc8
artbio
parents:
diff changeset
9
a35e6f9c1d34 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 6719543c5017d581ae012b864d7c9088f0767fc8
artbio
parents:
diff changeset
10 library(RColorBrewer)
a35e6f9c1d34 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 6719543c5017d581ae012b864d7c9088f0767fc8
artbio
parents:
diff changeset
11 library(lattice)
a35e6f9c1d34 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 6719543c5017d581ae012b864d7c9088f0767fc8
artbio
parents:
diff changeset
12 library(latticeExtra)
a35e6f9c1d34 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 6719543c5017d581ae012b864d7c9088f0767fc8
artbio
parents:
diff changeset
13 library(grid)
a35e6f9c1d34 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 6719543c5017d581ae012b864d7c9088f0767fc8
artbio
parents:
diff changeset
14 library(gridExtra)
a35e6f9c1d34 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 6719543c5017d581ae012b864d7c9088f0767fc8
artbio
parents:
diff changeset
15 library(optparse)
a35e6f9c1d34 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 6719543c5017d581ae012b864d7c9088f0767fc8
artbio
parents:
diff changeset
16
a35e6f9c1d34 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 6719543c5017d581ae012b864d7c9088f0767fc8
artbio
parents:
diff changeset
17 option_list <- list(
11
8d3ca9652a5b "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 8691f2575cacd71c971338658198a1324e5f9370"
artbio
parents: 0
diff changeset
18 make_option("--h_dataframe", type = "character",
8d3ca9652a5b "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 8691f2575cacd71c971338658198a1324e5f9370"
artbio
parents: 0
diff changeset
19 help = "path to h-signature dataframe"),
8d3ca9652a5b "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 8691f2575cacd71c971338658198a1324e5f9370"
artbio
parents: 0
diff changeset
20 make_option("--z_dataframe", type = "character",
8d3ca9652a5b "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 8691f2575cacd71c971338658198a1324e5f9370"
artbio
parents: 0
diff changeset
21 help = "path to z-signature dataframe"),
8d3ca9652a5b "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 8691f2575cacd71c971338658198a1324e5f9370"
artbio
parents: 0
diff changeset
22 make_option("--plot_method", type = "character",
8d3ca9652a5b "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 8691f2575cacd71c971338658198a1324e5f9370"
artbio
parents: 0
diff changeset
23 help = "How data should be plotted (global or lattice)"),
8d3ca9652a5b "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 8691f2575cacd71c971338658198a1324e5f9370"
artbio
parents: 0
diff changeset
24 make_option("--pdf", type = "character", help = "path to the pdf file with plots"),
8d3ca9652a5b "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 8691f2575cacd71c971338658198a1324e5f9370"
artbio
parents: 0
diff changeset
25 make_option("--title", type = "character", help = "Graph Title")
0
a35e6f9c1d34 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 6719543c5017d581ae012b864d7c9088f0767fc8
artbio
parents:
diff changeset
26 )
a35e6f9c1d34 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 6719543c5017d581ae012b864d7c9088f0767fc8
artbio
parents:
diff changeset
27 parser <- OptionParser(usage = "%prog [options] file", option_list = option_list)
11
8d3ca9652a5b "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 8691f2575cacd71c971338658198a1324e5f9370"
artbio
parents: 0
diff changeset
28 args <- parse_args(parser)
0
a35e6f9c1d34 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 6719543c5017d581ae012b864d7c9088f0767fc8
artbio
parents:
diff changeset
29
a35e6f9c1d34 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 6719543c5017d581ae012b864d7c9088f0767fc8
artbio
parents:
diff changeset
30 # data frames implementation
11
8d3ca9652a5b "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 8691f2575cacd71c971338658198a1324e5f9370"
artbio
parents: 0
diff changeset
31 h_dataframe <- read.delim(args$h_dataframe, header = F)
8d3ca9652a5b "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 8691f2575cacd71c971338658198a1324e5f9370"
artbio
parents: 0
diff changeset
32 colnames(h_dataframe) <- c("chrom", "overlap", "sig", "z-score")
8d3ca9652a5b "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 8691f2575cacd71c971338658198a1324e5f9370"
artbio
parents: 0
diff changeset
33 h_dataframe$sig <- h_dataframe$sig * 100 # to get probs in %
8d3ca9652a5b "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 8691f2575cacd71c971338658198a1324e5f9370"
artbio
parents: 0
diff changeset
34 z_dataframe <- read.delim(args$z_dataframe, header = F)
8d3ca9652a5b "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 8691f2575cacd71c971338658198a1324e5f9370"
artbio
parents: 0
diff changeset
35 colnames(z_dataframe) <- c("chrom", "overlap", "sig", "z-score")
0
a35e6f9c1d34 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 6719543c5017d581ae012b864d7c9088f0767fc8
artbio
parents:
diff changeset
36
a35e6f9c1d34 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 6719543c5017d581ae012b864d7c9088f0767fc8
artbio
parents:
diff changeset
37 # functions
11
8d3ca9652a5b "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 8691f2575cacd71c971338658198a1324e5f9370"
artbio
parents: 0
diff changeset
38 globalgraph <- function() {
0
a35e6f9c1d34 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 6719543c5017d581ae012b864d7c9088f0767fc8
artbio
parents:
diff changeset
39 pdf(args$pdf)
11
8d3ca9652a5b "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 8691f2575cacd71c971338658198a1324e5f9370"
artbio
parents: 0
diff changeset
40 par(mfrow = c(2, 2), oma = c(0, 0, 3, 0))
8d3ca9652a5b "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 8691f2575cacd71c971338658198a1324e5f9370"
artbio
parents: 0
diff changeset
41 plot(z_dataframe[z_dataframe$chrom == "all_chromosomes", c(2, 3)],
8d3ca9652a5b "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 8691f2575cacd71c971338658198a1324e5f9370"
artbio
parents: 0
diff changeset
42 type = "h", main = "Numbers of pairs", cex.main = 1, xlab = "overlap (nt)",
8d3ca9652a5b "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 8691f2575cacd71c971338658198a1324e5f9370"
artbio
parents: 0
diff changeset
43 ylab = "Numbers of pairs", col = "darkslateblue", lwd = 4)
0
a35e6f9c1d34 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 6719543c5017d581ae012b864d7c9088f0767fc8
artbio
parents:
diff changeset
44
11
8d3ca9652a5b "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 8691f2575cacd71c971338658198a1324e5f9370"
artbio
parents: 0
diff changeset
45 plot(z_dataframe[z_dataframe$chrom == "all_chromosomes", c(2, 4)],
8d3ca9652a5b "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 8691f2575cacd71c971338658198a1324e5f9370"
artbio
parents: 0
diff changeset
46 type = "l", main = "Number of pairs Z-scores", cex.main = 1, xlab = "overlap (nt)",
8d3ca9652a5b "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 8691f2575cacd71c971338658198a1324e5f9370"
artbio
parents: 0
diff changeset
47 ylab = "z-score", pch = 19, cex = 0.2, col = "darkslateblue", lwd = 2)
0
a35e6f9c1d34 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 6719543c5017d581ae012b864d7c9088f0767fc8
artbio
parents:
diff changeset
48
11
8d3ca9652a5b "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 8691f2575cacd71c971338658198a1324e5f9370"
artbio
parents: 0
diff changeset
49 plot(h_dataframe[h_dataframe$chrom == "all_chromosomes", c(2, 3)],
8d3ca9652a5b "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 8691f2575cacd71c971338658198a1324e5f9370"
artbio
parents: 0
diff changeset
50 type = "l", main = "Overlap probabilities", cex.main = 1,
8d3ca9652a5b "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 8691f2575cacd71c971338658198a1324e5f9370"
artbio
parents: 0
diff changeset
51 xlab = "overlap (nt)",
8d3ca9652a5b "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 8691f2575cacd71c971338658198a1324e5f9370"
artbio
parents: 0
diff changeset
52 ylab = "Probability [%]", ylim = c(0, 50), pch = 19,
8d3ca9652a5b "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 8691f2575cacd71c971338658198a1324e5f9370"
artbio
parents: 0
diff changeset
53 col = "darkslateblue", lwd = 2)
0
a35e6f9c1d34 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 6719543c5017d581ae012b864d7c9088f0767fc8
artbio
parents:
diff changeset
54
11
8d3ca9652a5b "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 8691f2575cacd71c971338658198a1324e5f9370"
artbio
parents: 0
diff changeset
55 plot(h_dataframe[h_dataframe$chrom == "all_chromosomes", c(2, 4)],
8d3ca9652a5b "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 8691f2575cacd71c971338658198a1324e5f9370"
artbio
parents: 0
diff changeset
56 type = "l", main = "Overlap Probability Z-scores", cex.main = 1,
8d3ca9652a5b "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 8691f2575cacd71c971338658198a1324e5f9370"
artbio
parents: 0
diff changeset
57 xlab = "overlap (nt)", ylab = "z-score", pch = 19, cex = 0.2,
8d3ca9652a5b "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 8691f2575cacd71c971338658198a1324e5f9370"
artbio
parents: 0
diff changeset
58 col = "darkslateblue", lwd = 2)
8d3ca9652a5b "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 8691f2575cacd71c971338658198a1324e5f9370"
artbio
parents: 0
diff changeset
59 mtext(args$title, outer = TRUE, cex = 1)
0
a35e6f9c1d34 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 6719543c5017d581ae012b864d7c9088f0767fc8
artbio
parents:
diff changeset
60 dev.off()
11
8d3ca9652a5b "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 8691f2575cacd71c971338658198a1324e5f9370"
artbio
parents: 0
diff changeset
61 }
0
a35e6f9c1d34 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 6719543c5017d581ae012b864d7c9088f0767fc8
artbio
parents:
diff changeset
62
11
8d3ca9652a5b "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 8691f2575cacd71c971338658198a1324e5f9370"
artbio
parents: 0
diff changeset
63 treillisgraph <- function(df, ...) {
8d3ca9652a5b "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 8691f2575cacd71c971338658198a1324e5f9370"
artbio
parents: 0
diff changeset
64 pdf(args$pdf, paper = "special", height = 11.69, width = 6)
8d3ca9652a5b "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 8691f2575cacd71c971338658198a1324e5f9370"
artbio
parents: 0
diff changeset
65 p <- xyplot(sig ~ overlap | factor(method, levels = unique(method)) + chrom,
8d3ca9652a5b "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 8691f2575cacd71c971338658198a1324e5f9370"
artbio
parents: 0
diff changeset
66 data = df,
0
a35e6f9c1d34 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 6719543c5017d581ae012b864d7c9088f0767fc8
artbio
parents:
diff changeset
67 type = "l",
11
8d3ca9652a5b "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 8691f2575cacd71c971338658198a1324e5f9370"
artbio
parents: 0
diff changeset
68 col = "darkblue",
8d3ca9652a5b "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 8691f2575cacd71c971338658198a1324e5f9370"
artbio
parents: 0
diff changeset
69 cex = 0.5,
8d3ca9652a5b "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 8691f2575cacd71c971338658198a1324e5f9370"
artbio
parents: 0
diff changeset
70 scales = list(y = list(tick.number = 4, relation = "free", cex = 0.6,
8d3ca9652a5b "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 8691f2575cacd71c971338658198a1324e5f9370"
artbio
parents: 0
diff changeset
71 rot = 0),
8d3ca9652a5b "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 8691f2575cacd71c971338658198a1324e5f9370"
artbio
parents: 0
diff changeset
72 x = list(cex = 0.6, alternating = FALSE)),
0
a35e6f9c1d34 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 6719543c5017d581ae012b864d7c9088f0767fc8
artbio
parents:
diff changeset
73 xlab = "Overlap",
a35e6f9c1d34 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 6719543c5017d581ae012b864d7c9088f0767fc8
artbio
parents:
diff changeset
74 ylab = "signature (Nbr of pairs / Overlap prob.)",
a35e6f9c1d34 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 6719543c5017d581ae012b864d7c9088f0767fc8
artbio
parents:
diff changeset
75 main = args$title,
11
8d3ca9652a5b "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 8691f2575cacd71c971338658198a1324e5f9370"
artbio
parents: 0
diff changeset
76 par.strip.text = list(cex = .5),
8d3ca9652a5b "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 8691f2575cacd71c971338658198a1324e5f9370"
artbio
parents: 0
diff changeset
77 pch = 19, lwd = 2,
8d3ca9652a5b "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 8691f2575cacd71c971338658198a1324e5f9370"
artbio
parents: 0
diff changeset
78 as.table = TRUE,
8d3ca9652a5b "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 8691f2575cacd71c971338658198a1324e5f9370"
artbio
parents: 0
diff changeset
79 layout = c(2, 12),
0
a35e6f9c1d34 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 6719543c5017d581ae012b864d7c9088f0767fc8
artbio
parents:
diff changeset
80 newpage = T,
a35e6f9c1d34 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 6719543c5017d581ae012b864d7c9088f0767fc8
artbio
parents:
diff changeset
81 ...)
11
8d3ca9652a5b "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 8691f2575cacd71c971338658198a1324e5f9370"
artbio
parents: 0
diff changeset
82 plot(p)
0
a35e6f9c1d34 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 6719543c5017d581ae012b864d7c9088f0767fc8
artbio
parents:
diff changeset
83 dev.off()
11
8d3ca9652a5b "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 8691f2575cacd71c971338658198a1324e5f9370"
artbio
parents: 0
diff changeset
84 }
0
a35e6f9c1d34 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 6719543c5017d581ae012b864d7c9088f0767fc8
artbio
parents:
diff changeset
85
a35e6f9c1d34 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 6719543c5017d581ae012b864d7c9088f0767fc8
artbio
parents:
diff changeset
86 # main
a35e6f9c1d34 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 6719543c5017d581ae012b864d7c9088f0767fc8
artbio
parents:
diff changeset
87
11
8d3ca9652a5b "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 8691f2575cacd71c971338658198a1324e5f9370"
artbio
parents: 0
diff changeset
88 if (args$plot_method == "global") {
0
a35e6f9c1d34 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 6719543c5017d581ae012b864d7c9088f0767fc8
artbio
parents:
diff changeset
89 globalgraph()
11
8d3ca9652a5b "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 8691f2575cacd71c971338658198a1324e5f9370"
artbio
parents: 0
diff changeset
90 }
0
a35e6f9c1d34 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 6719543c5017d581ae012b864d7c9088f0767fc8
artbio
parents:
diff changeset
91
11
8d3ca9652a5b "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 8691f2575cacd71c971338658198a1324e5f9370"
artbio
parents: 0
diff changeset
92 if (args$plot_method == "lattice") {
0
a35e6f9c1d34 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 6719543c5017d581ae012b864d7c9088f0767fc8
artbio
parents:
diff changeset
93 # rearrange dataframes
11
8d3ca9652a5b "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 8691f2575cacd71c971338658198a1324e5f9370"
artbio
parents: 0
diff changeset
94 h_sig <- h_dataframe[, c(1, 2, 3)]
8d3ca9652a5b "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 8691f2575cacd71c971338658198a1324e5f9370"
artbio
parents: 0
diff changeset
95 h_sig <- cbind(rep("Overlap Prob (%)", length(h_sig[, 1])), h_sig)
8d3ca9652a5b "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 8691f2575cacd71c971338658198a1324e5f9370"
artbio
parents: 0
diff changeset
96 colnames(h_sig) <- c("method", "chrom", "overlap", "sig")
8d3ca9652a5b "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 8691f2575cacd71c971338658198a1324e5f9370"
artbio
parents: 0
diff changeset
97 z_pairs <- z_dataframe[, c(1, 2, 3)]
8d3ca9652a5b "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 8691f2575cacd71c971338658198a1324e5f9370"
artbio
parents: 0
diff changeset
98 z_pairs <- cbind(rep("Nbr of pairs", length(z_pairs[, 1])), z_pairs)
8d3ca9652a5b "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 8691f2575cacd71c971338658198a1324e5f9370"
artbio
parents: 0
diff changeset
99 colnames(z_pairs) <- c("method", "chrom", "overlap", "sig")
8d3ca9652a5b "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 8691f2575cacd71c971338658198a1324e5f9370"
artbio
parents: 0
diff changeset
100 lattice_df <- rbind(z_pairs, h_sig)
8d3ca9652a5b "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 8691f2575cacd71c971338658198a1324e5f9370"
artbio
parents: 0
diff changeset
101 par_settings_treillis <- list(strip.background = list(
0
a35e6f9c1d34 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 6719543c5017d581ae012b864d7c9088f0767fc8
artbio
parents:
diff changeset
102 col = c("lightblue", "lightgreen")))
11
8d3ca9652a5b "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 8691f2575cacd71c971338658198a1324e5f9370"
artbio
parents: 0
diff changeset
103 treillisgraph(lattice_df, par.settings = par_settings_treillis)
0
a35e6f9c1d34 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 6719543c5017d581ae012b864d7c9088f0767fc8
artbio
parents:
diff changeset
104 }