Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

matchms: added filters and test and fixed linter warnings #402

Merged
merged 20 commits into from
Sep 27, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tools/export_to_path/export_to_path.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<tool id="export_to_path" name="export to path" version="0.0.2">
<description>on a filesystem accessible to compute node</description>
<macros>
<import>macros.xml</import>
</macros>
<expand macro="creator"/>
<description>on a filesystem accessible to compute node</description>
<requirements>
<requirement type="package" version="3.6">python</requirement>
</requirements>
Expand Down
3 changes: 3 additions & 0 deletions tools/filter_compounds/filter_compounds.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,8 @@
@HELP@
]]>
</help>
<citations>
<citation type="doi">https://doi.org/10.5281/zenodo.6035335</citation>
</citations>
</tool>

13 changes: 13 additions & 0 deletions tools/matchms/matchms_filtering.xml
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,22 @@
<conditional name="normalise_intensities">
<param name="is_true" label="Normalize intensities" type="boolean" truevalue="TRUE" falsevalue="FALSE" checked="false"
help="Normalize intensities of peaks (and losses) to unit height."/>
<when value="TRUE"></when>
hechth marked this conversation as resolved.
Show resolved Hide resolved
<when value="FALSE"></when>
</conditional>

<conditional name="default_filters">
<param name="is_true" label="Apply default filters" type="boolean" truevalue="TRUE" falsevalue="FALSE" checked="false"
help="Collection of filters that are considered default and that do no require any (factory) arguments."/>
<when value="TRUE"></when>
<when value="FALSE"></when>
</conditional>

<conditional name="clean_metadata">
<param name="is_true" label="Clean metadata" type="boolean" truevalue="TRUE" falsevalue="FALSE" checked="false"
help="Apply all adding and cleaning filters if possible, so that the spectra have canonical metadata." />
<when value="TRUE"></when>
<when value="FALSE"></when>
</conditional>

<conditional name="relative_intensity">
Expand All @@ -88,6 +94,7 @@
<param label="Minimum intensity" name="from_intensity" value="0" type="float" help="Lower bound for intensity filter." />
<param label="Maximum intensity" name="to_intensity" value="1" type="float" help="Upper bound for intensity filter." />
</when>
<when value="FALSE"></when>
</conditional>

<conditional name="mz_range">
Expand All @@ -97,16 +104,21 @@
<param label="Minimum m/z" name="from_mz" optional="true" type="float" help="Lower bound for m/z filter." />
<param label="Maximum m/z" name="to_mz" optional="true" type="float" help="Upper bound for m/z filter." />
</when>
<when value="FALSE"></when>
</conditional>

<conditional name="require_smiles">
<param name="is_true" label="Require SMILES" type="boolean" truevalue="TRUE" falsevalue="FALSE" checked="false"
help="Remove spectra that does not contain SMILES." />
<when value="TRUE"></when>
<when value="FALSE"></when>
</conditional>

<conditional name="require_inchi">
<param name="is_true" label="Require INCHI" type="boolean" truevalue="TRUE" falsevalue="FALSE" checked="false"
help="Remove spectra that does not contain INCHI." />
<when value="TRUE"></when>
<when value="FALSE"></when>
</conditional>

<conditional name="reduce_to_top_n_peaks">
Expand All @@ -115,6 +127,7 @@
<when value="TRUE">
<param label="Maximum number of peaks" name="n_max" value="5" type="integer" help="Maximum number of peaks. Remove peaks if more peaks are found." />
</when>
<when value="FALSE"></when>
</conditional>

</inputs>
Expand Down
12 changes: 8 additions & 4 deletions tools/matchms/matchms_formatter.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@
<requirement type="package" version="1.1.4">pandas</requirement>
<requirement type="package" version="8.0.1">click</requirement>
</requirements>

<command detect_errors="aggressive"><![CDATA[
sh ${matchms_formatter_cli}
]]></command>

<environment_variables>
<environment_variable name="MPLCONFIGDIR">\$_GALAXY_JOB_TMP_DIR</environment_variable>
<environment_variable name="XDG_CACHE_HOME">\$_GALAXY_JOB_TMP_DIR</environment_variable>
</environment_variables>

<command detect_errors="aggressive"><![CDATA[
sh ${matchms_formatter_cli}
]]></command>

<configfiles>
<configfile name="matchms_formatter_cli">
python3 ${__tool_directory__}/formatter.py \
Expand Down Expand Up @@ -57,4 +57,8 @@
@HELP_formatter@
@HELP_matchms@
</help>

<citations>
<citation type="doi">https://doi.org/10.5281/zenodo.6035335</citation>
</citations>
</tool>
2 changes: 1 addition & 1 deletion tools/matchms/matchms_metadata_export.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<tool id="matchms_metadata_export" name="matchms metadata export " version="@TOOL_VERSION@+galaxy0" profile="21.09">
<tool id="matchms_metadata_export" name="matchms metadata export" version="@TOOL_VERSION@+galaxy0" profile="21.09">
<description>extract all metadata from mass spectra file to tabular format</description>
<macros>
<import>macros.xml</import>
Expand Down
8 changes: 4 additions & 4 deletions tools/matchms/matchms_metadata_match.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
<requirement type="package" version="@TOOL_VERSION@">matchms</requirement>
</requirements>

