Mercurial > repos > recetox > matchms_formatter
annotate matchms_formatter.xml @ 30:9e3c83d2afc3 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:56:31 +0000 |
parents | 8bd942dcf1ad |
children |
rev | line source |
---|---|
28
8bd942dcf1ad
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
27
diff
changeset
|
1 <tool id="matchms_formatter" name="matchms scores formatter" version="@TOOL_VERSION@+galaxy0" profile="21.09"> |
10
1b09315a3f87
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
4
diff
changeset
|
2 <description>reformat scores object of matchms to long format table</description> |
0
60f34912b3de
"planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 4d2ac914c951166e386a94d8ebb8cb1becfac122"
recetox
parents:
diff
changeset
|
3 |
60f34912b3de
"planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 4d2ac914c951166e386a94d8ebb8cb1becfac122"
recetox
parents:
diff
changeset
|
4 <macros> |
60f34912b3de
"planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 4d2ac914c951166e386a94d8ebb8cb1becfac122"
recetox
parents:
diff
changeset
|
5 <import>macros.xml</import> |
10
1b09315a3f87
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
4
diff
changeset
|
6 <import>help.xml</import> |
0
60f34912b3de
"planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 4d2ac914c951166e386a94d8ebb8cb1becfac122"
recetox
parents:
diff
changeset
|
7 </macros> |
60f34912b3de
"planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 4d2ac914c951166e386a94d8ebb8cb1becfac122"
recetox
parents:
diff
changeset
|
8 <expand macro="creator"/> |
10
1b09315a3f87
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
4
diff
changeset
|
9 <edam_operations> |
1b09315a3f87
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
4
diff
changeset
|
10 <edam_operation>operation_0335</edam_operation> |
1b09315a3f87
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
4
diff
changeset
|
11 </edam_operations> |
1b09315a3f87
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
4
diff
changeset
|
12 <expand macro="bio.tools"/> |
0
60f34912b3de
"planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 4d2ac914c951166e386a94d8ebb8cb1becfac122"
recetox
parents:
diff
changeset
|
13 |
60f34912b3de
"planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 4d2ac914c951166e386a94d8ebb8cb1becfac122"
recetox
parents:
diff
changeset
|
14 <requirements> |
4
966b4134ad12
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 5661cf2406e0616d7b2f4bee1b57ec43716088de
recetox
parents:
3
diff
changeset
|
15 <requirement type="package" version="@TOOL_VERSION@">matchms</requirement> |
0
60f34912b3de
"planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 4d2ac914c951166e386a94d8ebb8cb1becfac122"
recetox
parents:
diff
changeset
|
16 <requirement type="package" version="1.1.4">pandas</requirement> |
60f34912b3de
"planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 4d2ac914c951166e386a94d8ebb8cb1becfac122"
recetox
parents:
diff
changeset
|
17 </requirements> |
11
ae45992f969e
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit b1cc1aebf796f170d93e3dd46ffcdefdc7b8018a
recetox
parents:
10
diff
changeset
|
18 |
ae45992f969e
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit b1cc1aebf796f170d93e3dd46ffcdefdc7b8018a
recetox
parents:
10
diff
changeset
|
19 <command detect_errors="aggressive"><![CDATA[ |
27
402620029a7a
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit c626c8db7ba4dd30f85f7086e16e1e2413e36bd8
recetox
parents:
19
diff
changeset
|
20 python3 '${formatter}' |
11
ae45992f969e
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit b1cc1aebf796f170d93e3dd46ffcdefdc7b8018a
recetox
parents:
10
diff
changeset
|
21 ]]></command> |
4
966b4134ad12
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 5661cf2406e0616d7b2f4bee1b57ec43716088de
recetox
parents:
3
diff
changeset
|
22 |
966b4134ad12
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 5661cf2406e0616d7b2f4bee1b57ec43716088de
recetox
parents:
3
diff
changeset
|
23 <environment_variables> |
966b4134ad12
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 5661cf2406e0616d7b2f4bee1b57ec43716088de
recetox
parents:
3
diff
changeset
|
24 <environment_variable name="MPLCONFIGDIR">\$_GALAXY_JOB_TMP_DIR</environment_variable> |
966b4134ad12
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 5661cf2406e0616d7b2f4bee1b57ec43716088de
recetox
parents:
3
diff
changeset
|
25 <environment_variable name="XDG_CACHE_HOME">\$_GALAXY_JOB_TMP_DIR</environment_variable> |
18
86a45ba3d3f2
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 0ea5c86ceabe9f24dd61b399127b0d19a0ae2657
recetox
parents:
17
diff
changeset
|
26 <environment_variable name="OPENBLAS_NUM_THREADS">4</environment_variable> |
19
f7718efde4d5
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 19994ff091195ec6c7df791985b2a04ed5aba329
recetox
parents:
18
diff
changeset
|
27 <environment_variable name="RLIMIT_NPROC">4</environment_variable> |
4
966b4134ad12
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 5661cf2406e0616d7b2f4bee1b57ec43716088de
recetox
parents:
3
diff
changeset
|
28 </environment_variables> |
0
60f34912b3de
"planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 4d2ac914c951166e386a94d8ebb8cb1becfac122"
recetox
parents:
diff
changeset
|
29 |
60f34912b3de
"planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 4d2ac914c951166e386a94d8ebb8cb1becfac122"
recetox
parents:
diff
changeset
|
30 <configfiles> |
27
402620029a7a
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit c626c8db7ba4dd30f85f7086e16e1e2413e36bd8
recetox
parents:
19
diff
changeset
|
31 <configfile name="formatter"> |
402620029a7a
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit c626c8db7ba4dd30f85f7086e16e1e2413e36bd8
recetox
parents:
19
diff
changeset
|
32 from matchms.importing import scores_from_json |
402620029a7a
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit c626c8db7ba4dd30f85f7086e16e1e2413e36bd8
recetox
parents:
19
diff
changeset
|
33 from pandas import DataFrame |
402620029a7a
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit c626c8db7ba4dd30f85f7086e16e1e2413e36bd8
recetox
parents:
19
diff
changeset
|
34 |
402620029a7a
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit c626c8db7ba4dd30f85f7086e16e1e2413e36bd8
recetox
parents:
19
diff
changeset
|
35 scores = scores_from_json('$scores') |
402620029a7a
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit c626c8db7ba4dd30f85f7086e16e1e2413e36bd8
recetox
parents:
19
diff
changeset
|
36 data = [] |
402620029a7a
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit c626c8db7ba4dd30f85f7086e16e1e2413e36bd8
recetox
parents:
19
diff
changeset
|
37 |
402620029a7a
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit c626c8db7ba4dd30f85f7086e16e1e2413e36bd8
recetox
parents:
19
diff
changeset
|
38 for i, (row, col) in enumerate(zip(scores.scores.row, scores.scores.col)): |
402620029a7a
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit c626c8db7ba4dd30f85f7086e16e1e2413e36bd8
recetox
parents:
19
diff
changeset
|
39 data.append([scores.queries[col].metadata['$key'], scores.references[row].metadata['$key'], *scores.scores.data[i]]) |
402620029a7a
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit c626c8db7ba4dd30f85f7086e16e1e2413e36bd8
recetox
parents:
19
diff
changeset
|
40 |
402620029a7a
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit c626c8db7ba4dd30f85f7086e16e1e2413e36bd8
recetox
parents:
19
diff
changeset
|
41 result = DataFrame(data, columns=['query', 'reference', *scores.scores.score_names]) |
402620029a7a
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit c626c8db7ba4dd30f85f7086e16e1e2413e36bd8
recetox
parents:
19
diff
changeset
|
42 |
402620029a7a
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit c626c8db7ba4dd30f85f7086e16e1e2413e36bd8
recetox
parents:
19
diff
changeset
|
43 result.to_csv('$output', sep="\t", index=False) |
402620029a7a
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit c626c8db7ba4dd30f85f7086e16e1e2413e36bd8
recetox
parents:
19
diff
changeset
|
44 |
0
60f34912b3de
"planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 4d2ac914c951166e386a94d8ebb8cb1becfac122"
recetox
parents:
diff
changeset
|
45 </configfile> |
60f34912b3de
"planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 4d2ac914c951166e386a94d8ebb8cb1becfac122"
recetox
parents:
diff
changeset
|
46 </configfiles> |
60f34912b3de
"planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 4d2ac914c951166e386a94d8ebb8cb1becfac122"
recetox
parents:
diff
changeset
|
47 |
60f34912b3de
"planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 4d2ac914c951166e386a94d8ebb8cb1becfac122"
recetox
parents:
diff
changeset
|
48 <inputs> |
10
1b09315a3f87
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
4
diff
changeset
|
49 <param label="Scores object" name="scores" type="data" format="json" help="matchms Scores json file." /> |
27
402620029a7a
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit c626c8db7ba4dd30f85f7086e16e1e2413e36bd8
recetox
parents:
19
diff
changeset
|
50 <param label="Key" name="key" type="text" value="compound_name" help="Name of the key to use. Default is 'compound_name'." /> |
0
60f34912b3de
"planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 4d2ac914c951166e386a94d8ebb8cb1becfac122"
recetox
parents:
diff
changeset
|
51 </inputs> |
60f34912b3de
"planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 4d2ac914c951166e386a94d8ebb8cb1becfac122"
recetox
parents:
diff
changeset
|
52 <outputs> |
10
1b09315a3f87
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
4
diff
changeset
|
53 <data label="${tool.name} on ${on_string}" name="output" format="tsv"/> |
0
60f34912b3de
"planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 4d2ac914c951166e386a94d8ebb8cb1becfac122"
recetox
parents:
diff
changeset
|
54 </outputs> |
60f34912b3de
"planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 4d2ac914c951166e386a94d8ebb8cb1becfac122"
recetox
parents:
diff
changeset
|
55 |
60f34912b3de
"planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 4d2ac914c951166e386a94d8ebb8cb1becfac122"
recetox
parents:
diff
changeset
|
56 <tests> |
60f34912b3de
"planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 4d2ac914c951166e386a94d8ebb8cb1becfac122"
recetox
parents:
diff
changeset
|
57 <test> |
10
1b09315a3f87
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
4
diff
changeset
|
58 <param name="scores" value="formatter/fill2_trunc_scores_with_metadata_match.json" ftype="json"/> |
27
402620029a7a
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit c626c8db7ba4dd30f85f7086e16e1e2413e36bd8
recetox
parents:
19
diff
changeset
|
59 <param name="key" value="compound_name"/> |
10
1b09315a3f87
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
4
diff
changeset
|
60 <output name="output" value="formatter/fill2_formatted.tsv" ftype="tsv" |
1b09315a3f87
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
4
diff
changeset
|
61 checksum="md5$4f0d83da381b8a403d807d26a9dd0f34"/> |
0
60f34912b3de
"planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 4d2ac914c951166e386a94d8ebb8cb1becfac122"
recetox
parents:
diff
changeset
|
62 </test> |
60f34912b3de
"planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 4d2ac914c951166e386a94d8ebb8cb1becfac122"
recetox
parents:
diff
changeset
|
63 <test> |
10
1b09315a3f87
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
4
diff
changeset
|
64 <param name="scores" value="similarity/scores_test4_out.json" ftype="json"/> |
27
402620029a7a
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit c626c8db7ba4dd30f85f7086e16e1e2413e36bd8
recetox
parents:
19
diff
changeset
|
65 <param name="key" value="compound_name"/> |
10
1b09315a3f87
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
4
diff
changeset
|
66 <output name="output" file="formatter/test4_formatted.tsv" ftype="tsv"/> |
0
60f34912b3de
"planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 4d2ac914c951166e386a94d8ebb8cb1becfac122"
recetox
parents:
diff
changeset
|
67 </test> |
60f34912b3de
"planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 4d2ac914c951166e386a94d8ebb8cb1becfac122"
recetox
parents:
diff
changeset
|
68 </tests> |
60f34912b3de
"planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 4d2ac914c951166e386a94d8ebb8cb1becfac122"
recetox
parents:
diff
changeset
|
69 |
10
1b09315a3f87
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
4
diff
changeset
|
70 <help> |
4
966b4134ad12
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 5661cf2406e0616d7b2f4bee1b57ec43716088de
recetox
parents:
3
diff
changeset
|
71 @HELP_formatter@ |
10
1b09315a3f87
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
4
diff
changeset
|
72 @HELP_matchms@ |
1b09315a3f87
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
4
diff
changeset
|
73 </help> |
11
ae45992f969e
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit b1cc1aebf796f170d93e3dd46ffcdefdc7b8018a
recetox
parents:
10
diff
changeset
|
74 |
ae45992f969e
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit b1cc1aebf796f170d93e3dd46ffcdefdc7b8018a
recetox
parents:
10
diff
changeset
|
75 <citations> |
ae45992f969e
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit b1cc1aebf796f170d93e3dd46ffcdefdc7b8018a
recetox
parents:
10
diff
changeset
|
76 <citation type="doi">https://doi.org/10.5281/zenodo.6035335</citation> |
ae45992f969e
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit b1cc1aebf796f170d93e3dd46ffcdefdc7b8018a
recetox
parents:
10
diff
changeset
|
77 </citations> |
0
60f34912b3de
"planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 4d2ac914c951166e386a94d8ebb8cb1becfac122"
recetox
parents:
diff
changeset
|
78 </tool> |