Skip to content

Commit

Permalink
Merge pull request #1 from paulzierep/maaslin2-renu
Browse files Browse the repository at this point in the history
fix column name input
  • Loading branch information
renu-pal authored Apr 17, 2024
2 parents ea393cd + d3e43da commit 52ff3d0
Showing 1 changed file with 30 additions and 12 deletions.
42 changes: 30 additions & 12 deletions tools/maaslin2/maaslin2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,29 @@
<expand macro="xrefs"/>
<expand macro="requirements"/>
<command detect_errors="exit_code"><![CDATA[
## 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
#set idx = []
#for $i in $fixed_effects:
#silent idx.append(f'${i}')
#end for
#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 &&
#set idx = []
#for $i in $random_effects:
#silent idx.append(f'${i}')
#end for
#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'
&&
ln -s '$input_metadata' 'input_metadata.tsv'
Expand All @@ -31,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'
Expand All @@ -53,17 +76,12 @@ Maaslin2.R
cd outputFolder && mkdir -p figures/ && cp *.pdf figures
]]></command>
<inputs>
<param name="input_data" type="data" format="tabular" label="Data (or features) file"/>
<param name="input_data" type="data" format="tsv" label="Data (or features) file"/>
<param name="input_metadata" type="data" format="tabular" label="Metadata file"/>
<param argument="--fixed_effects" type="text" multiple="true" optional="true" label="Interactions: Fixed effects" help="The fixed effects for the model, comma-delimited for multiple effects">
<option value="diagnosis" selected="true">diagnosis</option>
<option value="dysbiosisnonIBD" selected="true">dysbiosisnonIBD</option>
<option value="dysbiosisUC" selected="true">dysbiosisUC</option>
<option value="dysbiosisCD" selected="true">dysbiosisCD</option>
<option value="antibiotics" selected="true">antibiotics</option>
<option value="age" selected="true">age</option>
</param>
<param argument="--random_effects" type="text" multiple="true" optional="true" label="Random effects" help="The random effects for the model, comma-delimited for multiple effects"/>

<param argument="--fixed_effects" type="data_column" data_ref="input_metadata" use_header_names="true" multiple="true" optional="true" numerical="false" label="Interactions: Fixed effects" help="The fixed effects for the model, comma-delimited for multiple effects" />
<param argument="--random_effects" type="data_column" data_ref="input_metadata" use_header_names="true" multiple="true" optional="true" numerical="false" label="Random effects" help="The random effects for the model, comma-delimited for multiple effects" />

<section name="additional_options" title="Additional Options" expanded="true">
<param argument="--min_abundance" type="float" value="0.0" optional="true" label="Minimum abundance" help="The minimum abundance for each feature"/>
<param argument="--min_prevalence" type="float" value="0.1" optional="true" label="Minimum prevalence" help="The minimum percent of samples for which a feature is detected at minimum abundance"/>
Expand Down

0 comments on commit 52ff3d0

Please sign in to comment.