<environment_variables>
<environment_variable name="MPLCONFIGDIR">\$_GALAXY_JOB_TMP_DIR</environment_variable>
</environment_variables>

<command detect_errors="exit_code"><![CDATA[
python3 '${python_wrapper}'
]]> </command>

<environment_variables>
<environment_variable name="MPLCONFIGDIR">\$_GALAXY_JOB_TMP_DIR</environment_variable>
</environment_variables>

<configfiles>
<configfile name="python_wrapper">
@init_logger@
Expand Down
10 changes: 5 additions & 5 deletions tools/matchms/matchms_networking.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@
<requirement type="package" version="@TOOL_VERSION@">matchms</requirement>
</requirements>

<command detect_errors="aggressive"><![CDATA[
sh ${matchms_networking_cli}
]]></command>

<environment_variables>
<environment_variable name="MPLCONFIGDIR">\$_GALAXY_JOB_TMP_DIR</environment_variable>
<environment_variable name="XDG_CACHE_HOME">\$_GALAXY_JOB_TMP_DIR</environment_variable>
</environment_variables>

<command detect_errors="aggressive"><![CDATA[
sh ${matchms_networking_cli}
]]></command>

<configfiles>
<configfile name="matchms_networking_cli">
python3 ${__tool_directory__}/matchms_networking_wrapper.py \
Expand Down Expand Up @@ -78,7 +78,7 @@
</inputs>

<outputs>
<data label="Similarity network of ${scores.name}" name="similarity_network_file">
<data label="Similarity network of ${scores.name}" name="similarity_network_file" format="graphml">
<change_format>
<when input="graph_format" value="graphml" format="graphml"/>
<when input="graph_format" value="cyjs" format="cyjs"/>
Expand Down
10 changes: 6 additions & 4 deletions tools/matchms/matchms_similarity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
<requirement type="package" version="@TOOL_VERSION@">matchms</requirement>
</requirements>

<environment_variables>
<environment_variable name="MPLCONFIGDIR">\$_GALAXY_JOB_TMP_DIR</environment_variable>
</environment_variables>

<command detect_errors="exit_code"><![CDATA[
sh ${matchms_python_cli}
]]> </command>

<environment_variables>
<environment_variable name="MPLCONFIGDIR">\$_GALAXY_JOB_TMP_DIR</environment_variable>
</environment_variables>

<configfiles>
<configfile name="matchms_python_cli">
python3 ${__tool_directory__}/matchms_similarity_wrapper.py \
Expand Down Expand Up @@ -64,6 +64,7 @@
<param label="Reference spectra" name="references" type="data" format="msp,mgf"
help="Reference mass spectra to match against as library."/>
</when>
<when value="TRUE"></when>
</conditional>
<param label="Scores array type" name="array_type" type="select" display="radio"
help="Matrix type for storing scores objects. Sparse type more memory-efficient and better for large arrays.
Expand Down Expand Up @@ -113,6 +114,7 @@
<param label="tolerance" name="tolerance" type="float" value="60"
help="Peaks will be considered a match when less than tolerance apart."/>
</when>
<when value="FALSE"></when>
</conditional>
</inputs>

Expand Down
8 changes: 4 additions & 4 deletions tools/matchms/matchms_spectral_similarity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
<requirement type="package" version="@TOOL_VERSION@">matchms</requirement>
</requirements>

<environment_variables>
<environment_variable name="MPLCONFIGDIR">\$_GALAXY_JOB_TMP_DIR</environment_variable>
</environment_variables>

<command detect_errors="exit_code"><![CDATA[
python3 ${python_wrapper}
]]> </command>

<environment_variables>
<environment_variable name="MPLCONFIGDIR">\$_GALAXY_JOB_TMP_DIR</environment_variable>
</environment_variables>

<configfiles>
<configfile name="python_wrapper">
@init_logger@
Expand Down
13 changes: 9 additions & 4 deletions tools/msmetaenhancer/msmetaenhancer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
<requirement type="package" version="@TOOL_VERSION@">msmetaenhancer</requirement>
</requirements>

<command detect_errors="exit_code"><![CDATA[
sh ${msmetaenhancer_python_cli}
]]> </command>

<environment_variables>
<environment_variable name="MPLCONFIGDIR">\$_GALAXY_JOB_TMP_DIR</environment_variable>
<environment_variable name="XDG_CACHE_HOME">\$_GALAXY_JOB_TMP_DIR</environment_variable>
</environment_variables>

<command detect_errors="exit_code"><![CDATA[
sh ${msmetaenhancer_python_cli}
]]> </command>

<configfiles>
<configfile name="msmetaenhancer_python_cli">
python3 ${__tool_directory__}/msmetaenhancer_wrapper.py \
Expand Down Expand Up @@ -72,6 +72,7 @@
<option value="info" selected="true">INFO</option>
</param>
</when>
<when value="FALSE"></when>
</conditional>
</section>
</inputs>
Expand Down Expand Up @@ -105,4 +106,8 @@
]]>
</help>

