Mercurial > repos > iuc > datamash_transpose
comparison datamash-transpose.xml @ 9:a1cdc32ea989 draft
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 9edd054251bc74685d627360bb0fbe8ea60fa6a2
| author | iuc |
|---|---|
| date | Thu, 23 Mar 2023 20:46:30 +0000 |
| parents | 70522b458053 |
| children | 3dcdff1ab5ac |
comparison
equal
deleted
inserted
replaced
| 8:6b5617f5d4ce | 9:a1cdc32ea989 |
|---|---|
| 1 <tool id="datamash_transpose" name="Transpose" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@"> | 1 <tool id="datamash_transpose" name="Transpose" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@"> |
| 2 <description>rows/columns in a tabular file</description> | 2 <description>rows/columns in a tabular file</description> |
| 3 <macros> | 3 <macros> |
| 4 <import>macros.xml</import> | 4 <import>macros.xml</import> |
| 5 </macros> | 5 </macros> |
| 6 <expand macro="requirements" /> | 6 <edam_topics> |
| 7 <expand macro="stdio" /> | 7 <edam_topic>topic_3570</edam_topic> <!-- Pure math / linear algebra --> |
| 8 </edam_topics> | |
| 9 <edam_operations> | |
| 10 <!-- <edam_operation>operation_1234</edam_operation> --> | |
| 11 </edam_operations> | |
| 12 <expand macro="requirements"/> | |
| 13 <expand macro="stdio"/> | |
| 8 <command><![CDATA[ | 14 <command><![CDATA[ |
| 9 datamash transpose | 15 #import os |
| 10 @FIELD_SEPARATOR@ | 16 #set file_size_MB = os.path.getsize(str($in_file)) / (1024 * 1024) |
| 11 < $in_file > $out_file | 17 #set size_threshold_MB = 1024 |
| 18 #if $file_size_MB <= $size_threshold_MB: | |
| 19 datamash transpose @FIELD_SEPARATOR@ < $in_file > $out_file | |
| 20 #else: | |
| 21 ## Input matrix is very big: divide and conquer | |
| 22 ## If the input file is very big, datamash runs out of memory (much earlier than file size ~ available RAM. | |
| 23 ## Split into managable chunks of row vectors, transpose the chunks and juxtapose column vector chunks. | |
| 24 #set num_chunks = 1 + int(file_size_MB/size_threshold_MB) | |
| 25 echo Huge matrix detected, processing in $num_chunks chunks. && | |
| 26 split -n l/$num_chunks $in_file split_input_ && | |
| 27 for chunk in \$(ls split_input*); do | |
| 28 datamash transpose @FIELD_SEPARATOR@ < \$chunk > \${chunk}_transposed; | |
| 29 done && | |
| 30 paste split_input_*_transposed > $out_file | |
| 31 #end if | |
| 12 ]]></command> | 32 ]]></command> |
| 13 <expand macro="inputs_outputs" /> | 33 <expand macro="inputs_outputs"/> |
| 14 <tests> | 34 <tests> |
| 35 <test expect_num_outputs="1"> | |
| 36 <param name="in_file" value="datamash_transpose_input.txt"/> | |
| 37 <output file="datamash_transpose_output.txt" name="out_file"/> | |
| 38 </test> | |
| 39 <!-- Test for transposing an extremely big input matrix | |
| 40 Disabled to keep the repository size reasonable. | |
| 41 For testing, manually download a pathological in- and output from: | |
| 42 https://usegalaxy.eu/u/tunc/h/very-big-scrna-matrix | |
| 43 --> | |
| 44 <!-- | |
| 15 <test> | 45 <test> |
| 16 <param name="in_file" value="datamash_transpose_input.txt" /> | 46 <param name="in_file" value="big.tabular"/> |
| 17 <output file="datamash_transpose_output.txt" name="out_file" /> | 47 <output file="transposed_big.tabular" name="out_file"/> |
| 18 </test> | 48 </test> |
| 49 --> | |
| 50 <!-- transpose(transpose(A)) = A --> | |
| 51 <!-- | |
| 52 <test> | |
| 53 <param name="in_file" value="transposed_big.tabular"/> | |
| 54 <output file="big.tabular" name="out_file"/> | |
| 55 </test> | |
| 56 --> | |
| 19 </tests> | 57 </tests> |
| 20 <help> | 58 <help> |
| 21 <![CDATA[ | 59 <![CDATA[ |
| 22 @HELP_HEADER@ | 60 @HELP_HEADER@ |
| 23 | 61 |
| 43 HH B3 490 | 81 HH B3 490 |
| 44 | 82 |
| 45 @HELP_FOOTER@ | 83 @HELP_FOOTER@ |
| 46 ]]> | 84 ]]> |
| 47 </help> | 85 </help> |
| 86 <expand macro="citation"/> | |
| 48 </tool> | 87 </tool> |
