Skip to content

Commit

Permalink
Add bio.tools for metaquantome (#747)
Browse files Browse the repository at this point in the history
* Add bio.tools for metaquantome

* lints and tests

---------

Co-authored-by: Björn Grüning <bjoern.gruening@gmail.com>
  • Loading branch information
bebatut and bgruening authored Mar 18, 2024
1 parent 63cff07 commit ec66b5b
Show file tree
Hide file tree
Showing 7 changed files with 412 additions and 437 deletions.
47 changes: 26 additions & 21 deletions tools/metaquantome/macros.xml
Original file line number Diff line number Diff line change
@@ -1,32 +1,37 @@
<macros>
<token name="@TOOL_VERSION@">2.0.2</token>
<token name="@VERSION_SUFFIX@">0</token>
<xml name="xrefs">
<xrefs>
<xref type="bio.tools">metaQuantome</xref>
</xrefs>
</xml>
<xml name="requirements">
<requirements>
<requirement type="package" version="@TOOL_VERSION@">metaquantome</requirement>
<requirement type="package" version="@TOOL_VERSION@">metaquantome</requirement>
<yield/>
</requirements>
</xml>
<xml name="db">
<param argument="db_tar" type="data" label="Database Archive File"/>
<param argument="db_tar" type="data" label="Database Archive File"/>
</xml>
<xml name="ONTOLOGY_ARGS">
<conditional name="ontology_args">
<param name="ontology" type="select" label="Ontology">
<option value="go">Gene Ontology (GO terms)</option>
<option value="ec">Enzyme Commission (EC) numbers</option>
<option value="cog">Clusters of Orthologous Groups (COG categories)</option>
</param>
<when value="go">
<param argument="--slim_down" type="boolean" label="Use slim GO"/>
</when>
<when value="ec">
<!-- do nothing -->
</when>
<when value="cog">
<!-- do nothing -->
</when>
</conditional>
<conditional name="ontology_args">
<param name="ontology" type="select" label="Ontology">
<option value="go">Gene Ontology (GO terms)</option>
<option value="ec">Enzyme Commission (EC) numbers</option>
<option value="cog">Clusters of Orthologous Groups (COG categories)</option>
</param>
<when value="go">
<param argument="--slim_down" type="boolean" label="Use slim GO"/>
</when>
<when value="ec">
<!-- do nothing -->
</when>
<when value="cog">
<!-- do nothing -->
</when>
</conditional>
</xml>
<token name="@COMMON_PARAMS@"><![CDATA[
--samps '$samps'
Expand All @@ -40,12 +45,12 @@
]]>
</token>
<xml name="SAMPS">
<param name="samps" type="data" format="tabular" label="Samples file"
help="must be created by 'metaQuantome: create samples file'"/>
<param name="samps" type="data" format="tabular" label="Samples file" help="must be created by 'metaQuantome: create samples file'"/>
</xml>
<xml name="citations">
<citations>
<yield />
<citation type="doi">10.1021/ACS.JPROTEOME.0C00960</citation>
<yield/>
</citations>
</xml>
</macros>
32 changes: 16 additions & 16 deletions tools/metaquantome/metaquantome_db.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
<macros>
<import>macros.xml</import>
</macros>
<expand macro="requirements" />
<expand macro="xrefs"/>
<expand macro="requirements"/>
<command detect_errors="exit_code"><![CDATA[
mkdir -p data &&
#set $database_list = str($databases).split(',')
Expand All @@ -14,26 +15,25 @@
tar --create --file '$outfile' data
]]></command>
<inputs>
<param name="databases" type="select" multiple="True" display="checkboxes"
label="Databases to Download">
<option value="ncbi" selected="true">NCBI Taxonomy Database</option>
<option value="go" selected="true">Gene Ontology Database</option>
<option value="ec" selected="true">Enzyme Commission (EC) database</option>
<param name="databases" type="select" multiple="True" display="checkboxes" label="Databases to Download">
<option value="ncbi" selected="true">NCBI Taxonomy Database</option>
<option value="go" selected="true">Gene Ontology Database</option>
<option value="ec" selected="true">Enzyme Commission (EC) database</option>
</param>
</inputs>
<outputs>
<data format="tar" name="outfile" label="metaquantome databases"/>
</outputs>
<tests>
<test>
<param name="databases" value="go"/>
<output name="outfile">
<assert_contents>
<has_text text="ontology: go"/>
<has_text text="ontology: go/subsets/goslim_metagenomics"/>
</assert_contents>
</output>
</test>
<test>
<param name="databases" value="go"/>
<output name="outfile">
<assert_contents>
<has_text text="ontology: go"/>
<has_text text="ontology: go/subsets/goslim_metagenomics"/>
</assert_contents>
</output>
</test>
</tests>
<help>
<![CDATA[
Expand Down Expand Up @@ -69,5 +69,5 @@ Questions, Comments, Problems, Kudos
Please file any issues at https://github.com/galaxyproteomics/tools-galaxyp/issues.
]]></help>
<expand macro="citations" />
<expand macro="citations"/>
</tool>
208 changes: 101 additions & 107 deletions tools/metaquantome/metaquantome_expand.xml
Original file line number Diff line number Diff line change
@@ -1,78 +1,75 @@
<tool id="metaquantome_expand" name="metaQuantome: expand" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@">
<description>a set of functional or taxonomy annotations</description>
<macros>
<import>macros.xml</import>
<xml name="FUNC_FILE">
<param argument="--func_file" type="data" format="tabular" label="Functional file"
help="Tabular file with a peptide sequence column and a functional assignment column with GO terms, EC number, or COG."/>
<param argument="--pep_colname_func" type="text" label="Functional file: peptide column name" value="peptide"
help="The column name within the function file that corresponds to the peptide sequences">
<validator type="empty_field"/>
</param>
</xml>
<xml name="FUNC_COLNAME">
<param argument="--func_colname" type="text" label="Functional column name"
help="The column name within the function file with the functional terms">
<validator type="empty_field"/>
</param>
</xml>
<xml name="TAX_FILE">
<param argument="--tax_file" type="data" format="tabular" label="Taxonomy assignments file"/>
<param argument="--pep_colname_tax" type="text" label="Taxonomy file: peptide column name" value="peptide"
help="The column name within the taxonomy file that corresponds to the peptide sequences">
<validator type="empty_field"/>
</param>
</xml>
<xml name="TAX_COLNAME">
<param argument="--tax_colname" type="text" label="Taxonomy column name">
<help>
<description>a set of functional or taxonomy annotations</description>
<macros>
<import>macros.xml</import>
<xml name="FUNC_FILE">
<param argument="--func_file" type="data" format="tabular" label="Functional file" help="Tabular file with a peptide sequence column and a functional assignment column with GO terms, EC number, or COG."/>
<param argument="--pep_colname_func" type="text" label="Functional file: peptide column name" value="peptide" help="The column name within the function file that corresponds to the peptide sequences">
<validator type="empty_field"/>
</param>
</xml>
<xml name="FUNC_COLNAME">
<param argument="--func_colname" type="text" label="Functional column name" help="The column name within the function file with the functional terms">
<validator type="empty_field"/>
</param>
</xml>
<xml name="TAX_FILE">
<param argument="--tax_file" type="data" format="tabular" label="Taxonomy assignments file"/>
<param argument="--pep_colname_tax" type="text" label="Taxonomy file: peptide column name" value="peptide" help="The column name within the taxonomy file that corresponds to the peptide sequences">
<validator type="empty_field"/>
</param>
</xml>
<xml name="TAX_COLNAME">
<param argument="--tax_colname" type="text" label="Taxonomy column name">
<help>
Name of column in taxonomy annotation file that contains
the lowest common ancestor (LCA) annotation. The annotations must
be either NCBI taxids (strongly preferred) or taxonomy
names.
</help>
<validator type="empty_field"/>
</param>
</xml>
<xml name="FT_TAR_RANK">
<param argument="--ft_tar_rank" type="select" label="rank at which to group taxonomy">
<option value="species">species</option>
<option value="genus" selected="true">genus</option>
<option value="family">family</option>
<option value="order">order</option>
<option value="class">class</option>
<option value="phylum">phylum</option>
<option value="kingdom">kingdom</option>
</param>
</xml>
<token name="@FUNC_FILE@">
<validator type="empty_field"/>
</param>
</xml>
<xml name="FT_TAR_RANK">
<param argument="--ft_tar_rank" type="select" label="rank at which to group taxonomy">
<option value="species">species</option>
<option value="genus" selected="true">genus</option>
<option value="family">family</option>
<option value="order">order</option>
<option value="class">class</option>
<option value="phylum">phylum</option>
<option value="kingdom">kingdom</option>
</param>
</xml>
<token name="@FUNC_FILE@">
--func_file='$mode_args.func_file'
--pep_colname_func='$mode_args.pep_colname_func'
</token>
<token name="@FUNC_COLNAME@">
<token name="@FUNC_COLNAME@">
--func_colname='$mode_args.func_colname'
</token>
<token name="@ONTOLOGY@">
<token name="@ONTOLOGY@">
--ontology='$mode_args.ontology_args.ontology'
#if $mode_args.ontology_args.ontology == 'go'
#if $mode_args.ontology_args.slim_down
--slim_down
#end if
#end if
</token>
<token name="@TAX_FILE@">
<token name="@TAX_FILE@">
--tax_file='$mode_args.tax_file'
--pep_colname_tax='$mode_args.pep_colname_tax'
</token>
<token name="@TAX_COLNAME@">
<token name="@TAX_COLNAME@">
--tax_colname='$mode_args.tax_colname'
</token>
<token name="@FT_TAR_RANK@">
<token name="@FT_TAR_RANK@">
--ft_tar_rank='$mode_args.ft_tar_rank'
</token>
</macros>
<expand macro="requirements" />
<command detect_errors="exit_code"><![CDATA[
</macros>
<expand macro="xrefs"/>
<expand macro="requirements"/>
<command detect_errors="exit_code"><![CDATA[
tar -xf '$db_tar' &&
metaquantome expand
--data_dir ./data
Expand All @@ -97,63 +94,60 @@
#end if
--outfile='$outfile'
]]></command>
<inputs>
<param name="db_tar" type="data" format="tar" label="Database Archive File"
help="must be created by 'metaQuantome: download'"/>
<expand macro="SAMPS"/>
<conditional name="mode_args">
<param argument="--mode" type="select" label="Mode">
<option value="f">Functional analysis</option>
<option value="t">Taxonomic analysis</option>
<option value="ft">Functional-taxonomic interaction analysis</option>
<inputs>
<param name="db_tar" type="data" format="tar" label="Database Archive File" help="must be created by 'metaQuantome: download'"/>
<expand macro="SAMPS"/>
<conditional name="mode_args">
<param argument="--mode" type="select" label="Mode">
<option value="f">Functional analysis</option>
<option value="t">Taxonomic analysis</option>
<option value="ft">Functional-taxonomic interaction analysis</option>
</param>
<when value="f">
<expand macro="FUNC_FILE"/>
<expand macro="ONTOLOGY_ARGS"/>
<expand macro="FUNC_COLNAME"/>
</when>
<when value="t">
<expand macro="TAX_FILE"/>
<expand macro="TAX_COLNAME"/>
</when>
<when value="ft">
<expand macro="FUNC_FILE"/>
<expand macro="FUNC_COLNAME"/>
<expand macro="ONTOLOGY_ARGS"/>
<expand macro="TAX_FILE"/>
<expand macro="TAX_COLNAME"/>
<expand macro="FT_TAR_RANK"/>
</when>
</conditional>
<param argument="--int_file" type="data" format="tabular" label="Intensity file" help=""/>
<param argument="--pep_colname_int" type="text" value="peptide" label="Intensity file: peptide column name" help="The column name within the intensity file that corresponds to the peptide sequences">
<validator type="empty_field"/>
</param>
<when value="f">
<expand macro="FUNC_FILE"/>
<expand macro="ONTOLOGY_ARGS"/>
<expand macro="FUNC_COLNAME"/>
</when>
<when value="t">
<expand macro="TAX_FILE"/>
<expand macro="TAX_COLNAME"/>
</when>
<when value="ft">
<expand macro="FUNC_FILE"/>
<expand macro="FUNC_COLNAME"/>
<expand macro="ONTOLOGY_ARGS"/>
<expand macro="TAX_FILE"/>
<expand macro="TAX_COLNAME"/>
<expand macro="FT_TAR_RANK"/>
</when>
</conditional>
<param argument="--int_file" type="data" format="tabular" label="Intensity file"
help=""/>
<param argument="--pep_colname_int" type="text" value="peptide" label="Intensity file: peptide column name"
help="The column name within the intensity file that corresponds to the peptide sequences">
<validator type="empty_field"/>
</param>
</inputs>
<outputs>
<data format="tabular" name="outfile" label="${tool.name} on ${on_string} expanded"/>
</outputs>
<tests>
<test>
<param name="db_tar" value="ec.tar" ftype="tar"/>
<param name="samps" value="samples_basic.tab" ftype="tabular"/>
<param name="int_file" value="int_ttest.tab" ftype="tabular"/>
<param name="pep_colname_int" value="peptide" />
<param name="func_file" value="multiple_func.tab" />
<param name="pep_colname_func" value="peptide" />
<param name="func_colname" value="ec"/>
<param name="mode" value="f" />
<param name="ontology" value="ec" />
<output name="outfile">
<assert_contents>
<has_text text="1.2.7.10"/>
</assert_contents>
</output>
</test>
</tests>
<help>
</inputs>
<outputs>
<data format="tabular" name="outfile" label="${tool.name} on ${on_string} expanded"/>
</outputs>
<tests>
<test>
<param name="db_tar" value="ec.tar" ftype="tar"/>
<param name="samps" value="samples_basic.tab" ftype="tabular"/>
<param name="int_file" value="int_ttest.tab" ftype="tabular"/>
<param name="pep_colname_int" value="peptide"/>
<param name="func_file" value="multiple_func.tab"/>
<param name="pep_colname_func" value="peptide"/>
<param name="func_colname" value="ec"/>
<param name="mode" value="f"/>
<param name="ontology" value="ec"/>
<output name="outfile">
<assert_contents>
<has_text text="1.2.7.10"/>
</assert_contents>
</output>
</test>
</tests>
<help>
<![CDATA[
metaQuantome expand
===================
Expand Down Expand Up @@ -230,5 +224,5 @@ Questions, Comments, Problems, Kudos
Please file any issues at https://github.com/galaxyproteomics/tools-galaxyp/issues.
]]></help>
<expand macro="citations" />
<expand macro="citations"/>
</tool>
1 change: 1 addition & 0 deletions tools/metaquantome/metaquantome_filter.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<macros>
<import>macros.xml</import>
</macros>
<expand macro="xrefs"/>
<expand macro="requirements" />
<command detect_errors="exit_code"><![CDATA[
metaquantome filter
Expand Down
1 change: 1 addition & 0 deletions tools/metaquantome/metaquantome_sample.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<macros>
<import>macros.xml</import>
</macros>
<expand macro="xrefs"/>
<command detect_errors="exit_code"><![CDATA[
#set $samp_header = 'group\tcolnames'
echo -e '${samp_header}' > samp_file.tab;
Expand Down
Loading

0 comments on commit ec66b5b

Please sign in to comment.