changeset 34:966bc5c46efd draft default tip

planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit b7c7c60d608694ca4f1638e4bb0d6db5b1afa944
author artbio
date Fri, 21 Oct 2022 23:19:55 +0000
parents 6fee74f6d2bd
children
files small_rna_maps.r small_rna_maps.xml test-data/clustering.pdf test-data/clustering_unstranded.pdf test-data/coverage.pdf test-data/global_merge.pdf test-data/global_nomerge.pdf test-data/input1__single_plot_mean.pdf test-data/input1_input2_double_plot_counts_size_ylimneg5_5.pdf test-data/input1_input2_norm_1_2_single_plot_counts.pdf test-data/input1_input2new_norm_1_2_single_plot_counts.pdf test-data/input1_min20_max30_single_plot_size.pdf test-data/input1_single_plot_median.pdf test-data/input1_yminneg5_5_single_plot_counts.pdf test-data/input_single_chr_x_6_single_plot_coverage.pdf
diffstat 15 files changed, 28 insertions(+), 28 deletions(-) [+]
line wrap: on
line diff
--- 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))
--- 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 @@
-<tool id="small_rna_maps" name="small_rna_maps" version="3.1.0">
+<tool id="small_rna_maps" name="small_rna_maps" version="3.1.1">
   <description></description>
   <requirements>
-        <requirement type="package" version="1.21.3=py37h31617e3_0">numpy</requirement>
-        <requirement type="package" version="0.17.0=py37h45aed0b_0">pysam</requirement>
-        <requirement type="package" version="1.7.1=r40hc72bb7e_0">r-optparse</requirement>
-        <requirement type="package" version="0.6_29=r40hc72bb7e_1">r-latticeextra</requirement>
-        <requirement type="package" version="2.3=r40hc72bb7e_1003">r-gridextra</requirement>
-        <requirement type="package" version="1.4.4=r40h03ef668_1">r-reshape2</requirement>
-        <requirement type="package" version="0.8.1=h41abebc_0">sambamba</requirement>
-        <requirement type="package" version="68.1=h58526e2_0">icu</requirement>
+        <requirement type="package" version="1.23.4">numpy</requirement>
+        <requirement type="package" version="0.18.0">pysam</requirement>
+        <requirement type="package" version="1.7.3">r-optparse</requirement>
+        <requirement type="package" version="0.6_30">r-latticeextra</requirement>
+        <requirement type="package" version="2.3">r-gridextra</requirement>
+        <requirement type="package" version="1.4.4">r-reshape2</requirement>
+        <requirement type="package" version="0.8.2">sambamba</requirement>
   </requirements>
   <stdio>
       <exit_code range="1:" level="fatal" description="Tool exception" />
Binary file test-data/clustering.pdf has changed
Binary file test-data/clustering_unstranded.pdf has changed
Binary file test-data/coverage.pdf has changed
Binary file test-data/global_merge.pdf has changed
Binary file test-data/global_nomerge.pdf has changed
Binary file test-data/input1__single_plot_mean.pdf has changed
Binary file test-data/input1_input2_double_plot_counts_size_ylimneg5_5.pdf has changed
Binary file test-data/input1_input2_norm_1_2_single_plot_counts.pdf has changed
Binary file test-data/input1_input2new_norm_1_2_single_plot_counts.pdf has changed
Binary file test-data/input1_min20_max30_single_plot_size.pdf has changed
Binary file test-data/input1_single_plot_median.pdf has changed
Binary file test-data/input1_yminneg5_5_single_plot_counts.pdf has changed
Binary file test-data/input_single_chr_x_6_single_plot_coverage.pdf has changed