<citations>
<citation type="doi">https://doi.org/10.21105/joss.04494</citation>
</citations>

</tool>
4 changes: 4 additions & 0 deletions tools/msp_merge/msp_merge.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,8 @@
<help><![CDATA[
MSPmerge handles input/output files in MSP format using the matchms.importing and matchms.exporting modules (https://matchms.readthedocs.io/en/latest/index.html).
]]></help>

<citations>
<citation type="doi">https://doi.org/10.5281/zenodo.6035335</citation>
</citations>
</tool>
4 changes: 4 additions & 0 deletions tools/mzml_validator/mzml_validator.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,8 @@
**mzML Schema Validator** validates mzML files against XML Schema Definition (XSD) developed by HUPO Proteomics Standard Initiative
(https://www.psidev.info/mzML).
]]></help>

<citations>
<citation type="doi">https://doi.org/10.5281/zenodo.6035335</citation>
</citations>
</tool>
25 changes: 19 additions & 6 deletions tools/query/query.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
<expand macro="creator"/>

<requirements>
<requirement type="package">click</requirement>
<requirement type="package">pyarrow</requirement>
<requirement type="package">pytables</requirement>
<requirement type="package">pandas</requirement>
<requirement type="package">pandasql</requirement>
<requirement type="package" version="7.0">click</requirement>
<requirement type="package" version="0.15.1">pyarrow</requirement>
<requirement type="package" version="3.6.1">pytables</requirement>
<requirement type="package" version="1.3.5">pandas</requirement>
<requirement type="package" version="0.7.3">pandasql</requirement>
<requirement type="package" version="3.7">python</requirement>
</requirements>

Expand Down Expand Up @@ -88,11 +88,15 @@
</param>
<expand macro="internal_name" format="h5"/>
<expand macro="internal_name" format="sqlite"/>
<when value="csv"></when>
<when value="tsv"></when>
<when value="feather"></when>
<when value="parquet"></when>
</conditional>
</inputs>

<outputs>
<data name="output">
<data name="output" format="h5">
<change_format>
<when input="result.format" value="h5" format="h5"/>
<when input="result.format" value="csv" format="csv"/>
Expand Down Expand Up @@ -121,4 +125,13 @@
<output name="output" file="ab.csv" ftype="csv"/>
</test>
</tests>

<help>
Query tool simplifies data handling by offering seamless conversion between different tabular data types and the execution of SQL SELECT
and JOIN operations on various input file formats. Additionally, it allows you to customize the output format to meet your specific requirements.
</help>

<citations>
<citation type="doi">https://doi.org/10.5281/zenodo.6035335</citation>
</citations>
</tool>
5 changes: 4 additions & 1 deletion tools/ramclustr/macros.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,13 @@
<edam_topics>
<edam_topic>topic_3520</edam_topic>
</edam_topics>
</xml>

<xml name="refs">
<xrefs>
<xref type="bio.tools">ramclustr</xref>
</xrefs>
</xml>
</xml>

<xml name="parameters_csv">
<section name="ms_csv" title="Input MS Data as CSV" expanded="true">
Expand Down
3 changes: 2 additions & 1 deletion tools/ramclustr/ramclustr.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
<macros>
<import>macros.xml</import>
</macros>
<expand macro='annotation'/>
<edam_operations>
<edam_operation>operation_3557</edam_operation>
<edam_operation>operation_3435</edam_operation>
<edam_operation>operation_3432</edam_operation>
<edam_operation>operation_3465</edam_operation>
</edam_operations>
<expand macro='annotation'/>
<expand macro="refs"/>
<expand macro="creator"/>

<requirements>
Expand Down
3 changes: 2 additions & 1 deletion tools/ramclustr/ramclustr_define_experiment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
<macros>
<import>macros.xml</import>
</macros>
<expand macro='annotation'/>
<edam_operations>
<edam_operation>operation_3429</edam_operation>
</edam_operations>
<expand macro='annotation'/>
<expand macro="refs"/>
<expand macro="creator"/>

<command detect_errors="exit_code"><![CDATA[
Expand Down
5 changes: 5 additions & 0 deletions tools/recetox_aplcms/macros.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
<edam_topic>topic_0091</edam_topic>
<edam_topic>topic_3520</edam_topic>
</edam_topics>
</xml>

<xml name="refs">
<xrefs>
<xref type="bio.tools">recetox-aplcms</xref>
</xrefs>
Expand Down Expand Up @@ -89,6 +92,7 @@
<param name="sd_cut_max" type="float" value="500" label="Maximal standard deviation"
help="The maximum standard deviation - features with a standard deviation greater than this number are eliminated." />
</when>
<when value="FALSE"></when>
</conditional>
<conditional name="peak_estim">
<param name="peak_estim_method" type="select" display="radio" label="Peak estimation method"
Expand All @@ -100,6 +104,7 @@
<param name="moment_power" type="float" value="1" label="Moment power"
help="The power parameter for data transformation when fitting the bi-Gaussian mixture model in an EIC." />
</when>
<when value="EM"></when>
</conditional>
</section>
</xml>
Expand Down
Loading