Repository 'collapse_collections'
hg clone https://toolshed.g2.bx.psu.edu/repos/nml/collapse_collections

Changeset 6:830961c48e42 (2020-02-13)
Previous changeset 5:33151a38533a (2019-08-27) Next changeset 7:90981f86000f (2020-08-13)
Commit message:
"planemo upload commit 9023eff03236d0c02dfa1c303f652cecb77cb09c"
modified:
merge.xml
b
diff -r 33151a38533a -r 830961c48e42 merge.xml
--- a/merge.xml Tue Aug 27 12:07:37 2019 -0400
+++ b/merge.xml Thu Feb 13 12:38:44 2020 -0500
[
@@ -1,4 +1,4 @@
-<tool id="collapse_dataset" name="Collapse Collection" version="4.1">
+<tool id="collapse_dataset" name="Collapse Collection" version="4.2">
   <description>into single dataset in order of the collection</description>
   <command>
     <![CDATA[
@@ -18,13 +18,13 @@
          #if $one_header:
            printf "$f.element_identifier\t"; tail -q -n +2 "$f";
          #else:
-           printf "$f.element_identifier\t"; cat "$f";
+           printf "$f.element_identifier\t"; awk '{ print $0 } END { if (NR == 0 && NF == 0) { print "" } }' "$f";
          #end if
        #elif str($filename.place_name) ==  "same_multiple":
          #if $one_header:
            awk '{if (NR!=1) {print "$f.element_identifier\t"$0}}' "$f";
          #else:
-           awk '{print "$f.element_identifier\t"$0}' "$f";
+           awk '{print "$f.element_identifier\t"$0} END { if (NR == 0 && NF == 0) { print "$f.element_identifier\t" } }' "$f";
          #end if
        #elif str($filename.place_name) ==  "above":
          #if $one_header:
@@ -51,8 +51,7 @@
   <inputs>
     <param name="input_list" type="data" format="data" label="Collection of files to collapse into single dataset" help="" optional="false" multiple="true" />
     <param name="one_header" type="boolean" display="checkboxes" label="Keep one header line" help="Combine first line of each file as the header for the final dataset. Useful when same header line is found in all files."/>
-     <conditional name="filename">
-
+    <conditional name="filename">
      <param name="add_name" type="boolean" display="checkboxes" label="Prepend File name"/>
      <when value="true">
        <param name="place_name" type="select" label="Where to add dataset name">