annotate matchms_remove_spectra.xml @ 1:c24ebd41dd53 draft

planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 2abca9206b76bf42e6322d751ed3a31a6cc003a4
author recetox
date Tue, 04 Jun 2024 07:10:48 +0000
parents 80df426e7e47
children fbe335d27d25
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
c24ebd41dd53 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 2abca9206b76bf42e6322d751ed3a31a6cc003a4
recetox
parents: 0
diff changeset
1 <tool id="matchms_remove_spectra" name="matchms remove spectra" version="@TOOL_VERSION@+galaxy1" profile="21.09">
0
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
2 <description>Filters spectra based on metadata presence</description>
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
3
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
4 <macros>
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
5 <import>macros.xml</import>
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
6 </macros>
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
7
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
8 <expand macro="creator"/>
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
9
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
10 <edam_operations>
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
11 <edam_operation>operation_3695</edam_operation>
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
12 </edam_operations>
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
13
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
14 <expand macro="bio.tools"/>
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
15
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
16 <requirements>
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
17 <requirement type="package" version="@TOOL_VERSION@">matchms</requirement>
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
18 </requirements>
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
19 <command detect_errors="exit_code"><![CDATA[
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
20 python3 '${filter_spectra}'
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
21 ]]></command>
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
22
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
23 <configfiles>
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
24 <configfile name="filter_spectra">
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
25 from matchms.exporting import save_as_mgf, save_as_msp
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
26 from matchms.filtering.filter_utils.smile_inchi_inchikey_conversions import is_valid_inchi, is_valid_smiles, is_valid_inchikey
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
27 from matchms.filtering import require_compound_name, require_formula, require_precursor_mz, \
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
28 require_retention_time, require_retention_index, require_valid_annotation
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
29 from matchms.importing import load_from_mgf, load_from_msp
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
30
1
c24ebd41dd53 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 2abca9206b76bf42e6322d751ed3a31a6cc003a4
recetox
parents: 0
diff changeset
31 #set metadata_fields = [str($f) for $f in $metadata_fields]
c24ebd41dd53 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 2abca9206b76bf42e6322d751ed3a31a6cc003a4
recetox
parents: 0
diff changeset
32 required_metadata = [x for x in $metadata_fields]
0
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
33 if "$spectra.ext" == "msp":
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
34 spectra = list(load_from_msp("${spectra}"))
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
35 elif "$spectra.ext" == 'mgf':
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
36 spectra = list(load_from_mgf("${spectra}"))
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
37 else:
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
38 raise ValueError(f'File format {$spectra.ext} not supported for mass spectra file.')
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
39
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
40 filtered_spectra = []
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
41 removed_spectra = []
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
42
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
43 for spectrum in spectra:
1
c24ebd41dd53 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 2abca9206b76bf42e6322d751ed3a31a6cc003a4
recetox
parents: 0
diff changeset
44 keep = True
c24ebd41dd53 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 2abca9206b76bf42e6322d751ed3a31a6cc003a4
recetox
parents: 0
diff changeset
45
0
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
46 if 'smiles' in required_metadata:
1
c24ebd41dd53 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 2abca9206b76bf42e6322d751ed3a31a6cc003a4
recetox
parents: 0
diff changeset
47 keep = keep and is_valid_smiles(spectrum.get('smiles', '').strip())
0
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
48
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
49 if 'inchi' in required_metadata:
1
c24ebd41dd53 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 2abca9206b76bf42e6322d751ed3a31a6cc003a4
recetox
parents: 0
diff changeset
50 keep = keep and is_valid_inchi(spectrum.get('inchi', '').strip())
0
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
51
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
52 if 'inchikey' in required_metadata:
1
c24ebd41dd53 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 2abca9206b76bf42e6322d751ed3a31a6cc003a4
recetox
parents: 0
diff changeset
53 inchikey = spectrum.get('inchikey', '')
c24ebd41dd53 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 2abca9206b76bf42e6322d751ed3a31a6cc003a4
recetox
parents: 0
diff changeset
54 keep = keep and is_valid_inchikey(inchikey.strip())
0
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
55
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
56 if 'precursor_mz' in required_metadata:
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
57 result = require_precursor_mz(spectrum)
1
c24ebd41dd53 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 2abca9206b76bf42e6322d751ed3a31a6cc003a4
recetox
parents: 0
diff changeset
58 keep = keep and result is not None
0
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
59
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
60 if 'valid_annotation' in required_metadata:
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
61 result = require_valid_annotation(spectrum)
1
c24ebd41dd53 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 2abca9206b76bf42e6322d751ed3a31a6cc003a4
recetox
parents: 0
diff changeset
62 keep = keep and result is not None
c24ebd41dd53 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 2abca9206b76bf42e6322d751ed3a31a6cc003a4
recetox
parents: 0
diff changeset
63
0
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
64 if 'formula' in required_metadata:
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
65 result = require_formula(spectrum)
1
c24ebd41dd53 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 2abca9206b76bf42e6322d751ed3a31a6cc003a4
recetox
parents: 0
diff changeset
66 keep = keep and result is not None
0
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
67
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
68 if 'compound_name' in required_metadata:
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
69 result = require_compound_name(spectrum)
1
c24ebd41dd53 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 2abca9206b76bf42e6322d751ed3a31a6cc003a4
recetox
parents: 0
diff changeset
70 keep = keep and result is not None
c24ebd41dd53 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 2abca9206b76bf42e6322d751ed3a31a6cc003a4
recetox
parents: 0
diff changeset
71
0
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
72 if 'retention_time' in required_metadata:
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
73 result = require_retention_time(spectrum)
1
c24ebd41dd53 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 2abca9206b76bf42e6322d751ed3a31a6cc003a4
recetox
parents: 0
diff changeset
74 keep = keep and result is not None
0
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
75
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
76 if 'retention_index' in required_metadata:
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
77 result = require_retention_index(spectrum)
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
78 if result is not None:
1
c24ebd41dd53 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 2abca9206b76bf42e6322d751ed3a31a6cc003a4
recetox
parents: 0
diff changeset
79 keep = keep and float(result.get('retention_index', 0)) > 0
0
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
80 else:
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
81 keep = False
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
82
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
83 if keep:
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
84 filtered_spectra.append(spectrum)
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
85
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
86 if "$spectra_removed" == "TRUE" and keep == False:
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
87 removed_spectra.append(spectrum)
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
88
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
89
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
90 if "$spectra.ext" == "msp":
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
91 save_as_msp(filtered_spectra, "${output_filtered}")
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
92 save_as_msp(removed_spectra, "${output_removed}")
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
93 else:
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
94 save_as_mgf(filtered_spectra, "${output_filtered}")
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
95 save_as_mgf(removed_spectra, "${output_removed}")
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
96
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
97 </configfile>
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
98 </configfiles>
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
99
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
100 <inputs>
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
101 <param name="spectra" type="data" format="msp,mgf" label="Input Spectra File" help="Input file containing mass spectra"/>
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
102 <param name="metadata_fields" type="select" multiple="true" label="Metadata Fields" help="Select metadata fields required in the spectra">
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
103 <option value="smiles">SMILES</option>
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
104 <option value="inchi">InChI</option>
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
105 <option value="inchikey">InChIKey</option>
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
106 <option value="formula">Formula</option>
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
107 <option value="retention_time">Retention Time</option>
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
108 <option value="retention_index">Retention Index</option>
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
109 <option value="precursor_mz">Precursor MZ</option>
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
110 <option value="valid_annotation">Valid Annotation</option>
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
111 <option value="compound_name">Compound Name</option>
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
112 </param>
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
113 <param name="spectra_removed" type="boolean" truevalue="TRUE" falsevalue="FALSE" checked="false" label="Output Removed Spectra" help="Output spectra that were removed due to missing metadata"/>
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
114 </inputs>
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
115
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
116 <outputs>
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
117 <data name="output_filtered" format_source="spectra" label="${tool.name} on ${on_string}: Filtered Spectra"/>
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
118 <data name="output_removed" format_source="spectra" label="${tool.name} on ${on_string}: Removed Spectra">
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
119 <filter>spectra_removed</filter>
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
120 </data>
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
121 </outputs>
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
122
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
123 <tests>
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
124 <test expect_num_outputs="1">
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
125 <param name="spectra" value="remove_spectra/require_filter.msp" ftype="msp"/>
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
126 <param name="metadata_fields" value="smiles"/>
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
127 <output name="output_filtered" file="remove_spectra/require_smiles.msp" ftype="msp"/>
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
128 </test>
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
129 <test expect_num_outputs="2">
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
130 <param name="spectra" value="remove_spectra/require_filter.msp" ftype="msp"/>
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
131 <param name="metadata_fields" value="inchi"/>
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
132 <param name="spectra_removed" value="TRUE"/>
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
133 <output name="output_filtered" file="remove_spectra/require_inchi.msp" ftype="msp"/>
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
134 <output name="output_removed" file="remove_spectra/require_inchi_removed_spectra.msp" ftype="msp"/>
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
135 </test>
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
136 <test expect_num_outputs="1">
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
137 <param name="spectra" value="remove_spectra/require_filter.msp" ftype="msp"/>
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
138 <param name="metadata_fields" value="inchikey"/>
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
139 <output name="output_filtered" file="remove_spectra/require_inchikey.msp" ftype="msp"/>
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
140 </test>
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
141 <test expect_num_outputs="1">
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
142 <param name="spectra" value="remove_spectra/require_filter.msp" ftype="msp"/>
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
143 <param name="metadata_fields" value="formula"/>
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
144 <output name="output_filtered" file="remove_spectra/require_formula.msp" ftype="msp"/>
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
145 </test>
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
146 <test expect_num_outputs="1">
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
147 <param name="spectra" value="remove_spectra/require_filter.msp" ftype="msp"/>
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
148 <param name="metadata_fields" value="retention_time"/>
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
149 <output name="output_filtered" file="remove_spectra/require_retention_time.msp" ftype="msp"/>
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
150 </test>
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
151 <test expect_num_outputs="1">
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
152 <param name="spectra" value="remove_spectra/require_filter.msp" ftype="msp"/>
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
153 <param name="metadata_fields" value="retention_index"/>
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
154 <output name="output_filtered" file="remove_spectra/require_retention_index.msp" ftype="msp"/>
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
155 </test>
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
156 <test expect_num_outputs="1">
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
157 <param name="spectra" value="remove_spectra/require_filter.msp" ftype="msp"/>
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
158 <param name="metadata_fields" value="precursor_mz"/>
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
159 <output name="output_filtered" file="remove_spectra/require_precursor_mz.msp" ftype="msp"/>
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
160 </test>
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
161 <test expect_num_outputs="1">
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
162 <param name="spectra" value="remove_spectra/require_filter.msp" ftype="msp"/>
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
163 <param name="metadata_fields" value="compound_name"/>
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
164 <output name="output_filtered" file="remove_spectra/require_compound_name.msp" ftype="msp"/>
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
165 </test>
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
166 <test expect_num_outputs="1">
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
167 <param name="spectra" value="remove_spectra/require_filter.msp" ftype="msp"/>
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
168 <param name="metadata_fields" value="valid_annotation"/>
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
169 <output name="output_filtered">
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
170 <assert_contents>
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
171 <has_n_lines n="0"/>
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
172 </assert_contents>
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
173 </output>
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
174 </test>
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
175 </tests>
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
176
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
177 <help><![CDATA[
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
178 This tool filters input mass spectra based on the presence of specified metadata fields. Spectra missing any of the selected metadata fields are optionally logged and output separately.
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
179 Valid Annotation filter removes spectra that are not fully annotated (correct and matching, smiles, inchi and inchikey)
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
180 ]]></help>
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
181
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
182 <expand macro="citations"/>
80df426e7e47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
diff changeset
183 </tool>