Skip to content

Commit

Permalink
fixed effects, random effects , corrections methods modified and vers…
Browse files Browse the repository at this point in the history
…ion bumped
  • Loading branch information
renu-pal committed Apr 17, 2024
1 parent 3918739 commit 8fa089e
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 24 deletions.
68 changes: 46 additions & 22 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 @@ -51,19 +74,17 @@ Maaslin2.R
'outputFolder'
&&
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_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" 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" 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 All @@ -87,13 +108,13 @@ cd outputFolder && mkdir -p figures/ && cp *.pdf figures
<option value="NEGBIN">NEGBIN</option>
<option value="ZINB">ZINB</option>
</param>
<param argument="--correction" type="select" value="BH" multiple="true" optional="true" label="Correction" help="The correction method for computing the q-value">
<option value="holm">holm</option>
<option value="hochberg">hochberg</option>
<option value="hommel">hommel</option>
<option value="bonferroni">bonferroni</option>
<option value="BH">BH</option>
<option value="BY">BY</option>
<param argument="--correction" type="select" value="BH" multiple="true" optional="true" label="Correction" help="The correction method for computing the q-value ">
<option value="holm">Holm</option>
<option value="hochberg">Hochberg</option>
<option value="hommel">Hommel</option>
<option value="bonferroni">Bonferroni</option>
<option value="BH">Benjamini-Hochberg(BH)</option>
<option value="BY">Benjamini-Yekutieli(BY)</option>
</param>
<param argument="--standardize" type="boolean" truevalue="--standardize TRUE" falsevalue="--standardize FALSE" checked="true" label="Apply z-score so continuous metadata are on the same scale"/>
</section>
Expand Down Expand Up @@ -122,8 +143,8 @@ cd outputFolder && mkdir -p figures/ && cp *.pdf figures
<test expect_num_outputs="5">
<param name="input_data" value="HMP2_taxonomy.tsv"/>
<param name="input_metadata" value="HMP2_metadata.tsv"/>
<param name="random_effects" value="site,subject"/>
<param name="fixed_effects" value="diagnosis,dysbiosisnonIBD,dysbiosisUC,dysbiosisCD,antibiotics,age"/>
<param name="random_effects" value= "c2: site,c5: subject"/>
<param name="fixed_effects" value="c4: diagnosis,c9: dysbiosisnonIBD,c10: dysbiosisUC,c11: dysbiosisCD,c6: antibiotics,c3: age"/>
<section name="additional_options">
<param name="min_abundance" value="0.0"/>
<param name="min_prevalence" value="0.1"/>
Expand Down Expand Up @@ -205,7 +226,7 @@ cd outputFolder && mkdir -p figures/ && cp *.pdf figures
<test expect_num_outputs="5">
<param name="input_data" value="HMP2_taxonomy.tsv"/>
<param name="input_metadata" value="HMP2_metadata.tsv"/>
<param name="fixed_effects" value="diagnosis,dysbiosisnonIBD"/>
<param name="fixed_effects" value="c4: diagnosis,c9: dysbiosisnonIBD"/>
<section name="additional_options">
<param name="min_abundance" value="0.0"/>
<param name="min_prevalence" value="0.1"/>
Expand Down Expand Up @@ -252,7 +273,7 @@ cd outputFolder && mkdir -p figures/ && cp *.pdf figures
<test expect_num_outputs="5">
<param name="input_data" value="HMP2_taxonomy.tsv"/>
<param name="input_metadata" value="HMP2_metadata.tsv"/>
<param name="fixed_effects" value="diagnosis,dysbiosisnonIBD"/>
<param name="fixed_effects" value="c4: diagnosis,c9: dysbiosisnonIBD"/>
<section name="additional_options">
<param name="min_abundance" value="0.0001"/>
<param name="min_prevalence" value="0.1"/>
Expand Down Expand Up @@ -354,6 +375,9 @@ Output
- It only includes associations with q-values <= to the threshold.
- Data frame with residuals for each feature (R data file)
- This file contains a data frame with residuals for each feature.
Correction methods to compute the q-value : https://www.rdocumentation.org/packages/stats/versions/3.6.2/topics/p.adjust
2- Visualization output files
- Heatmap of the significant associations (PDF file)
- This file contains a heatmap of the significant associations.
Expand Down
4 changes: 2 additions & 2 deletions tools/maaslin2/macros.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<macros>
<token name="@TOOL_VERSION@">0.99.12</token>
<token name="@TOOL_VERSION@">1.7.3</token>
<token name="@VERSION_SUFFIX@">0</token>
<token name="@PROFILE@">20.01</token>
<xml name="edam_ontology">
Expand All @@ -21,4 +21,4 @@
<yield/>
</requirements>
</xml>
</macros>
</macros>

0 comments on commit 8fa089e

Please sign in to comment.