# HG changeset patch # User iuc # Date 1523000644 14400 # Node ID a01da64e34a1e18a411740c6bd1a1e7b78528d7f # Parent e1ce461b6dae340f62bb7fbe4e5aa7d9c5c9a954 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/collection_column_join commit 9f1c3ab3f41bab8ff962aca1478c75e538e5bf6a diff -r e1ce461b6dae -r a01da64e34a1 collection_column_join.xml --- a/collection_column_join.xml Wed May 24 06:19:30 2017 -0400 +++ b/collection_column_join.xml Fri Apr 06 03:44:04 2018 -0400 @@ -1,4 +1,4 @@ - + on Collections coreutils @@ -19,12 +19,22 @@ #set $left_identifier_column = $identifier_column #set $tail_offset = int( str( $has_header ) ) + 1 #for $i, $tabular_item in enumerate( $input_tabular ): - #if $has_header: - head -n ${has_header} "${tabular_item}" | awk '{ n = split(\$0,arr,"${delimiter}"); ctr=1; for(i=1;i<=n;i++){ if( i != $identifier_column ){ if( ctr > 1) {printf("${delimiter}")}; printf( "${tabular_item.element_identifier}_%s", arr[i] ); ctr++ } }; printf( "\n" ); }' > input_header.tmp && - tail -n +${tail_offset} "${tabular_item}" | LC_ALL=C sort -t "${delimiter}" -k $identifier_column > input_file.tmp && + #if $old_col_in_header: + #if $has_header: + head -n ${has_header} "${tabular_item}" | awk '{ n = split(\$0,arr,"${delimiter}"); ctr=1; for(i=1;i<=n;i++){ if( i != $identifier_column ){ if( ctr > 1) {printf("${delimiter}")}; printf( "${tabular_item.element_identifier}_%s", arr[i] ); ctr++ } }; printf( "\n" ); }' > input_header.tmp && + tail -n +${tail_offset} "${tabular_item}" | LC_ALL=C sort -t "${delimiter}" -k $identifier_column > input_file.tmp && + #else: + awk '{ n = split(\$0,arr,"${delimiter}"); ctr=1; for(i=1;i<=n;i++){ if( i != $identifier_column ){ if( ctr > 1) {printf("${delimiter}")}; printf( "${tabular_item.element_identifier}_%s", i ); ctr++ } }; exit }' "${tabular_item}" > input_header.tmp && + LC_ALL=C sort -t "${delimiter}" -k $identifier_column "${tabular_item}" > input_file.tmp && + #end if #else: - awk '{ n = split(\$0,arr,"${delimiter}"); ctr=1; for(i=1;i<=n;i++){ if( i != $identifier_column ){ if( ctr > 1) {printf("${delimiter}")}; printf( "${tabular_item.element_identifier}_%s", i ); ctr++ } }; exit }' "${tabular_item}" > input_header.tmp && - LC_ALL=C sort -t "${delimiter}" -k $identifier_column "${tabular_item}" > input_file.tmp && + #if $has_header: + head -n ${has_header} "${tabular_item}" | awk '{ n = split(\$0,arr,"${delimiter}"); ctr=1; for(i=1;i<=n;i++){ if( i != $identifier_column ){ if( ctr > 1) {printf("${delimiter}")}; printf( "${tabular_item.element_identifier}" ); ctr++ } }; printf( "\n" ); }' > input_header.tmp && + tail -n +${tail_offset} "${tabular_item}" | LC_ALL=C sort -t "${delimiter}" -k $identifier_column > input_file.tmp && + #else: + awk '{ n = split(\$0,arr,"${delimiter}"); ctr=1; for(i=1;i<=n;i++){ if( i != $identifier_column ){ if( ctr > 1) {printf("${delimiter}")}; printf( "${tabular_item.element_identifier}"); ctr++ } }; exit }' "${tabular_item}" > input_header.tmp && + LC_ALL=C sort -t "${delimiter}" -k $identifier_column "${tabular_item}" > input_file.tmp && + #end if #end if #if $i == 0: mv input_file.tmp output${ ( $i + 1 ) % 2 }.tmp && @@ -48,6 +58,7 @@ + @@ -64,6 +75,7 @@ + @@ -72,10 +84,29 @@ + + + + + + + + + + + + + + + + + + + diff -r e1ce461b6dae -r a01da64e34a1 test-data/out_3.tabular --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/out_3.tabular Fri Apr 06 03:44:04 2018 -0400 @@ -0,0 +1,4 @@ +#KEY in_1.tabular in_1.tabular in_1.tabular in_2.tabular in_2.tabular in_2.tabular in_3.tabular in_3.tabular in_3.tabular +one 1-1 1-2 1-3 2-1 2-2 2-3 3-3 3-2 3-3 +three 1-7 1-8 1-9 2-7 2-8 2-9 3-7 3-8 3-9 +two 1-4 1-5 1-6 2-4 2-5 2-6 3-4 3-5 3-6 diff -r e1ce461b6dae -r a01da64e34a1 test-data/out_4.tabular --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/out_4.tabular Fri Apr 06 03:44:04 2018 -0400 @@ -0,0 +1,4 @@ +#KEY in_1_headerless.tabular in_1_headerless.tabular in_1_headerless.tabular in_2_headerless.tabular in_2_headerless.tabular in_2_headerless.tabular in_3_headerless.tabular in_3_headerless.tabular in_3_headerless.tabular +one 1-1 1-2 1-3 2-1 2-2 2-3 3-3 3-2 3-3 +three 1-7 1-8 1-9 2-7 2-8 2-9 3-7 3-8 3-9 +two 1-4 1-5 1-6 2-4 2-5 2-6 3-4 3-5 3-6