Mercurial > repos > recetox > matchms_metadata_export
annotate matchms_metadata_export.xml @ 19:b576ed720711 draft default tip
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 8db07edd3b0d2ff778036dec410027ad58365488
author | recetox |
---|---|
date | Mon, 15 Jul 2024 07:54:47 +0000 |
parents | e337075d0aaa |
children |
rev | line source |
---|---|
17
e337075d0aaa
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
15
diff
changeset
|
1 <tool id="matchms_metadata_export" name="matchms metadata export" version="@TOOL_VERSION@+galaxy0" profile="21.09"> |
0
dfdbccfa8753
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit c10d901c526d0895869d18a1d1bdd1ea58ed7473
recetox
parents:
diff
changeset
|
2 <description>extract all metadata from mass spectra file to tabular format</description> |
dfdbccfa8753
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit c10d901c526d0895869d18a1d1bdd1ea58ed7473
recetox
parents:
diff
changeset
|
3 <macros> |
dfdbccfa8753
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit c10d901c526d0895869d18a1d1bdd1ea58ed7473
recetox
parents:
diff
changeset
|
4 <import>macros.xml</import> |
2
f04610d25411
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
0
diff
changeset
|
5 <import>help.xml</import> |
0
dfdbccfa8753
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit c10d901c526d0895869d18a1d1bdd1ea58ed7473
recetox
parents:
diff
changeset
|
6 </macros> |
dfdbccfa8753
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit c10d901c526d0895869d18a1d1bdd1ea58ed7473
recetox
parents:
diff
changeset
|
7 <expand macro="creator"/> |
2
f04610d25411
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
0
diff
changeset
|
8 <expand macro="bio.tools"/> |
f04610d25411
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
0
diff
changeset
|
9 |
0
dfdbccfa8753
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit c10d901c526d0895869d18a1d1bdd1ea58ed7473
recetox
parents:
diff
changeset
|
10 <requirements> |
2
f04610d25411
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
0
diff
changeset
|
11 <requirement type="package" version="@TOOL_VERSION@">matchms</requirement> |
0
dfdbccfa8753
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit c10d901c526d0895869d18a1d1bdd1ea58ed7473
recetox
parents:
diff
changeset
|
12 </requirements> |
dfdbccfa8753
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit c10d901c526d0895869d18a1d1bdd1ea58ed7473
recetox
parents:
diff
changeset
|
13 |
dfdbccfa8753
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit c10d901c526d0895869d18a1d1bdd1ea58ed7473
recetox
parents:
diff
changeset
|
14 <command detect_errors='aggressive'><![CDATA[ |
dfdbccfa8753
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit c10d901c526d0895869d18a1d1bdd1ea58ed7473
recetox
parents:
diff
changeset
|
15 python ${matchms_python_cli} |
dfdbccfa8753
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit c10d901c526d0895869d18a1d1bdd1ea58ed7473
recetox
parents:
diff
changeset
|
16 ]]></command> |
dfdbccfa8753
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit c10d901c526d0895869d18a1d1bdd1ea58ed7473
recetox
parents:
diff
changeset
|
17 |
dfdbccfa8753
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit c10d901c526d0895869d18a1d1bdd1ea58ed7473
recetox
parents:
diff
changeset
|
18 <configfiles> |
dfdbccfa8753
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit c10d901c526d0895869d18a1d1bdd1ea58ed7473
recetox
parents:
diff
changeset
|
19 <configfile name="matchms_python_cli"> |
12
c01868645f1b
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit da193865f41a3a840ecc4ba0afab1d358554998a
recetox
parents:
4
diff
changeset
|
20 import matchms |
15
48c7b584032a
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 4b8a43b863ff8a0ff1d5a08e516068853adf358d
recetox
parents:
12
diff
changeset
|
21 import pandas as pd |
0
dfdbccfa8753
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit c10d901c526d0895869d18a1d1bdd1ea58ed7473
recetox
parents:
diff
changeset
|
22 from matchms.importing import load_from_msp, load_from_mgf |
dfdbccfa8753
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit c10d901c526d0895869d18a1d1bdd1ea58ed7473
recetox
parents:
diff
changeset
|
23 from matchms.exporting.metadata_export import export_metadata_as_csv |
dfdbccfa8753
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit c10d901c526d0895869d18a1d1bdd1ea58ed7473
recetox
parents:
diff
changeset
|
24 |
12
c01868645f1b
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit da193865f41a3a840ecc4ba0afab1d358554998a
recetox
parents:
4
diff
changeset
|
25 |
c01868645f1b
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit da193865f41a3a840ecc4ba0afab1d358554998a
recetox
parents:
4
diff
changeset
|
26 if "$harmonize_metadata" == "False": |
c01868645f1b
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit da193865f41a3a840ecc4ba0afab1d358554998a
recetox
parents:
4
diff
changeset
|
27 matchms.Metadata.set_key_replacements({}) |
c01868645f1b
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit da193865f41a3a840ecc4ba0afab1d358554998a
recetox
parents:
4
diff
changeset
|
28 |
0
dfdbccfa8753
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit c10d901c526d0895869d18a1d1bdd1ea58ed7473
recetox
parents:
diff
changeset
|
29 spectra_list = list(load_from_${input_file.ext}("${input_file}", $harmonize_metadata)) |
dfdbccfa8753
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit c10d901c526d0895869d18a1d1bdd1ea58ed7473
recetox
parents:
diff
changeset
|
30 |
dfdbccfa8753
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit c10d901c526d0895869d18a1d1bdd1ea58ed7473
recetox
parents:
diff
changeset
|
31 export_metadata_as_csv(spectra_list, "${output_file}") |
15
48c7b584032a
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 4b8a43b863ff8a0ff1d5a08e516068853adf358d
recetox
parents:
12
diff
changeset
|
32 |
48c7b584032a
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 4b8a43b863ff8a0ff1d5a08e516068853adf358d
recetox
parents:
12
diff
changeset
|
33 data = pd.read_csv("${output_file}") |
48c7b584032a
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 4b8a43b863ff8a0ff1d5a08e516068853adf358d
recetox
parents:
12
diff
changeset
|
34 |
48c7b584032a
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 4b8a43b863ff8a0ff1d5a08e516068853adf358d
recetox
parents:
12
diff
changeset
|
35 data.to_csv("${output_file}", sep='\t', index=False) |
0
dfdbccfa8753
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit c10d901c526d0895869d18a1d1bdd1ea58ed7473
recetox
parents:
diff
changeset
|
36 </configfile> |
dfdbccfa8753
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit c10d901c526d0895869d18a1d1bdd1ea58ed7473
recetox
parents:
diff
changeset
|
37 </configfiles> |
dfdbccfa8753
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit c10d901c526d0895869d18a1d1bdd1ea58ed7473
recetox
parents:
diff
changeset
|
38 |
dfdbccfa8753
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit c10d901c526d0895869d18a1d1bdd1ea58ed7473
recetox
parents:
diff
changeset
|
39 <inputs> |
dfdbccfa8753
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit c10d901c526d0895869d18a1d1bdd1ea58ed7473
recetox
parents:
diff
changeset
|
40 <param label="Spectra file" name="input_file" type="data" format="msp,mgf" help="Mass spectral library file."/> |
dfdbccfa8753
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit c10d901c526d0895869d18a1d1bdd1ea58ed7473
recetox
parents:
diff
changeset
|
41 <param label="Harmonize metadata" name="harmonize_metadata" type="boolean" truevalue="True" falsevalue="False" |
dfdbccfa8753
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit c10d901c526d0895869d18a1d1bdd1ea58ed7473
recetox
parents:
diff
changeset
|
42 checked="false" help="Apply harmonization process on the metadata keys (e.g. parse numeric values, derive precursor mass)."/> |
dfdbccfa8753
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit c10d901c526d0895869d18a1d1bdd1ea58ed7473
recetox
parents:
diff
changeset
|
43 </inputs> |
dfdbccfa8753
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit c10d901c526d0895869d18a1d1bdd1ea58ed7473
recetox
parents:
diff
changeset
|
44 |
dfdbccfa8753
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit c10d901c526d0895869d18a1d1bdd1ea58ed7473
recetox
parents:
diff
changeset
|
45 <outputs> |
15
48c7b584032a
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 4b8a43b863ff8a0ff1d5a08e516068853adf358d
recetox
parents:
12
diff
changeset
|
46 <data label="matchms extract metadata on ${on_string}" name="output_file" format="tsv"/> |
0
dfdbccfa8753
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit c10d901c526d0895869d18a1d1bdd1ea58ed7473
recetox
parents:
diff
changeset
|
47 </outputs> |
dfdbccfa8753
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit c10d901c526d0895869d18a1d1bdd1ea58ed7473
recetox
parents:
diff
changeset
|
48 |
dfdbccfa8753
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit c10d901c526d0895869d18a1d1bdd1ea58ed7473
recetox
parents:
diff
changeset
|
49 <tests> |
dfdbccfa8753
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit c10d901c526d0895869d18a1d1bdd1ea58ed7473
recetox
parents:
diff
changeset
|
50 <test> |
dfdbccfa8753
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit c10d901c526d0895869d18a1d1bdd1ea58ed7473
recetox
parents:
diff
changeset
|
51 <param name="input_file" value="convert/mgf_out.mgf" ftype="mgf"/> |
12
c01868645f1b
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit da193865f41a3a840ecc4ba0afab1d358554998a
recetox
parents:
4
diff
changeset
|
52 <param name="harmonize_metadata" value="True"/> |
15
48c7b584032a
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 4b8a43b863ff8a0ff1d5a08e516068853adf358d
recetox
parents:
12
diff
changeset
|
53 <output name="output_file" file="convert/metadata.tsv" ftype="tsv" compare="sim_size" delta="0"/> |
0
dfdbccfa8753
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit c10d901c526d0895869d18a1d1bdd1ea58ed7473
recetox
parents:
diff
changeset
|
54 </test> |
dfdbccfa8753
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit c10d901c526d0895869d18a1d1bdd1ea58ed7473
recetox
parents:
diff
changeset
|
55 <test> |
dfdbccfa8753
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit c10d901c526d0895869d18a1d1bdd1ea58ed7473
recetox
parents:
diff
changeset
|
56 <param name="input_file" value="similarity/RECETOX_Exposome_pesticides_HR_MS_20220323.msp" ftype="msp"/> |
12
c01868645f1b
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit da193865f41a3a840ecc4ba0afab1d358554998a
recetox
parents:
4
diff
changeset
|
57 <param name="harmonize_metadata" value="True"/> |
15
48c7b584032a
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 4b8a43b863ff8a0ff1d5a08e516068853adf358d
recetox
parents:
12
diff
changeset
|
58 <output name="output_file" file="convert/metadata.tsv" ftype="tsv" compare="sim_size" delta="0"/> |
0
dfdbccfa8753
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit c10d901c526d0895869d18a1d1bdd1ea58ed7473
recetox
parents:
diff
changeset
|
59 </test> |
dfdbccfa8753
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit c10d901c526d0895869d18a1d1bdd1ea58ed7473
recetox
parents:
diff
changeset
|
60 </tests> |
dfdbccfa8753
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit c10d901c526d0895869d18a1d1bdd1ea58ed7473
recetox
parents:
diff
changeset
|
61 |
2
f04610d25411
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
0
diff
changeset
|
62 <help> |
f04610d25411
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
0
diff
changeset
|
63 Documentation |
f04610d25411
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
0
diff
changeset
|
64 Mass spectral libraries are often stored in various formats, such as `msp`, `mgf` or `json`. |
f04610d25411
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
0
diff
changeset
|
65 This tool can be used to export the metadata accompanying the actual spectral to a tabular file, |
f04610d25411
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
0
diff
changeset
|
66 creating a column for each attribute and a row for each spectrum. |
f04610d25411
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
0
diff
changeset
|
67 All keys which are present in at least one spectrum are contained in the output. |
f04610d25411
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
0
diff
changeset
|
68 |
f04610d25411
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
0
diff
changeset
|
69 @HELP_matchms@ |
f04610d25411
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
0
diff
changeset
|
70 </help> |
0
dfdbccfa8753
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit c10d901c526d0895869d18a1d1bdd1ea58ed7473
recetox
parents:
diff
changeset
|
71 |
dfdbccfa8753
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit c10d901c526d0895869d18a1d1bdd1ea58ed7473
recetox
parents:
diff
changeset
|
72 <expand macro="citations"/> |
dfdbccfa8753
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit c10d901c526d0895869d18a1d1bdd1ea58ed7473
recetox
parents:
diff
changeset
|
73 </tool> |