# HG changeset patch # User iuc # Date 1679604422 0 # Node ID 374cb875d38ad5b0b56bb4a81e6dd7809b6731e2 # Parent ac092723240d6782f13a59b57e48dc9c281d633e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/datamash commit 9edd054251bc74685d627360bb0fbe8ea60fa6a2 diff -r ac092723240d -r 374cb875d38a datamash-transpose.xml --- a/datamash-transpose.xml Fri Jul 01 16:17:42 2022 +0000 +++ b/datamash-transpose.xml Thu Mar 23 20:47:02 2023 +0000 @@ -3,19 +3,57 @@ macros.xml - - + + topic_3570 + + + + + + $out_file + #import os + #set file_size_MB = os.path.getsize(str($in_file)) / (1024 * 1024) + #set size_threshold_MB = 1024 + #if $file_size_MB <= $size_threshold_MB: + datamash transpose @FIELD_SEPARATOR@ < $in_file > $out_file + #else: + ## Input matrix is very big: divide and conquer + ## If the input file is very big, datamash runs out of memory (much earlier than file size ~ available RAM. + ## Split into managable chunks of row vectors, transpose the chunks and juxtapose column vector chunks. + #set num_chunks = 1 + int(file_size_MB/size_threshold_MB) + echo Huge matrix detected, processing in $num_chunks chunks. && + split -n l/$num_chunks $in_file split_input_ && + for chunk in \$(ls split_input*); do + datamash transpose @FIELD_SEPARATOR@ < \$chunk > \${chunk}_transposed; + done && + paste split_input_*_transposed > $out_file + #end if ]]> - + + + + + + + + + + diff -r ac092723240d -r 374cb875d38a macros.xml --- a/macros.xml Fri Jul 01 16:17:42 2022 +0000 +++ b/macros.xml Thu Mar 23 20:47:02 2023 +0000 @@ -1,7 +1,7 @@ - 1.1.0 - 2 - 21.01 + 1.8 + 0 + 22.01 @@ -44,4 +44,14 @@ ----- + + + + @ONLINE{datamash, + title = {GNU Datamash}, + url = {https://www.gnu.org/software/datamash/} + } + + +