From 0024dfd7d3629aaf16c88d08bb2b8cd5c91c4bd0 Mon Sep 17 00:00:00 2001 From: paulzierep Date: Tue, 16 Apr 2024 10:56:52 +0200 Subject: [PATCH 1/2] fix column name input --- tools/maaslin2/maaslin2.xml | 37 +++++++++++++++++++++++++++---------- 1 file changed, 27 insertions(+), 10 deletions(-) diff --git a/tools/maaslin2/maaslin2.xml b/tools/maaslin2/maaslin2.xml index 51c1fdee756..40c1b1a4ede 100644 --- a/tools/maaslin2/maaslin2.xml +++ b/tools/maaslin2/maaslin2.xml @@ -7,6 +7,28 @@ - + - - - - - - - - - + + + +
From d3e43dae4e1d018767bb3199019242420cb97a90 Mon Sep 17 00:00:00 2001 From: paulzierep Date: Tue, 16 Apr 2024 12:27:48 +0200 Subject: [PATCH 2/2] update --- tools/maaslin2/maaslin2.xml | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/tools/maaslin2/maaslin2.xml b/tools/maaslin2/maaslin2.xml index 40c1b1a4ede..01b209e6e46 100644 --- a/tools/maaslin2/maaslin2.xml +++ b/tools/maaslin2/maaslin2.xml @@ -10,24 +10,25 @@ ## get column names of fixed and random effect from the input file, since galaxy ## can only return indices with type="data_column" +## using awk so that the file is only parsed on command line execution -## get header -#set $input = open(str($input_metadata), 'r') -#set $header = $input.readlines()[0].split('\t') - -## get fixed effects -#set $fixed_effects_val = [] +#set idx = [] #for $i in $fixed_effects: - #silent $fixed_effects_val.append($header[int($i)]) + #silent idx.append(f'${i}') #end for -#set $fixed_effects = ','.join($fixed_effects_val) +#set idx_for_awk = ','.join(idx) + +fixed_effects=`awk -v OFS=',' -F"\t" 'NR == 1 { print $idx_for_awk}' '$input_metadata'` && +echo 'Assigned fixed effects as:' \$fixed_effects && -## get random effects -#set $random_effects_val = [] +#set idx = [] #for $i in $random_effects: - #silent $random_effects_val.append($header[int($i)]) + #silent idx.append(f'${i}') #end for -#set $random_effects = ','.join($random_effects_val) +#set idx_for_awk = ','.join(idx) + +random_effects=`awk -v OFS=',' -F"\t" 'NR == 1 { print $idx_for_awk}' '$input_metadata'` && +echo 'Assigned random effects as:' \$random_effects && ln -s '$input_data' 'input_data.tsv' && @@ -53,10 +54,10 @@ Maaslin2.R --analysis_method '$additional_options.analysis_method' #end if #if $random_effects - --random_effects '$random_effects' + --random_effects \$random_effects #end if #if $fixed_effects - --fixed_effects '$fixed_effects' + --fixed_effects \$fixed_effects #end if #if $additional_options.correction --correction '$additional_options.correction'