diff brew3r.r_script.R @ 1:3198f52bffaa draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/brew3r_r commit fa525468780f3dea175da15852b1b8c17e1a80d3
author iuc
date Tue, 18 Jun 2024 05:36:32 +0000
parents 928a52b5c938
children d3b0390f325f
line wrap: on
line diff
--- a/brew3r.r_script.R	Tue Jun 11 08:26:37 2024 +0000
+++ b/brew3r.r_script.R	Tue Jun 18 05:36:32 2024 +0000
@@ -91,17 +91,23 @@
         multi.strand.query <- ov.simple$queryHits[duplicated(ov.simple$queryHits)]
         to.remove <- unstranded.intervals[multi.strand.query]
         # Remove these potentially error-prone intervals from the template
-        input_gr_template <- input_gr_template[-to.remove]
+        if (length(to.remove) > 0) {
+            input_gr_template <- input_gr_template[-to.remove]
+        }
     }
 }
 
 # Run BREW3R.r main function
-new_gr_exons <- extend_granges(
-    input_gr_to_extend = input_gr_to_extend,
-    input_gr_to_overlap = input_gr_template,
-    add_new_exons = is.null(opt$no_add),
-    overlap_resolution_fn = opt$sup_output
-)
+if (length(input_gr_template) > 0) {
+    new_gr_exons <- extend_granges(
+        input_gr_to_extend = input_gr_to_extend,
+        input_gr_to_overlap = input_gr_template,
+        add_new_exons = is.null(opt$no_add),
+        overlap_resolution_fn = opt$sup_output
+    )
+} else {
+    new_gr_exons <- subset(input_gr_to_extend, type == "exon")
+}
 # Prevent extension using pattern
 if (!is.null(opt$exclude_pattern)) {
     input_gr_pattern <- subset(