changeset 3:d3b0390f325f draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/brew3r_r commit d287d5688e57f4154d5875789e0cd4d5c87f11ce
author iuc
date Thu, 03 Oct 2024 22:35:49 +0000
parents 05f8e9d1e8b8
children
files brew3r.r_script.R brew3r_r.xml test-data/generate_test.R test-data/input_noexonid.gtf
diffstat 4 files changed, 56 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/brew3r.r_script.R	Thu Jun 27 07:31:23 2024 +0000
+++ b/brew3r.r_script.R	Thu Oct 03 22:35:49 2024 +0000
@@ -97,6 +97,18 @@
     }
 }
 
+if (is.null(input_gr_to_extend$exon_id)) {
+    is.exon <- which(input_gr_to_extend$type == "exon")
+    input_gr_to_extend$exon_id <- NA
+    input_gr_to_extend$exon_id[is.exon] <- paste0(
+        "EXON",
+        sprintf(
+            "%010d",
+            1:length(is.exon)
+        )
+    )
+}
+
 # Run BREW3R.r main function
 if (length(input_gr_template) > 0) {
     new_gr_exons <- extend_granges(
--- a/brew3r_r.xml	Thu Jun 27 07:31:23 2024 +0000
+++ b/brew3r_r.xml	Thu Oct 03 22:35:49 2024 +0000
@@ -2,7 +2,7 @@
     <description>Extend GTF</description>
     <macros>
         <token name="@TOOL_VERSION@">1.0.2</token>
-        <token name="@VERSION_SUFFIX@">0</token>
+        <token name="@VERSION_SUFFIX@">1</token>
     </macros>
     <xrefs>
         <xref type="bio.tools">brew3r.r</xref>
@@ -67,6 +67,16 @@
             <output name="output" value="output.gtf" compare="diff" lines_diff="2"/>
         </test>
         <test expect_num_outputs="1">
+            <param name="gtf_to_extend" value="input_noexonid.gtf"/>
+            <param name="gtf_to_overlap" value="second_input.gtf"/>
+            <output name="output">
+                <assert_contents>
+                    <has_n_lines n="36"/>
+                    <has_text text="BREW3R"/>
+                </assert_contents>
+            </output>
+        </test>
+        <test expect_num_outputs="1">
             <param name="gtf_to_extend" value="input.gtf"/>
             <param name="gtf_to_overlap" value="second_input.gtf"/>
             <param name="no_add" value="true"/>
--- a/test-data/generate_test.R	Thu Jun 27 07:31:23 2024 +0000
+++ b/test-data/generate_test.R	Thu Oct 03 22:35:49 2024 +0000
@@ -258,5 +258,7 @@
 new.gr <- extend_granges(input_gr, big_gr)
 library("rtracklayer")
 export.gff(input_gr, "input.gtf")
+input_gr$exon_id <- NULL
+export.gff(input_gr, "input_noexonid.gtf")
 export.gff(big_gr, "second_input.gtf")
 export.gff(sort(new.gr, ignore.strand = TRUE), "output.gtf")
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/input_noexonid.gtf	Thu Oct 03 22:35:49 2024 +0000
@@ -0,0 +1,31 @@
+##gff-version 2
+##source-version rtracklayer 1.64.0
+##date 2024-10-02
+chr1	rtracklayer	exon	5	10	.	+	.	gene_id "gene11"; transcript_id "transcript11"; gene_name "gene11"
+chr1	rtracklayer	exon	20	30	.	+	.	gene_id "gene12"; transcript_id "transcript12"; gene_name "gene12"
+chr1	rtracklayer	exon	105	110	.	+	.	gene_id "gene21"; transcript_id "transcript21"; gene_name "gene21"
+chr1	rtracklayer	exon	120	125	.	+	.	gene_id "gene22"; transcript_id "transcript22"; gene_name "gene22"
+chr1	rtracklayer	exon	205	210	.	+	.	gene_id "gene31"; transcript_id "transcript31"; gene_name "gene31"
+chr1	rtracklayer	exon	220	222	.	+	.	gene_id "gene32"; transcript_id "transcript32"; gene_name "gene32"
+chr1	rtracklayer	exon	305	310	.	+	.	gene_id "gene41"; transcript_id "transcript41"; gene_name "gene41"
+chr1	rtracklayer	exon	305	322	.	+	.	gene_id "gene42"; transcript_id "transcript42"; gene_name "gene42"
+chr1	rtracklayer	exon	405	410	.	+	.	gene_id "gene51"; transcript_id "transcript51"; gene_name "gene51"
+chr1	rtracklayer	exon	405	425	.	+	.	gene_id "gene52"; transcript_id "transcript52"; gene_name "gene52"
+chr1	rtracklayer	exon	505	510	.	+	.	gene_id "gene61"; transcript_id "transcript61"; gene_name "gene61"
+chr1	rtracklayer	exon	520	522	.	+	.	gene_id "gene62"; transcript_id "transcript62"; gene_name "gene62"
+chr1	rtracklayer	exon	601	610	.	+	.	gene_id "gene71"; transcript_id "transcript71"; gene_name "gene71"
+chr1	rtracklayer	exon	601	610	.	+	.	gene_id "gene71"; transcript_id "transcript72"; gene_name "gene71"
+chr1	rtracklayer	exon	630	640	.	+	.	gene_id "gene71"; transcript_id "transcript72"; gene_name "gene71"
+chr1	rtracklayer	exon	701	710	.	+	.	gene_id "gene81"; transcript_id "transcript81"; gene_name "gene81"
+chr1	rtracklayer	exon	701	710	.	+	.	gene_id "gene82"; transcript_id "transcript82"; gene_name "gene82"
+chr1	rtracklayer	exon	730	740	.	+	.	gene_id "gene82"; transcript_id "transcript82"; gene_name "gene82"
+chr1	rtracklayer	exon	801	808	.	+	.	gene_id "gene1"; transcript_id "transcript91"; gene_name "gene1"
+chr1	rtracklayer	exon	801	810	.	+	.	gene_id "gene1"; transcript_id "transcript92"; gene_name "gene1"
+chr1	rtracklayer	exon	830	840	.	+	.	gene_id "gene1"; transcript_id "transcript92"; gene_name "gene1"
+chr1	rtracklayer	exon	901	908	.	+	.	gene_id "gene101"; transcript_id "transcript101"; gene_name "gene101"
+chr1	rtracklayer	exon	901	910	.	+	.	gene_id "gene102"; transcript_id "transcript102"; gene_name "gene102"
+chr1	rtracklayer	exon	930	940	.	+	.	gene_id "gene102"; transcript_id "transcript102"; gene_name "gene102"
+chr1	rtracklayer	exon	1005	1010	.	+	.	gene_id "gene111"; transcript_id "transcript111"; gene_name "Gm001"
+chr1	rtracklayer	exon	1055	1070	.	+	.	gene_id "gene112"; transcript_id "transcript112"; gene_name "gene112"
+chr1	rtracklayer	exon	1100	1105	.	+	.	gene_id "gene121"; transcript_id "transcript121"; gene_name "gene121"
+chr1	rtracklayer	exon	1110	1120	.	-	.	gene_id "gene122"; transcript_id "transcript122"; gene_name "gene122"