Repository 're_utils'
hg clone https://toolshed.g2.bx.psu.edu/repos/petr-novak/re_utils

Changeset 27:eefed7a82001 (2023-08-02)
Previous changeset 26:93595f42a04d (2023-08-02) Next changeset 28:ba970b24e48c (2023-08-02)
Commit message:
planemo upload commit 20bdf879b52796d3fb251a20807191ff02084d3c-dirty
modified:
extract_files_from_re_archive.xml
b
diff -r 93595f42a04d -r eefed7a82001 extract_files_from_re_archive.xml
--- a/extract_files_from_re_archive.xml Wed Aug 02 12:45:16 2023 +0000
+++ b/extract_files_from_re_archive.xml Wed Aug 02 12:59:29 2023 +0000
[
@@ -1,49 +1,68 @@
-<tool id="extract_var_files_from_re" name="Extract various files from RepeatExplorer2 archive" version="1.0.0.3">
-  <command detect_errors="exit_code">
+<tool id="extract_var_files_from_re"
+      name="Extract various files from RepeatExplorer2 archive" version="1.0.0.3">
+    <command detect_errors="exit_code">
+        <![CDATA[
+
+
 
     #for $sf in $file:
-
     #if $sf == "CLUSTER_TABLE.csv"
-    unzip -p -j ${RepeatExplorer_archive} ${sf}  &gt; ${cluster_table}
+    mkdir -p tempdir
+    unzip ${RepeatExplorer_archive} ${sf} -d tempdir
+    find tempdir -type f -name "${sf}" -exec cat {} + > ${cluster_table}
+    rm -r tempdir
     ;
     #end if
 
     #if $sf == "COMPARATIVE_ANALYSIS_COUNTS.csv"
-    unzip -p -j ${RepeatExplorer_archive} ${sf}  &gt; ${comparative_analysis_count}
+    mkdir -p tempdir
+    unzip ${RepeatExplorer_archive} ${sf} -d tempdir
+    find tempdir -type f -name "${sf}" -exec cat {} + > ${comparative_analysis_count}
+    rm -r tempdir
     ;
     #end if
 
     #if $sf == "SUPERCLUSTER_TABLE.csv"
-    unzip -p -j ${RepeatExplorer_archive} ${sf}  &gt; ${supercluster_table}
-    ;
+    mkdir -p tempdir
+    unzip ${RepeatExplorer_archive} ${sf} -d tempdir
+    find tempdir -type f -name "${sf}" -exec cat {} + > ${supercluster_table}
+    rm -r tempdir
     #end if
 
     #end for
 
+]]>
 
 
-  </command>
-  
-  <inputs>
-    <param name="RepeatExplorer_archive" label="Archive with RepeatExplorer2 results" type="data" format="zip"/>
+    </command>
 
-    <param name="file" type="select" label="select files you want to extract" multiple="true" optional="false">
-            <option value="CLUSTER_TABLE.csv">CLUSTER_TABLE.csv</option>
-            <option value="COMPARATIVE_ANALYSIS_COUNTS.csv">COMPARATIVE_ANALYSIS_COUNTS.csv</option>
-            <option value="SUPERCLUSTER_TABLE.csv">SUPERCLUSTER_TABLE.csv</option>
-    </param>
-  </inputs>
+    <inputs>
+        <param name="RepeatExplorer_archive" label="Archive with RepeatExplorer2 results"
+               type="data" format="zip"/>
 
-  <outputs>
-    <data format="tabular" name="cluster_table" label="CLUSTER_TABLE.csv from ${RepeatExplorer_archive.hid}" >
-      <filter>"CLUSTER_TABLE.csv" in file</filter>
-    </data>
-    <data format="tabular" name="supercluster_table" label="SUPERCLUSTER_TABLE.csv from ${RepeatExplorer_archive.hid}">
-      <filter>"SUPERCLUSTER_TABLE.csv" in file</filter>
-    </data>
-    <data format="tabular" name="comparative_analysis_count" label="COMPARATIVE_ANALYSIS_COUNTS.csv from ${RepeatExplorer_archive.hid}">
-      <filter>"COMPARATIVE_ANALYSIS_COUNTS.csv" in file</filter>
-    </data>
-  </outputs>
+        <param name="file" type="select" label="select files you want to extract"
+               multiple="true" optional="false">
+            <option value="CLUSTER_TABLE.csv">CLUSTER_TABLE.csv</option>
+            <option value="COMPARATIVE_ANALYSIS_COUNTS.csv">
+                COMPARATIVE_ANALYSIS_COUNTS.csv
+            </option>
+            <option value="SUPERCLUSTER_TABLE.csv">SUPERCLUSTER_TABLE.csv</option>
+        </param>
+    </inputs>
+
+    <outputs>
+        <data format="tabular" name="cluster_table"
+              label="CLUSTER_TABLE.csv from ${RepeatExplorer_archive.hid}">
+            <filter>"CLUSTER_TABLE.csv" in file</filter>
+        </data>
+        <data format="tabular" name="supercluster_table"
+              label="SUPERCLUSTER_TABLE.csv from ${RepeatExplorer_archive.hid}">
+            <filter>"SUPERCLUSTER_TABLE.csv" in file</filter>
+        </data>
+        <data format="tabular" name="comparative_analysis_count"
+              label="COMPARATIVE_ANALYSIS_COUNTS.csv from ${RepeatExplorer_archive.hid}">
+            <filter>"COMPARATIVE_ANALYSIS_COUNTS.csv" in file</filter>
+        </data>
+    </outputs>
 </tool>