annotate datamash-transpose.xml @ 6:a513e3fbb4c5 draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 2214890e6a31af0d1157373e81fc93c4626cb415
author iuc
date Thu, 09 Nov 2023 12:01:09 +0000
parents 374cb875d38a
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3
ba0c40780ecf "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 206ac70388ea11b168366f1e30bb44157e371c6e"
iuc
parents: 2
diff changeset
1 <tool id="datamash_transpose" name="Transpose" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@">
0
60e287a6d17d planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 8a7a779896ce1b9b296557a2c31bd93f5fbb5462
iuc
parents:
diff changeset
2 <description>rows/columns in a tabular file</description>
60e287a6d17d planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 8a7a779896ce1b9b296557a2c31bd93f5fbb5462
iuc
parents:
diff changeset
3 <macros>
60e287a6d17d planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 8a7a779896ce1b9b296557a2c31bd93f5fbb5462
iuc
parents:
diff changeset
4 <import>macros.xml</import>
6
a513e3fbb4c5 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 2214890e6a31af0d1157373e81fc93c4626cb415
iuc
parents: 5
diff changeset
5 <token name="@VERSION_SUFFIX@">1</token>
0
60e287a6d17d planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 8a7a779896ce1b9b296557a2c31bd93f5fbb5462
iuc
parents:
diff changeset
6 </macros>
5
374cb875d38a planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 9edd054251bc74685d627360bb0fbe8ea60fa6a2
iuc
parents: 3
diff changeset
7 <edam_topics>
374cb875d38a planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 9edd054251bc74685d627360bb0fbe8ea60fa6a2
iuc
parents: 3
diff changeset
8 <edam_topic>topic_3570</edam_topic> <!-- Pure math / linear algebra -->
374cb875d38a planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 9edd054251bc74685d627360bb0fbe8ea60fa6a2
iuc
parents: 3
diff changeset
9 </edam_topics>
374cb875d38a planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 9edd054251bc74685d627360bb0fbe8ea60fa6a2
iuc
parents: 3
diff changeset
10 <edam_operations>
374cb875d38a planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 9edd054251bc74685d627360bb0fbe8ea60fa6a2
iuc
parents: 3
diff changeset
11 <!-- <edam_operation>operation_1234</edam_operation> -->
374cb875d38a planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 9edd054251bc74685d627360bb0fbe8ea60fa6a2
iuc
parents: 3
diff changeset
12 </edam_operations>
374cb875d38a planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 9edd054251bc74685d627360bb0fbe8ea60fa6a2
iuc
parents: 3
diff changeset
13 <expand macro="requirements"/>
374cb875d38a planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 9edd054251bc74685d627360bb0fbe8ea60fa6a2
iuc
parents: 3
diff changeset
14 <expand macro="stdio"/>
3
ba0c40780ecf "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 206ac70388ea11b168366f1e30bb44157e371c6e"
iuc
parents: 2
diff changeset
15 <command><![CDATA[
5
374cb875d38a planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 9edd054251bc74685d627360bb0fbe8ea60fa6a2
iuc
parents: 3
diff changeset
16 #import os
6
a513e3fbb4c5 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 2214890e6a31af0d1157373e81fc93c4626cb415
iuc
parents: 5
diff changeset
17 #set file_size_MB = $in_file.get_size() / (1024 * 1024)
5
374cb875d38a planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 9edd054251bc74685d627360bb0fbe8ea60fa6a2
iuc
parents: 3
diff changeset
18 #set size_threshold_MB = 1024
374cb875d38a planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 9edd054251bc74685d627360bb0fbe8ea60fa6a2
iuc
parents: 3
diff changeset
19 #if $file_size_MB <= $size_threshold_MB:
374cb875d38a planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 9edd054251bc74685d627360bb0fbe8ea60fa6a2
iuc
parents: 3
diff changeset
20 datamash transpose @FIELD_SEPARATOR@ < $in_file > $out_file
374cb875d38a planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 9edd054251bc74685d627360bb0fbe8ea60fa6a2
iuc
parents: 3
diff changeset
21 #else:
374cb875d38a planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 9edd054251bc74685d627360bb0fbe8ea60fa6a2
iuc
parents: 3
diff changeset
22 ## Input matrix is very big: divide and conquer
374cb875d38a planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 9edd054251bc74685d627360bb0fbe8ea60fa6a2
iuc
parents: 3
diff changeset
23 ## If the input file is very big, datamash runs out of memory (much earlier than file size ~ available RAM.
374cb875d38a planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 9edd054251bc74685d627360bb0fbe8ea60fa6a2
iuc
parents: 3
diff changeset
24 ## Split into managable chunks of row vectors, transpose the chunks and juxtapose column vector chunks.
374cb875d38a planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 9edd054251bc74685d627360bb0fbe8ea60fa6a2
iuc
parents: 3
diff changeset
25 #set num_chunks = 1 + int(file_size_MB/size_threshold_MB)
374cb875d38a planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 9edd054251bc74685d627360bb0fbe8ea60fa6a2
iuc
parents: 3
diff changeset
26 echo Huge matrix detected, processing in $num_chunks chunks. &&
374cb875d38a planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 9edd054251bc74685d627360bb0fbe8ea60fa6a2
iuc
parents: 3
diff changeset
27 split -n l/$num_chunks $in_file split_input_ &&
374cb875d38a planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 9edd054251bc74685d627360bb0fbe8ea60fa6a2
iuc
parents: 3
diff changeset
28 for chunk in \$(ls split_input*); do
374cb875d38a planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 9edd054251bc74685d627360bb0fbe8ea60fa6a2
iuc
parents: 3
diff changeset
29 datamash transpose @FIELD_SEPARATOR@ < \$chunk > \${chunk}_transposed;
374cb875d38a planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 9edd054251bc74685d627360bb0fbe8ea60fa6a2
iuc
parents: 3
diff changeset
30 done &&
374cb875d38a planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 9edd054251bc74685d627360bb0fbe8ea60fa6a2
iuc
parents: 3
diff changeset
31 paste split_input_*_transposed > $out_file
374cb875d38a planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 9edd054251bc74685d627360bb0fbe8ea60fa6a2
iuc
parents: 3
diff changeset
32 #end if
3
ba0c40780ecf "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 206ac70388ea11b168366f1e30bb44157e371c6e"
iuc
parents: 2
diff changeset
33 ]]></command>
5
374cb875d38a planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 9edd054251bc74685d627360bb0fbe8ea60fa6a2
iuc
parents: 3
diff changeset
34 <expand macro="inputs_outputs"/>
0
60e287a6d17d planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 8a7a779896ce1b9b296557a2c31bd93f5fbb5462
iuc
parents:
diff changeset
35 <tests>
5
374cb875d38a planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 9edd054251bc74685d627360bb0fbe8ea60fa6a2
iuc
parents: 3
diff changeset
36 <test expect_num_outputs="1">
374cb875d38a planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 9edd054251bc74685d627360bb0fbe8ea60fa6a2
iuc
parents: 3
diff changeset
37 <param name="in_file" value="datamash_transpose_input.txt"/>
374cb875d38a planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 9edd054251bc74685d627360bb0fbe8ea60fa6a2
iuc
parents: 3
diff changeset
38 <output file="datamash_transpose_output.txt" name="out_file"/>
374cb875d38a planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 9edd054251bc74685d627360bb0fbe8ea60fa6a2
iuc
parents: 3
diff changeset
39 </test>
374cb875d38a planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 9edd054251bc74685d627360bb0fbe8ea60fa6a2
iuc
parents: 3
diff changeset
40 <!-- Test for transposing an extremely big input matrix
374cb875d38a planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 9edd054251bc74685d627360bb0fbe8ea60fa6a2
iuc
parents: 3
diff changeset
41 Disabled to keep the repository size reasonable.
374cb875d38a planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 9edd054251bc74685d627360bb0fbe8ea60fa6a2
iuc
parents: 3
diff changeset
42 For testing, manually download a pathological in- and output from:
374cb875d38a planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 9edd054251bc74685d627360bb0fbe8ea60fa6a2
iuc
parents: 3
diff changeset
43 https://usegalaxy.eu/u/tunc/h/very-big-scrna-matrix
374cb875d38a planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 9edd054251bc74685d627360bb0fbe8ea60fa6a2
iuc
parents: 3
diff changeset
44 -->
374cb875d38a planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 9edd054251bc74685d627360bb0fbe8ea60fa6a2
iuc
parents: 3
diff changeset
45 <!--
0
60e287a6d17d planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 8a7a779896ce1b9b296557a2c31bd93f5fbb5462
iuc
parents:
diff changeset
46 <test>
5
374cb875d38a planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 9edd054251bc74685d627360bb0fbe8ea60fa6a2
iuc
parents: 3
diff changeset
47 <param name="in_file" value="big.tabular"/>
374cb875d38a planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 9edd054251bc74685d627360bb0fbe8ea60fa6a2
iuc
parents: 3
diff changeset
48 <output file="transposed_big.tabular" name="out_file"/>
0
60e287a6d17d planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 8a7a779896ce1b9b296557a2c31bd93f5fbb5462
iuc
parents:
diff changeset
49 </test>
5
374cb875d38a planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 9edd054251bc74685d627360bb0fbe8ea60fa6a2
iuc
parents: 3
diff changeset
50 -->
374cb875d38a planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 9edd054251bc74685d627360bb0fbe8ea60fa6a2
iuc
parents: 3
diff changeset
51 <!-- transpose(transpose(A)) = A -->
374cb875d38a planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 9edd054251bc74685d627360bb0fbe8ea60fa6a2
iuc
parents: 3
diff changeset
52 <!--
374cb875d38a planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 9edd054251bc74685d627360bb0fbe8ea60fa6a2
iuc
parents: 3
diff changeset
53 <test>
374cb875d38a planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 9edd054251bc74685d627360bb0fbe8ea60fa6a2
iuc
parents: 3
diff changeset
54 <param name="in_file" value="transposed_big.tabular"/>
374cb875d38a planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 9edd054251bc74685d627360bb0fbe8ea60fa6a2
iuc
parents: 3
diff changeset
55 <output file="big.tabular" name="out_file"/>
374cb875d38a planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 9edd054251bc74685d627360bb0fbe8ea60fa6a2
iuc
parents: 3
diff changeset
56 </test>
374cb875d38a planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 9edd054251bc74685d627360bb0fbe8ea60fa6a2
iuc
parents: 3
diff changeset
57 -->
0
60e287a6d17d planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 8a7a779896ce1b9b296557a2c31bd93f5fbb5462
iuc
parents:
diff changeset
58 </tests>
60e287a6d17d planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 8a7a779896ce1b9b296557a2c31bd93f5fbb5462
iuc
parents:
diff changeset
59 <help>
60e287a6d17d planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 8a7a779896ce1b9b296557a2c31bd93f5fbb5462
iuc
parents:
diff changeset
60 <![CDATA[
60e287a6d17d planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 8a7a779896ce1b9b296557a2c31bd93f5fbb5462
iuc
parents:
diff changeset
61 @HELP_HEADER@
60e287a6d17d planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 8a7a779896ce1b9b296557a2c31bd93f5fbb5462
iuc
parents:
diff changeset
62
60e287a6d17d planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 8a7a779896ce1b9b296557a2c31bd93f5fbb5462
iuc
parents:
diff changeset
63 **Syntax**
60e287a6d17d planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 8a7a779896ce1b9b296557a2c31bd93f5fbb5462
iuc
parents:
diff changeset
64
60e287a6d17d planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 8a7a779896ce1b9b296557a2c31bd93f5fbb5462
iuc
parents:
diff changeset
65 This tools transposes (swaps) rows/columns in a tabular input file.
60e287a6d17d planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 8a7a779896ce1b9b296557a2c31bd93f5fbb5462
iuc
parents:
diff changeset
66
60e287a6d17d planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 8a7a779896ce1b9b296557a2c31bd93f5fbb5462
iuc
parents:
diff changeset
67 -----
60e287a6d17d planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 8a7a779896ce1b9b296557a2c31bd93f5fbb5462
iuc
parents:
diff changeset
68
60e287a6d17d planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 8a7a779896ce1b9b296557a2c31bd93f5fbb5462
iuc
parents:
diff changeset
69 **Example**
60e287a6d17d planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 8a7a779896ce1b9b296557a2c31bd93f5fbb5462
iuc
parents:
diff changeset
70
60e287a6d17d planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 8a7a779896ce1b9b296557a2c31bd93f5fbb5462
iuc
parents:
diff changeset
71 Input file::
60e287a6d17d planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 8a7a779896ce1b9b296557a2c31bd93f5fbb5462
iuc
parents:
diff changeset
72
60e287a6d17d planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 8a7a779896ce1b9b296557a2c31bd93f5fbb5462
iuc
parents:
diff changeset
73 Genes NOX1 DcP HH
60e287a6d17d planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 8a7a779896ce1b9b296557a2c31bd93f5fbb5462
iuc
parents:
diff changeset
74 Sample A1 A2 B3
60e287a6d17d planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 8a7a779896ce1b9b296557a2c31bd93f5fbb5462
iuc
parents:
diff changeset
75 Counts 514 542 490
60e287a6d17d planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 8a7a779896ce1b9b296557a2c31bd93f5fbb5462
iuc
parents:
diff changeset
76
60e287a6d17d planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 8a7a779896ce1b9b296557a2c31bd93f5fbb5462
iuc
parents:
diff changeset
77 Output file::
60e287a6d17d planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 8a7a779896ce1b9b296557a2c31bd93f5fbb5462
iuc
parents:
diff changeset
78
60e287a6d17d planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 8a7a779896ce1b9b296557a2c31bd93f5fbb5462
iuc
parents:
diff changeset
79 Genes Sample Counts
60e287a6d17d planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 8a7a779896ce1b9b296557a2c31bd93f5fbb5462
iuc
parents:
diff changeset
80 NOX1 A1 514
60e287a6d17d planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 8a7a779896ce1b9b296557a2c31bd93f5fbb5462
iuc
parents:
diff changeset
81 DcP A2 542
60e287a6d17d planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 8a7a779896ce1b9b296557a2c31bd93f5fbb5462
iuc
parents:
diff changeset
82 HH B3 490
60e287a6d17d planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 8a7a779896ce1b9b296557a2c31bd93f5fbb5462
iuc
parents:
diff changeset
83
60e287a6d17d planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 8a7a779896ce1b9b296557a2c31bd93f5fbb5462
iuc
parents:
diff changeset
84 @HELP_FOOTER@
60e287a6d17d planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 8a7a779896ce1b9b296557a2c31bd93f5fbb5462
iuc
parents:
diff changeset
85 ]]>
60e287a6d17d planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 8a7a779896ce1b9b296557a2c31bd93f5fbb5462
iuc
parents:
diff changeset
86 </help>
5
374cb875d38a planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 9edd054251bc74685d627360bb0fbe8ea60fa6a2
iuc
parents: 3
diff changeset
87 <expand macro="citation"/>
0
60e287a6d17d planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 8a7a779896ce1b9b296557a2c31bd93f5fbb5462
iuc
parents:
diff changeset
88 </tool>