Mercurial > repos > nml > collapse_collections
annotate merge.xml @ 7:90981f86000f draft default tip
"planemo upload commit a4a44618ffd955909c0d21d12d73659e9086bdb9"
author | nml |
---|---|
date | Thu, 13 Aug 2020 16:46:16 -0400 |
parents | 830961c48e42 |
children |
rev | line source |
---|---|
7
90981f86000f
"planemo upload commit a4a44618ffd955909c0d21d12d73659e9086bdb9"
nml
parents:
6
diff
changeset
|
1 <tool id="collapse_dataset" name="Collapse Collection" version="5.1.0" profile="16.04"> |
4
25136a2b0cfe
planemo upload commit 0340e76ceab90331dab96f4a6b8a9b7df5b8c1c2
nml
parents:
3
diff
changeset
|
2 <description>into single dataset in order of the collection</description> |
7
90981f86000f
"planemo upload commit a4a44618ffd955909c0d21d12d73659e9086bdb9"
nml
parents:
6
diff
changeset
|
3 <requirements> |
90981f86000f
"planemo upload commit a4a44618ffd955909c0d21d12d73659e9086bdb9"
nml
parents:
6
diff
changeset
|
4 <requirement type="package" version="5.1.0">gawk</requirement> |
90981f86000f
"planemo upload commit a4a44618ffd955909c0d21d12d73659e9086bdb9"
nml
parents:
6
diff
changeset
|
5 </requirements> |
0
49bd84e136c7
planemo upload commit f3c3ccefd8615c32713e0b0e8d231ce5151b2714-dirty
nml
parents:
diff
changeset
|
6 <command> |
1
a78a70d4806c
planemo upload commit b8a959738e856ac80cb2d58423f455337cdd4853
nml
parents:
0
diff
changeset
|
7 <![CDATA[ |
2
4263967e8d40
planemo upload commit ee055b53af5f4a3420b35f3641d45c0559be37fc
nml
parents:
1
diff
changeset
|
8 |
4
25136a2b0cfe
planemo upload commit 0340e76ceab90331dab96f4a6b8a9b7df5b8c1c2
nml
parents:
3
diff
changeset
|
9 ( |
25136a2b0cfe
planemo upload commit 0340e76ceab90331dab96f4a6b8a9b7df5b8c1c2
nml
parents:
3
diff
changeset
|
10 #if $one_header: |
25136a2b0cfe
planemo upload commit 0340e76ceab90331dab96f4a6b8a9b7df5b8c1c2
nml
parents:
3
diff
changeset
|
11 #if $filename.add_name: |
25136a2b0cfe
planemo upload commit 0340e76ceab90331dab96f4a6b8a9b7df5b8c1c2
nml
parents:
3
diff
changeset
|
12 awk '{if (NR==1) {print "Sample\t"$0}}' "$input_list[0]"; |
25136a2b0cfe
planemo upload commit 0340e76ceab90331dab96f4a6b8a9b7df5b8c1c2
nml
parents:
3
diff
changeset
|
13 #else: |
25136a2b0cfe
planemo upload commit 0340e76ceab90331dab96f4a6b8a9b7df5b8c1c2
nml
parents:
3
diff
changeset
|
14 awk '{if (NR==1) {print}}' "$input_list[0]"; |
25136a2b0cfe
planemo upload commit 0340e76ceab90331dab96f4a6b8a9b7df5b8c1c2
nml
parents:
3
diff
changeset
|
15 #end if |
25136a2b0cfe
planemo upload commit 0340e76ceab90331dab96f4a6b8a9b7df5b8c1c2
nml
parents:
3
diff
changeset
|
16 #end if |
25136a2b0cfe
planemo upload commit 0340e76ceab90331dab96f4a6b8a9b7df5b8c1c2
nml
parents:
3
diff
changeset
|
17 |
1
a78a70d4806c
planemo upload commit b8a959738e856ac80cb2d58423f455337cdd4853
nml
parents:
0
diff
changeset
|
18 #for $f in $input_list# |
a78a70d4806c
planemo upload commit b8a959738e856ac80cb2d58423f455337cdd4853
nml
parents:
0
diff
changeset
|
19 #if $filename.add_name: |
3
c0c988378838
planemo upload commit 6bde05f38465311441e89cfa070f03d3b6edad1b
nml
parents:
2
diff
changeset
|
20 #if str($filename.place_name) == "same_once": |
4
25136a2b0cfe
planemo upload commit 0340e76ceab90331dab96f4a6b8a9b7df5b8c1c2
nml
parents:
3
diff
changeset
|
21 #if $one_header: |
25136a2b0cfe
planemo upload commit 0340e76ceab90331dab96f4a6b8a9b7df5b8c1c2
nml
parents:
3
diff
changeset
|
22 printf "$f.element_identifier\t"; tail -q -n +2 "$f"; |
25136a2b0cfe
planemo upload commit 0340e76ceab90331dab96f4a6b8a9b7df5b8c1c2
nml
parents:
3
diff
changeset
|
23 #else: |
6
830961c48e42
"planemo upload commit 9023eff03236d0c02dfa1c303f652cecb77cb09c"
nml
parents:
5
diff
changeset
|
24 printf "$f.element_identifier\t"; awk '{ print $0 } END { if (NR == 0 && NF == 0) { print "" } }' "$f"; |
4
25136a2b0cfe
planemo upload commit 0340e76ceab90331dab96f4a6b8a9b7df5b8c1c2
nml
parents:
3
diff
changeset
|
25 #end if |
3
c0c988378838
planemo upload commit 6bde05f38465311441e89cfa070f03d3b6edad1b
nml
parents:
2
diff
changeset
|
26 #elif str($filename.place_name) == "same_multiple": |
4
25136a2b0cfe
planemo upload commit 0340e76ceab90331dab96f4a6b8a9b7df5b8c1c2
nml
parents:
3
diff
changeset
|
27 #if $one_header: |
25136a2b0cfe
planemo upload commit 0340e76ceab90331dab96f4a6b8a9b7df5b8c1c2
nml
parents:
3
diff
changeset
|
28 awk '{if (NR!=1) {print "$f.element_identifier\t"$0}}' "$f"; |
25136a2b0cfe
planemo upload commit 0340e76ceab90331dab96f4a6b8a9b7df5b8c1c2
nml
parents:
3
diff
changeset
|
29 #else: |
6
830961c48e42
"planemo upload commit 9023eff03236d0c02dfa1c303f652cecb77cb09c"
nml
parents:
5
diff
changeset
|
30 awk '{print "$f.element_identifier\t"$0} END { if (NR == 0 && NF == 0) { print "$f.element_identifier\t" } }' "$f"; |
4
25136a2b0cfe
planemo upload commit 0340e76ceab90331dab96f4a6b8a9b7df5b8c1c2
nml
parents:
3
diff
changeset
|
31 #end if |
3
c0c988378838
planemo upload commit 6bde05f38465311441e89cfa070f03d3b6edad1b
nml
parents:
2
diff
changeset
|
32 #elif str($filename.place_name) == "above": |
4
25136a2b0cfe
planemo upload commit 0340e76ceab90331dab96f4a6b8a9b7df5b8c1c2
nml
parents:
3
diff
changeset
|
33 #if $one_header: |
25136a2b0cfe
planemo upload commit 0340e76ceab90331dab96f4a6b8a9b7df5b8c1c2
nml
parents:
3
diff
changeset
|
34 printf "$f.element_identifier\n"; tail -q -n +2 "$f"; |
25136a2b0cfe
planemo upload commit 0340e76ceab90331dab96f4a6b8a9b7df5b8c1c2
nml
parents:
3
diff
changeset
|
35 #else: |
3
c0c988378838
planemo upload commit 6bde05f38465311441e89cfa070f03d3b6edad1b
nml
parents:
2
diff
changeset
|
36 printf "$f.element_identifier\n"; cat "$f"; |
4
25136a2b0cfe
planemo upload commit 0340e76ceab90331dab96f4a6b8a9b7df5b8c1c2
nml
parents:
3
diff
changeset
|
37 #end if |
1
a78a70d4806c
planemo upload commit b8a959738e856ac80cb2d58423f455337cdd4853
nml
parents:
0
diff
changeset
|
38 #end if |
3
c0c988378838
planemo upload commit 6bde05f38465311441e89cfa070f03d3b6edad1b
nml
parents:
2
diff
changeset
|
39 #else: |
4
25136a2b0cfe
planemo upload commit 0340e76ceab90331dab96f4a6b8a9b7df5b8c1c2
nml
parents:
3
diff
changeset
|
40 #if $one_header: |
25136a2b0cfe
planemo upload commit 0340e76ceab90331dab96f4a6b8a9b7df5b8c1c2
nml
parents:
3
diff
changeset
|
41 awk '{if (NR!=1) {print}}' "$f"; |
25136a2b0cfe
planemo upload commit 0340e76ceab90331dab96f4a6b8a9b7df5b8c1c2
nml
parents:
3
diff
changeset
|
42 #else: |
25136a2b0cfe
planemo upload commit 0340e76ceab90331dab96f4a6b8a9b7df5b8c1c2
nml
parents:
3
diff
changeset
|
43 cat "$f" ; |
25136a2b0cfe
planemo upload commit 0340e76ceab90331dab96f4a6b8a9b7df5b8c1c2
nml
parents:
3
diff
changeset
|
44 #end if |
1
a78a70d4806c
planemo upload commit b8a959738e856ac80cb2d58423f455337cdd4853
nml
parents:
0
diff
changeset
|
45 #end if |
3
c0c988378838
planemo upload commit 6bde05f38465311441e89cfa070f03d3b6edad1b
nml
parents:
2
diff
changeset
|
46 |
1
a78a70d4806c
planemo upload commit b8a959738e856ac80cb2d58423f455337cdd4853
nml
parents:
0
diff
changeset
|
47 #end for# |
a78a70d4806c
planemo upload commit b8a959738e856ac80cb2d58423f455337cdd4853
nml
parents:
0
diff
changeset
|
48 ) |
0
49bd84e136c7
planemo upload commit f3c3ccefd8615c32713e0b0e8d231ce5151b2714-dirty
nml
parents:
diff
changeset
|
49 > $output |
1
a78a70d4806c
planemo upload commit b8a959738e856ac80cb2d58423f455337cdd4853
nml
parents:
0
diff
changeset
|
50 |
a78a70d4806c
planemo upload commit b8a959738e856ac80cb2d58423f455337cdd4853
nml
parents:
0
diff
changeset
|
51 ]]> |
a78a70d4806c
planemo upload commit b8a959738e856ac80cb2d58423f455337cdd4853
nml
parents:
0
diff
changeset
|
52 |
0
49bd84e136c7
planemo upload commit f3c3ccefd8615c32713e0b0e8d231ce5151b2714-dirty
nml
parents:
diff
changeset
|
53 </command> |
49bd84e136c7
planemo upload commit f3c3ccefd8615c32713e0b0e8d231ce5151b2714-dirty
nml
parents:
diff
changeset
|
54 <inputs> |
4
25136a2b0cfe
planemo upload commit 0340e76ceab90331dab96f4a6b8a9b7df5b8c1c2
nml
parents:
3
diff
changeset
|
55 <param name="input_list" type="data" format="data" label="Collection of files to collapse into single dataset" help="" optional="false" multiple="true" /> |
25136a2b0cfe
planemo upload commit 0340e76ceab90331dab96f4a6b8a9b7df5b8c1c2
nml
parents:
3
diff
changeset
|
56 <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."/> |
6
830961c48e42
"planemo upload commit 9023eff03236d0c02dfa1c303f652cecb77cb09c"
nml
parents:
5
diff
changeset
|
57 <conditional name="filename"> |
5
33151a38533a
"planemo upload commit 7b5d3aa437e73ebc4b950c6744055ae1c2196d0e"
nml
parents:
4
diff
changeset
|
58 <param name="add_name" type="boolean" display="checkboxes" label="Prepend File name"/> |
1
a78a70d4806c
planemo upload commit b8a959738e856ac80cb2d58423f455337cdd4853
nml
parents:
0
diff
changeset
|
59 <when value="true"> |
a78a70d4806c
planemo upload commit b8a959738e856ac80cb2d58423f455337cdd4853
nml
parents:
0
diff
changeset
|
60 <param name="place_name" type="select" label="Where to add dataset name"> |
3
c0c988378838
planemo upload commit 6bde05f38465311441e89cfa070f03d3b6edad1b
nml
parents:
2
diff
changeset
|
61 <option value="same_once">Same line and only once per dataset</option> |
c0c988378838
planemo upload commit 6bde05f38465311441e89cfa070f03d3b6edad1b
nml
parents:
2
diff
changeset
|
62 <option value="same_multiple">Same line and each line in dataset</option> |
1
a78a70d4806c
planemo upload commit b8a959738e856ac80cb2d58423f455337cdd4853
nml
parents:
0
diff
changeset
|
63 <option value="above">Line Above</option> |
a78a70d4806c
planemo upload commit b8a959738e856ac80cb2d58423f455337cdd4853
nml
parents:
0
diff
changeset
|
64 </param> |
a78a70d4806c
planemo upload commit b8a959738e856ac80cb2d58423f455337cdd4853
nml
parents:
0
diff
changeset
|
65 </when> |
a78a70d4806c
planemo upload commit b8a959738e856ac80cb2d58423f455337cdd4853
nml
parents:
0
diff
changeset
|
66 <when value='false'> |
a78a70d4806c
planemo upload commit b8a959738e856ac80cb2d58423f455337cdd4853
nml
parents:
0
diff
changeset
|
67 </when> |
a78a70d4806c
planemo upload commit b8a959738e856ac80cb2d58423f455337cdd4853
nml
parents:
0
diff
changeset
|
68 </conditional> |
0
49bd84e136c7
planemo upload commit f3c3ccefd8615c32713e0b0e8d231ce5151b2714-dirty
nml
parents:
diff
changeset
|
69 </inputs> |
49bd84e136c7
planemo upload commit f3c3ccefd8615c32713e0b0e8d231ce5151b2714-dirty
nml
parents:
diff
changeset
|
70 <outputs> |
49bd84e136c7
planemo upload commit f3c3ccefd8615c32713e0b0e8d231ce5151b2714-dirty
nml
parents:
diff
changeset
|
71 <data name="output" format_source="input_list" ></data> |
49bd84e136c7
planemo upload commit f3c3ccefd8615c32713e0b0e8d231ce5151b2714-dirty
nml
parents:
diff
changeset
|
72 </outputs> |
49bd84e136c7
planemo upload commit f3c3ccefd8615c32713e0b0e8d231ce5151b2714-dirty
nml
parents:
diff
changeset
|
73 <tests> |
3
c0c988378838
planemo upload commit 6bde05f38465311441e89cfa070f03d3b6edad1b
nml
parents:
2
diff
changeset
|
74 <test> |
4
25136a2b0cfe
planemo upload commit 0340e76ceab90331dab96f4a6b8a9b7df5b8c1c2
nml
parents:
3
diff
changeset
|
75 <param name="input_list" value="input1,input2"/> |
3
c0c988378838
planemo upload commit 6bde05f38465311441e89cfa070f03d3b6edad1b
nml
parents:
2
diff
changeset
|
76 <output name="output" file="answer.txt"/> |
c0c988378838
planemo upload commit 6bde05f38465311441e89cfa070f03d3b6edad1b
nml
parents:
2
diff
changeset
|
77 </test> |
4
25136a2b0cfe
planemo upload commit 0340e76ceab90331dab96f4a6b8a9b7df5b8c1c2
nml
parents:
3
diff
changeset
|
78 <test> |
25136a2b0cfe
planemo upload commit 0340e76ceab90331dab96f4a6b8a9b7df5b8c1c2
nml
parents:
3
diff
changeset
|
79 <param name="input_list" value="strain1.tsv,strain2.tsv"/> |
25136a2b0cfe
planemo upload commit 0340e76ceab90331dab96f4a6b8a9b7df5b8c1c2
nml
parents:
3
diff
changeset
|
80 <param name="one_header" value="True"/> |
25136a2b0cfe
planemo upload commit 0340e76ceab90331dab96f4a6b8a9b7df5b8c1c2
nml
parents:
3
diff
changeset
|
81 <param name="add_name" value="True"/> |
25136a2b0cfe
planemo upload commit 0340e76ceab90331dab96f4a6b8a9b7df5b8c1c2
nml
parents:
3
diff
changeset
|
82 <param name="place_name" value="same_multiple"/> |
25136a2b0cfe
planemo upload commit 0340e76ceab90331dab96f4a6b8a9b7df5b8c1c2
nml
parents:
3
diff
changeset
|
83 <output name="output" file="answer2.tsv"/> |
25136a2b0cfe
planemo upload commit 0340e76ceab90331dab96f4a6b8a9b7df5b8c1c2
nml
parents:
3
diff
changeset
|
84 </test> |
25136a2b0cfe
planemo upload commit 0340e76ceab90331dab96f4a6b8a9b7df5b8c1c2
nml
parents:
3
diff
changeset
|
85 <test> |
25136a2b0cfe
planemo upload commit 0340e76ceab90331dab96f4a6b8a9b7df5b8c1c2
nml
parents:
3
diff
changeset
|
86 <param name="input_list" value="strain1.tsv,strain2.tsv"/> |
25136a2b0cfe
planemo upload commit 0340e76ceab90331dab96f4a6b8a9b7df5b8c1c2
nml
parents:
3
diff
changeset
|
87 <param name="one_header" value="True"/> |
25136a2b0cfe
planemo upload commit 0340e76ceab90331dab96f4a6b8a9b7df5b8c1c2
nml
parents:
3
diff
changeset
|
88 <output name="output" file="answer3.tsv"/> |
25136a2b0cfe
planemo upload commit 0340e76ceab90331dab96f4a6b8a9b7df5b8c1c2
nml
parents:
3
diff
changeset
|
89 </test> |
25136a2b0cfe
planemo upload commit 0340e76ceab90331dab96f4a6b8a9b7df5b8c1c2
nml
parents:
3
diff
changeset
|
90 |
0
49bd84e136c7
planemo upload commit f3c3ccefd8615c32713e0b0e8d231ce5151b2714-dirty
nml
parents:
diff
changeset
|
91 </tests> |
49bd84e136c7
planemo upload commit f3c3ccefd8615c32713e0b0e8d231ce5151b2714-dirty
nml
parents:
diff
changeset
|
92 <help> |
4
25136a2b0cfe
planemo upload commit 0340e76ceab90331dab96f4a6b8a9b7df5b8c1c2
nml
parents:
3
diff
changeset
|
93 Combines a list collection into a single file dataset with option to include dataset names or merge common header line. |
0
49bd84e136c7
planemo upload commit f3c3ccefd8615c32713e0b0e8d231ce5151b2714-dirty
nml
parents:
diff
changeset
|
94 </help> |
49bd84e136c7
planemo upload commit f3c3ccefd8615c32713e0b0e8d231ce5151b2714-dirty
nml
parents:
diff
changeset
|
95 <citations> |
49bd84e136c7
planemo upload commit f3c3ccefd8615c32713e0b0e8d231ce5151b2714-dirty
nml
parents:
diff
changeset
|
96 </citations> |
49bd84e136c7
planemo upload commit f3c3ccefd8615c32713e0b0e8d231ce5151b2714-dirty
nml
parents:
diff
changeset
|
97 </tool> |