annotate small_rna_maps.r @ 2:59d93aa7cc20 draft

"planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit d280e9be7cf96f4938a73ccf5985533109f3328f"
author artbio
date Sat, 05 Oct 2019 18:24:52 -0400
parents 615fa2171a34
children ba3ce7ee5b18
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
0a06985c0894 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit 7b2ceb05489c27ddb769c38fdec56274108a6fa1
artbio
parents:
diff changeset
1 ## Setup R error handling to go to stderr
0a06985c0894 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit 7b2ceb05489c27ddb769c38fdec56274108a6fa1
artbio
parents:
diff changeset
2 options( show.error.messages=F,
1
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
3 error = function () { cat( geterrmessage(), file=stderr() ); q( "no", 1, F ) } )
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
4 options(warn = -1)
0
0a06985c0894 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit 7b2ceb05489c27ddb769c38fdec56274108a6fa1
artbio
parents:
diff changeset
5 library(RColorBrewer)
0a06985c0894 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit 7b2ceb05489c27ddb769c38fdec56274108a6fa1
artbio
parents:
diff changeset
6 library(lattice)
0a06985c0894 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit 7b2ceb05489c27ddb769c38fdec56274108a6fa1
artbio
parents:
diff changeset
7 library(latticeExtra)
0a06985c0894 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit 7b2ceb05489c27ddb769c38fdec56274108a6fa1
artbio
parents:
diff changeset
8 library(grid)
0a06985c0894 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit 7b2ceb05489c27ddb769c38fdec56274108a6fa1
artbio
parents:
diff changeset
9 library(gridExtra)
0a06985c0894 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit 7b2ceb05489c27ddb769c38fdec56274108a6fa1
artbio
parents:
diff changeset
10 library(optparse)
0a06985c0894 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit 7b2ceb05489c27ddb769c38fdec56274108a6fa1
artbio
parents:
diff changeset
11
1
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
12
0
0a06985c0894 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit 7b2ceb05489c27ddb769c38fdec56274108a6fa1
artbio
parents:
diff changeset
13 option_list <- list(
1
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
14 make_option(c("-i", "--ymin"), type="double", help="set min ylimit. e.g. '-100.0'"),
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
15 make_option(c("-a", "--ymax"), type="double", help="set max ylimit. e.g. '100.0'"),
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
16 make_option(c("-f", "--first_dataframe"), type="character", help="path to first dataframe"),
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
17 make_option(c("-e", "--extra_dataframe"), type="character", help="path to additional dataframe"),
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
18 make_option(c("-n", "--normalization"), type="character", help="space-separated normalization/size factors"),
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
19 make_option("--first_plot_method", type = "character", help="How additional data should be plotted"),
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
20 make_option("--extra_plot_method", type = "character", help="How additional data should be plotted"),
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
21 make_option("--global", type = "character", help="data should be plotted as global size distribution"),
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
22 make_option("--output_pdf", type = "character", help="path to the pdf file with plots")
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
23 )
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
24
0
0a06985c0894 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit 7b2ceb05489c27ddb769c38fdec56274108a6fa1
artbio
parents:
diff changeset
25 parser <- OptionParser(usage = "%prog [options] file", option_list = option_list)
0a06985c0894 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit 7b2ceb05489c27ddb769c38fdec56274108a6fa1
artbio
parents:
diff changeset
26 args = parse_args(parser)
1
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
27
0
0a06985c0894 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit 7b2ceb05489c27ddb769c38fdec56274108a6fa1
artbio
parents:
diff changeset
28 # data frames implementation
2
59d93aa7cc20 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit d280e9be7cf96f4938a73ccf5985533109f3328f"
artbio
parents: 1
diff changeset
29
1
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
30 ## first table
0
0a06985c0894 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit 7b2ceb05489c27ddb769c38fdec56274108a6fa1
artbio
parents:
diff changeset
31 Table = read.delim(args$first_dataframe, header=T, row.names=NULL)
1
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
32 colnames(Table)[1] <- "Dataset"
2
59d93aa7cc20 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit d280e9be7cf96f4938a73ccf5985533109f3328f"
artbio
parents: 1
diff changeset
33 dropcol <- c("Strandness", "z.score") # not used by this Rscript and is dropped for backward compatibility
59d93aa7cc20 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit d280e9be7cf96f4938a73ccf5985533109f3328f"
artbio
parents: 1
diff changeset
34 Table <- Table[,!(names(Table) %in% dropcol)]
1
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
35 if (args$first_plot_method == "Counts" | args$first_plot_method == "Size") {
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
36 Table <- within(Table, Counts[Polarity=="R"] <- (Counts[Polarity=="R"]*-1))
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
37 }
0
0a06985c0894 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit 7b2ceb05489c27ddb769c38fdec56274108a6fa1
artbio
parents:
diff changeset
38 n_samples=length(unique(Table$Dataset))
1
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
39 samples = unique(Table$Dataset)
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
40 if (args$normalization != "") {
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
41 norm_factors = as.numeric(unlist(strsplit(args$normalization, " ")))
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
42 } else {
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
43 norm_factors = rep(1, n_samples)
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
44 }
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
45 if (args$first_plot_method == "Counts" | args$first_plot_method == "Size" | args$first_plot_method == "Coverage") {
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
46 i = 1
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
47 for (sample in samples) {
2
59d93aa7cc20 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit d280e9be7cf96f4938a73ccf5985533109f3328f"
artbio
parents: 1
diff changeset
48 # Warning
59d93aa7cc20 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit d280e9be7cf96f4938a73ccf5985533109f3328f"
artbio
parents: 1
diff changeset
49 # Here the column is hard coded as the last column (dangerous)
59d93aa7cc20 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit d280e9be7cf96f4938a73ccf5985533109f3328f"
artbio
parents: 1
diff changeset
50 # because its name changes with the method
1
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
51 Table[, length(Table)][Table$Dataset==sample] <- Table[, length(Table)][Table$Dataset==sample]*norm_factors[i]
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
52 i = i + 1
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
53 }
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
54 }
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
55 genes=unique(Table$Chromosome)
0
0a06985c0894 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit 7b2ceb05489c27ddb769c38fdec56274108a6fa1
artbio
parents:
diff changeset
56 per_gene_readmap=lapply(genes, function(x) subset(Table, Chromosome==x))
0a06985c0894 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit 7b2ceb05489c27ddb769c38fdec56274108a6fa1
artbio
parents:
diff changeset
57 per_gene_limit=lapply(genes, function(x) c(1, unique(subset(Table, Chromosome==x)$Chrom_length)) )
0a06985c0894 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit 7b2ceb05489c27ddb769c38fdec56274108a6fa1
artbio
parents:
diff changeset
58 n_genes=length(per_gene_readmap)
2
59d93aa7cc20 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit d280e9be7cf96f4938a73ccf5985533109f3328f"
artbio
parents: 1
diff changeset
59
1
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
60 # second table
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
61 if (args$extra_plot_method != '') {
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
62 ExtraTable=read.delim(args$extra_dataframe, header=T, row.names=NULL)
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
63 colnames(ExtraTable)[1] <- "Dataset"
2
59d93aa7cc20 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit d280e9be7cf96f4938a73ccf5985533109f3328f"
artbio
parents: 1
diff changeset
64 dropcol <- c("Strandness", "z.score") # not used by this Rscript and is dropped for backward compatibility
59d93aa7cc20 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit d280e9be7cf96f4938a73ccf5985533109f3328f"
artbio
parents: 1
diff changeset
65 Table <- Table[,!(names(Table) %in% dropcol)]
1
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
66 if (args$extra_plot_method == "Counts" | args$extra_plot_method=='Size') {
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
67 ExtraTable <- within(ExtraTable, Counts[Polarity=="R"] <- (Counts[Polarity=="R"]*-1))
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
68 }
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
69 if (args$extra_plot_method == "Counts" | args$extra_plot_method == "Size" | args$extra_plot_method == "Coverage") {
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
70 i = 1
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
71 for (sample in samples) {
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
72 ExtraTable[, length(ExtraTable)][ExtraTable$Dataset==sample] <- ExtraTable[, length(ExtraTable)][ExtraTable$Dataset==sample]*norm_factors[i]
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
73 i = i + 1
0
0a06985c0894 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit 7b2ceb05489c27ddb769c38fdec56274108a6fa1
artbio
parents:
diff changeset
74 }
1
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
75 }
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
76 per_gene_size=lapply(genes, function(x) subset(ExtraTable, Chromosome==x))
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
77 }
0
0a06985c0894 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit 7b2ceb05489c27ddb769c38fdec56274108a6fa1
artbio
parents:
diff changeset
78
0a06985c0894 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit 7b2ceb05489c27ddb769c38fdec56274108a6fa1
artbio
parents:
diff changeset
79 ## functions
1
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
80 globalbc = function(df, global="", ...) {
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
81 if (global == "yes") {
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
82 bc <- barchart(Counts~as.factor(Size)|factor(Dataset, levels=unique(Dataset)),
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
83 data = df, origin = 0,
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
84 horizontal=FALSE,
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
85 col=c("darkblue"),
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
86 scales=list(y=list(tick.number=4, rot=90, relation="same", cex=0.5, alternating=T), x=list(rot=0, cex=0.6, tck=0.5, alternating=c(3,3))),
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
87 xlab=list(label=bottom_first_method[[args$first_plot_method]], cex=.85),
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
88 ylab=list(label=legend_first_method[[args$first_plot_method]], cex=.85),
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
89 main=title_first_method[[args$first_plot_method]],
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
90 layout = c(2, 6), newpage=T,
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
91 as.table=TRUE,
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
92 aspect=0.5,
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
93 strip = strip.custom(par.strip.text = list(cex = 1), which.given=1, bg="lightblue"),
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
94 ...
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
95 )
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
96 } else {
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
97 bc <- barchart(Counts~as.factor(Size)|factor(Dataset, levels=unique(Dataset)),
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
98 data = df, origin = 0,
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
99 horizontal=FALSE,
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
100 group=Polarity,
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
101 stack=TRUE,
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
102 col=c('red', 'blue'),
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
103 scales=list(y=list(tick.number=4, rot=90, relation="same", cex=0.5, alternating=T), x=list(rot=0, cex=0.6, tck=0.5, alternating=c(3,3))),
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
104 xlab=list(label=bottom_first_method[[args$first_plot_method]], cex=.85),
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
105 ylab=list(label=legend_first_method[[args$first_plot_method]], cex=.85),
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
106 main=title_first_method[[args$first_plot_method]],
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
107 layout = c(2, 6), newpage=T,
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
108 as.table=TRUE,
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
109 aspect=0.5,
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
110 strip = strip.custom(par.strip.text = list(cex = 1), which.given=1, bg="lightblue"),
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
111 ...
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
112 )
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
113 }
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
114 return(bc)
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
115 }
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
116 plot_unit = function(df, method=args$first_plot_method, ...) {
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
117 if (exists('ymin', where=args)){
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
118 min=args$ymin
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
119 }else{
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
120 min=''
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
121 }
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
122 if ((exists('ymax', where=args))){
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
123 max=args$ymax
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
124 }else{
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
125 max=''
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
126 }
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
127 ylimits=c(min,max)
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
128 if (method == 'Counts') {
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
129 p = xyplot(Counts~Coordinate|factor(Dataset, levels=unique(Dataset))+factor(Chromosome, levels=unique(Chromosome)),
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
130 data=df,
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
131 type='h',
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
132 lwd=1.5,
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
133 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)),
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
134 xlab=NULL, main=NULL, ylab=NULL, ylim=ylimits,
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
135 as.table=T,
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
136 origin = 0,
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
137 horizontal=FALSE,
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
138 group=Polarity,
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
139 col=c("red","blue"),
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
140 par.strip.text = list(cex=0.7),
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
141 ...)
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
142 p=combineLimits(p)
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
143 } else if (method != "Size") {
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
144 p = xyplot(eval(as.name(method))~Coordinate|factor(Dataset, levels=unique(Dataset))+factor(Chromosome, levels=unique(Chromosome)),
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
145 data=df,
2
59d93aa7cc20 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit d280e9be7cf96f4938a73ccf5985533109f3328f"
artbio
parents: 1
diff changeset
146 type= ifelse(method=='Coverage', 'l', 'p'),
1
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
147 pch=19,
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
148 cex=0.35,
2
59d93aa7cc20 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit d280e9be7cf96f4938a73ccf5985533109f3328f"
artbio
parents: 1
diff changeset
149 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)),
1
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
150 xlab=NULL, main=NULL, ylab=NULL, ylim=ylimits,
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
151 as.table=T,
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
152 origin = 0,
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
153 horizontal=FALSE,
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
154 group=Polarity,
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
155 col=c("red","blue"),
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
156 par.strip.text = list(cex=0.7),
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
157 ...)
2
59d93aa7cc20 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit d280e9be7cf96f4938a73ccf5985533109f3328f"
artbio
parents: 1
diff changeset
158 p=combineLimits(p)
1
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
159 } else {
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
160 p = barchart(Counts~as.factor(Size)|factor(Dataset, levels=unique(Dataset))+Chromosome, data = df, origin = 0,
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
161 horizontal=FALSE,
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
162 group=Polarity,
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
163 stack=TRUE,
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
164 col=c('red', 'blue'),
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
165 scales=list(y=list(rot=90, relation="free", cex=0.7), x=list(rot=0, cex=0.7, axs="i", tck=c(1,0))),
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
166 xlab = NULL,
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
167 ylab = NULL,
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
168 main = NULL,
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
169 as.table=TRUE,
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
170 par.strip.text = list(cex=0.6),
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
171 ...)
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
172 p=combineLimits(p)
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
173 }
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
174 return(p)
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
175 }
0
0a06985c0894 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit 7b2ceb05489c27ddb769c38fdec56274108a6fa1
artbio
parents:
diff changeset
176
0a06985c0894 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit 7b2ceb05489c27ddb769c38fdec56274108a6fa1
artbio
parents:
diff changeset
177
1
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
178 ## function parameters
0
0a06985c0894 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit 7b2ceb05489c27ddb769c38fdec56274108a6fa1
artbio
parents:
diff changeset
179
1
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
180 #par.settings.firstplot = list(layout.heights=list(top.padding=11, bottom.padding = -14))
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
181 #par.settings.secondplot=list(layout.heights=list(top.padding=11, bottom.padding = -15), strip.background=list(col=c("lavender","deepskyblue")))
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
182 par.settings.firstplot = list(layout.heights=list(top.padding=-2, bottom.padding=-2),strip.background=list(col=c("lightblue","lightgreen")))
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
183 par.settings.secondplot=list(layout.heights=list(top.padding=-1, bottom.padding=-1),strip.background=list(col=c("lightblue","lightgreen")))
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
184 title_first_method = list(Counts="Read Counts", Coverage="Coverage depths", Median="Median sizes", Mean="Mean sizes", Size="Size Distributions")
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
185 title_extra_method = list(Counts="Read Counts", Coverage="Coverage depths", Median="Median sizes", Mean="Mean sizes", Size="Size Distributions")
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
186 legend_first_method =list(Counts="Read count", Coverage="Coverage depth", Median="Median size", Mean="Mean size", Size="Read count")
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
187 legend_extra_method =list(Counts="Read count", Coverage="Coverage depth", Median="Median size", Mean="Mean size", Size="Read count")
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
188 bottom_first_method =list(Counts="Coordinates (nucleotides)",Coverage="Coordinates (nucleotides)", Median="Coordinates (nucleotides)", Mean="Coordinates (nucleotides)", Size="Sizes of reads")
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
189 bottom_extra_method =list(Counts="Coordinates (nucleotides)",Coverage="Coordinates (nucleotides)", Median="Coordinates (nucleotides)", Mean="Coordinates (nucleotides)", Size="Sizes of reads")
0
0a06985c0894 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit 7b2ceb05489c27ddb769c38fdec56274108a6fa1
artbio
parents:
diff changeset
190
1
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
191 ## Plotting Functions
0
0a06985c0894 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit 7b2ceb05489c27ddb769c38fdec56274108a6fa1
artbio
parents:
diff changeset
192
1
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
193 double_plot <- function(...) {
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
194 page_height = 15
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
195 rows_per_page = 10
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
196 graph_heights=c(40,30,40,30,40,30,40,30,40,30,10)
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
197 page_width=8.2677 * n_samples / 2
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
198 pdf(file=args$output_pdf, paper="special", height=page_height, width=page_width)
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
199 for (i in seq(1,n_genes,rows_per_page/2)) {
0
0a06985c0894 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit 7b2ceb05489c27ddb769c38fdec56274108a6fa1
artbio
parents:
diff changeset
200 start=i
0a06985c0894 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit 7b2ceb05489c27ddb769c38fdec56274108a6fa1
artbio
parents:
diff changeset
201 end=i+rows_per_page/2-1
0a06985c0894 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit 7b2ceb05489c27ddb769c38fdec56274108a6fa1
artbio
parents:
diff changeset
202 if (end>n_genes) {end=n_genes}
1
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
203 if (end-start+1 < 5) {graph_heights=c(rep(c(40,30),end-start+1),10,rep(c(40,30),5-(end-start+1)))}
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
204 first_plot.list = lapply(per_gene_readmap[start:end], function(x) update(useOuterStrips(plot_unit(x, par.settings=par.settings.secondplot), strip.left=strip.custom(par.strip.text = list(cex=0.5)))))
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
205 second_plot.list = lapply(per_gene_size[start:end], function(x) update(useOuterStrips(plot_unit(x, method=args$extra_plot_method, par.settings=par.settings.firstplot), strip.left=strip.custom(par.strip.text = list(cex=0.5)), strip=FALSE)))
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
206 plot.list=rbind(first_plot.list, second_plot.list)
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
207 args_list=c(plot.list, list( nrow=rows_per_page+1, ncol=1, heights=unit(graph_heights, rep("mm", 11)),
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
208 top=textGrob(paste(title_first_method[[args$first_plot_method]], "and", title_extra_method[[args$extra_plot_method]]), gp=gpar(cex=1), vjust=0, just="top"),
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
209 left=textGrob(paste(legend_first_method[[args$first_plot_method]], "/", legend_extra_method[[args$extra_plot_method]]), gp=gpar(cex=1), vjust=0, hjust=0, x=1, y=(-0.38/4)*(end-start-(3.28/0.38)), rot=90),
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
210 sub=textGrob(paste(bottom_first_method[[args$first_plot_method]], "/", bottom_extra_method[[args$extra_plot_method]]), gp=gpar(cex=1), just="bottom", vjust=2)
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
211 )
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
212 )
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
213 do.call(grid.arrange, args_list)
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
214 }
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
215 devname=dev.off()
0
0a06985c0894 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit 7b2ceb05489c27ddb769c38fdec56274108a6fa1
artbio
parents:
diff changeset
216 }
1
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
217
0
0a06985c0894 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit 7b2ceb05489c27ddb769c38fdec56274108a6fa1
artbio
parents:
diff changeset
218
1
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
219 single_plot <- function(...) {
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
220 width = 8.2677 * n_samples / 2
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
221 rows_per_page=8
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
222 graph_heights=c(rep(40,8),10)
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
223 pdf(file=args$output_pdf, paper="special", height=15, width=width)
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
224 for (i in seq(1,n_genes,rows_per_page)) {
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
225 start=i
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
226 end=i+rows_per_page-1
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
227 if (end>n_genes) {end=n_genes}
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
228 if (end-start+1 < 8) {graph_heights=c(rep(c(40),end-start+1),10,rep(c(40),8-(end-start+1)))}
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
229 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)))))
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
230 plot.list=rbind(first_plot.list)
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
231 args_list=c(plot.list, list( nrow=rows_per_page+1, ncol=1, heights=unit(graph_heights, rep("mm", 9)),
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
232 top=textGrob(title_first_method[[args$first_plot_method]], gp=gpar(cex=1), vjust=0, just="top"),
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
233 left=textGrob(legend_first_method[[args$first_plot_method]], gp=gpar(cex=1), vjust=0, hjust=0, x=1, y=(-0.41/7)*(end-start-(6.23/0.41)), rot=90),
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
234 sub=textGrob(bottom_first_method[[args$first_plot_method]], gp=gpar(cex=1), just="bottom", vjust=2)
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
235 )
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
236 )
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
237 do.call(grid.arrange, args_list)
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
238 }
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
239 devname=dev.off()
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
240 }
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
241
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
242 # main
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
243
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
244 if (args$extra_plot_method != '') { double_plot() }
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
245 if (args$extra_plot_method == '' & !exists('global', where=args)) {
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
246 single_plot()
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
247 }
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
248 if (exists('global', where=args)) {
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
249 pdf(file=args$output, paper="special", height=11.69)
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
250 Table <- within(Table, Counts[Polarity=="R"] <- abs(Counts[Polarity=="R"])) # retropedalage
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
251 library(reshape2)
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
252 ml = melt(Table, id.vars = c("Dataset", "Chromosome", "Polarity", "Size"))
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
253 if (args$global == "nomerge") {
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
254 castml = dcast(ml, Dataset+Polarity+Size ~ variable, function(x) sum(x))
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
255 castml <- within(castml, Counts[Polarity=="R"] <- (Counts[Polarity=="R"]*-1))
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
256 bc = globalbc(castml, global="no")
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
257 } else {
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
258 castml = dcast(ml, Dataset+Size ~ variable, function(x) sum(x))
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
259 bc = globalbc(castml, global="yes")
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
260 }
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
261 plot(bc)
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
262 devname=dev.off()
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
263 }
615fa2171a34 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
artbio
parents: 0
diff changeset
264