# HG changeset patch # User artbio # Date 1666394395 0 # Node ID 966bc5c46efda9088c93e019852c572e8cdde7d9 # Parent 6fee74f6d2bdbec681c9fa1947e920cf1f713ce5 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit b7c7c60d608694ca4f1638e4bb0d6db5b1afa944 diff -r 6fee74f6d2bd -r 966bc5c46efd small_rna_maps.r --- a/small_rna_maps.r Mon Oct 25 09:21:34 2021 +0000 +++ b/small_rna_maps.r Fri Oct 21 23:19:55 2022 +0000 @@ -1,7 +1,8 @@ ## Setup R error handling to go to stderr -options(show.error.messages = F, +options(show.error.messages = FALSE, error = function() { - cat(geterrmessage(), file = stderr()); q("no", 1, F) + cat(geterrmessage(), file = stderr()) + q("no", 1, FALSE) } ) options(warn = -1) @@ -31,12 +32,12 @@ # data frames implementation ## first table -table <- read.delim(args$first_dataframe, header = T, row.names = NULL) +table <- read.delim(args$first_dataframe, header = TRUE, row.names = NULL) colnames(table)[1] <- "Dataset" dropcol <- c("Strandness", "z.score") # not used by this Rscript and is dropped for backward compatibility table <- table[, !(names(table) %in% dropcol)] -if (args$first_plot_method == "Counts" | args$first_plot_method == "Size") { - table <- within(table, Counts[Polarity == "R"] <- (Counts[Polarity == "R"] * - 1)) +if (args$first_plot_method == "Counts" || args$first_plot_method == "Size") { + table <- within(table, Counts[Polarity == "R"] <- (Counts[Polarity == "R"] * - 1)) # nolint } n_samples <- length(unique(table$Dataset)) samples <- unique(table$Dataset) @@ -45,7 +46,7 @@ } else { norm_factors <- rep(1, n_samples) } -if (args$first_plot_method == "Counts" | args$first_plot_method == "Size" | args$first_plot_method == "Coverage") { +if (args$first_plot_method == "Counts" || args$first_plot_method == "Size" || args$first_plot_method == "Coverage") { i <- 1 for (sample in samples) { # Warning Here the column is hard coded as the last column (dangerous) @@ -61,14 +62,14 @@ # second table if (args$extra_plot_method != "") { - extra_table <- read.delim(args$extra_dataframe, header = T, row.names = NULL) + extra_table <- read.delim(args$extra_dataframe, header = TRUE, row.names = NULL) colnames(extra_table)[1] <- "Dataset" dropcol <- c("Strandness", "z.score") table <- table[, !(names(table) %in% dropcol)] - if (args$extra_plot_method == "Counts" | args$extra_plot_method == "Size") { - extra_table <- within(extra_table, Counts[Polarity == "R"] <- (Counts[Polarity == "R"] * -1)) + if (args$extra_plot_method == "Counts" || args$extra_plot_method == "Size") { + extra_table <- within(extra_table, Counts[Polarity == "R"] <- (Counts[Polarity == "R"] * -1)) # nolint } - if (args$extra_plot_method == "Counts" | args$extra_plot_method == "Size" | args$extra_plot_method == "Coverage") { + if (args$extra_plot_method == "Counts" || args$extra_plot_method == "Size" || args$extra_plot_method == "Coverage") { i <- 1 for (sample in samples) { extra_table[, length(extra_table)][extra_table$Dataset == sample] <- extra_table[, length(extra_table)][extra_table$Dataset == sample] * norm_factors[i] @@ -85,11 +86,11 @@ data = df, origin = 0, horizontal = FALSE, col = c("darkblue"), - 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))), + scales = list(y = list(tick.number = 4, rot = 90, relation = "same", cex = 0.5, alternating = TRUE), x = list(rot = 0, cex = 0.6, tck = 0.5, alternating = c(3, 3))), xlab = list(label = bottom_first_method[[args$first_plot_method]], cex = .85), ylab = list(label = legend_first_method[[args$first_plot_method]], cex = .85), main = title_first_method[[args$first_plot_method]], - layout = c(2, 6), newpage = T, + layout = c(2, 6), newpage = TRUE, as.table = TRUE, aspect = 0.5, strip = strip.custom(par.strip.text = list(cex = 1), which.given = 1, bg = "lightblue"), @@ -102,11 +103,11 @@ group = Polarity, stack = TRUE, col = c("red", "blue"), - 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))), + scales = list(y = list(tick.number = 4, rot = 90, relation = "same", cex = 0.5, alternating = TRUE), x = list(rot = 0, cex = 0.6, tck = 0.5, alternating = c(3, 3))), xlab = list(label = bottom_first_method[[args$first_plot_method]], cex = .85), ylab = list(label = legend_first_method[[args$first_plot_method]], cex = .85), main = title_first_method[[args$first_plot_method]], - layout = c(2, 6), newpage = T, + layout = c(2, 6), newpage = TRUE, as.table = TRUE, aspect = 0.5, strip = strip.custom(par.strip.text = list(cex = 1), which.given = 1, bg = "lightblue"), @@ -134,7 +135,7 @@ lwd = 1.5, 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)), xlab = NULL, main = NULL, ylab = NULL, ylim = ylimits, - as.table = T, + as.table = TRUE, origin = 0, horizontal = FALSE, group = Polarity, @@ -150,7 +151,7 @@ cex = 0.35, 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)), xlab = NULL, main = NULL, ylab = NULL, ylim = ylimits, - as.table = T, + as.table = TRUE, origin = 0, horizontal = FALSE, group = Polarity, @@ -252,17 +253,17 @@ if (args$extra_plot_method != "") { double_plot() } -if (args$extra_plot_method == "" & !exists("global", where = args)) { +if (args$extra_plot_method == "" && !exists("global", where = args)) { single_plot() } if (exists("global", where = args)) { pdf(file = args$output, paper = "special", height = 11.69) - table <- within(table, Counts[Polarity == "R"] <- abs(Counts[Polarity == "R"])) + table <- within(table, Counts[Polarity == "R"] <- abs(Counts[Polarity == "R"])) # nolint library(reshape2) ml <- melt(table, id.vars = c("Dataset", "Chromosome", "Polarity", "Size")) if (args$global == "nomerge") { castml <- dcast(ml, Dataset + Polarity + Size ~ variable, function(x) sum(x)) - castml <- within(castml, Counts[Polarity == "R"] <- (Counts[Polarity == "R"] * -1)) + castml <- within(castml, Counts[Polarity == "R"] <- (Counts[Polarity == "R"] * -1)) # nolint bc <- globalbc(castml, global = "no") } else { castml <- dcast(ml, Dataset + Size ~ variable, function(x) sum(x)) diff -r 6fee74f6d2bd -r 966bc5c46efd small_rna_maps.xml --- a/small_rna_maps.xml Mon Oct 25 09:21:34 2021 +0000 +++ b/small_rna_maps.xml Fri Oct 21 23:19:55 2022 +0000 @@ -1,14 +1,13 @@ - + - numpy - pysam - r-optparse - r-latticeextra - r-gridextra - r-reshape2 - sambamba - icu + numpy + pysam + r-optparse + r-latticeextra + r-gridextra + r-reshape2 + sambamba diff -r 6fee74f6d2bd -r 966bc5c46efd test-data/clustering.pdf Binary file test-data/clustering.pdf has changed diff -r 6fee74f6d2bd -r 966bc5c46efd test-data/clustering_unstranded.pdf Binary file test-data/clustering_unstranded.pdf has changed diff -r 6fee74f6d2bd -r 966bc5c46efd test-data/coverage.pdf Binary file test-data/coverage.pdf has changed diff -r 6fee74f6d2bd -r 966bc5c46efd test-data/global_merge.pdf Binary file test-data/global_merge.pdf has changed diff -r 6fee74f6d2bd -r 966bc5c46efd test-data/global_nomerge.pdf Binary file test-data/global_nomerge.pdf has changed diff -r 6fee74f6d2bd -r 966bc5c46efd test-data/input1__single_plot_mean.pdf Binary file test-data/input1__single_plot_mean.pdf has changed diff -r 6fee74f6d2bd -r 966bc5c46efd test-data/input1_input2_double_plot_counts_size_ylimneg5_5.pdf Binary file test-data/input1_input2_double_plot_counts_size_ylimneg5_5.pdf has changed diff -r 6fee74f6d2bd -r 966bc5c46efd test-data/input1_input2_norm_1_2_single_plot_counts.pdf Binary file test-data/input1_input2_norm_1_2_single_plot_counts.pdf has changed diff -r 6fee74f6d2bd -r 966bc5c46efd test-data/input1_input2new_norm_1_2_single_plot_counts.pdf Binary file test-data/input1_input2new_norm_1_2_single_plot_counts.pdf has changed diff -r 6fee74f6d2bd -r 966bc5c46efd test-data/input1_min20_max30_single_plot_size.pdf Binary file test-data/input1_min20_max30_single_plot_size.pdf has changed diff -r 6fee74f6d2bd -r 966bc5c46efd test-data/input1_single_plot_median.pdf Binary file test-data/input1_single_plot_median.pdf has changed diff -r 6fee74f6d2bd -r 966bc5c46efd test-data/input1_yminneg5_5_single_plot_counts.pdf Binary file test-data/input1_yminneg5_5_single_plot_counts.pdf has changed diff -r 6fee74f6d2bd -r 966bc5c46efd test-data/input_single_chr_x_6_single_plot_coverage.pdf Binary file test-data/input_single_chr_x_6_single_plot_coverage.pdf has changed