annotate macros.xml @ 0:721a4e666191 draft default tip

planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/spec2vec commit f79a5b51599254817727bc9028b9797ea994cb4e
author recetox
date Tue, 27 Jun 2023 14:30:10 +0000
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
721a4e666191 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/spec2vec commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
diff changeset
1 <macros>
721a4e666191 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/spec2vec commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
diff changeset
2 <token name="@TOOL_VERSION@">0.8.0</token>
721a4e666191 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/spec2vec commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
diff changeset
3
721a4e666191 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/spec2vec commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
diff changeset
4 <xml name="creator">
721a4e666191 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/spec2vec commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
diff changeset
5 <creator>
721a4e666191 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/spec2vec commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
diff changeset
6 <person
721a4e666191 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/spec2vec commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
diff changeset
7 givenName="Maksym"
721a4e666191 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/spec2vec commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
diff changeset
8 familyName="Skoryk"
721a4e666191 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/spec2vec commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
diff changeset
9 url="https://github.com/maximskorik"
721a4e666191 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/spec2vec commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
diff changeset
10 identifier="0000-0003-2056-8018" />
721a4e666191 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/spec2vec commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
diff changeset
11 <person
721a4e666191 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/spec2vec commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
diff changeset
12 givenName="Helge"
721a4e666191 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/spec2vec commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
diff changeset
13 familyName="Hecht"
721a4e666191 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/spec2vec commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
diff changeset
14 url="https://github.com/hechth"
721a4e666191 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/spec2vec commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
diff changeset
15 identifier="0000-0001-6744-996X" />
721a4e666191 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/spec2vec commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
diff changeset
16 <organization
721a4e666191 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/spec2vec commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
diff changeset
17 url="https://www.recetox.muni.cz/"
721a4e666191 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/spec2vec commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
diff changeset
18 email="GalaxyToolsDevelopmentandDeployment@space.muni.cz"
721a4e666191 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/spec2vec commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
diff changeset
19 name="RECETOX MUNI" />
721a4e666191 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/spec2vec commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
diff changeset
20 </creator>
721a4e666191 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/spec2vec commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
diff changeset
21 </xml>
721a4e666191 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/spec2vec commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
diff changeset
22
721a4e666191 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/spec2vec commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
diff changeset
23 <xml name="edam">
721a4e666191 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/spec2vec commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
diff changeset
24 <xrefs>
721a4e666191 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/spec2vec commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
diff changeset
25 <xref type="bio.tools">spec2vec</xref>
721a4e666191 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/spec2vec commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
diff changeset
26 </xrefs>
721a4e666191 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/spec2vec commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
diff changeset
27 </xml>
721a4e666191 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/spec2vec commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
diff changeset
28
721a4e666191 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/spec2vec commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
diff changeset
29 <xml name="input_param">
721a4e666191 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/spec2vec commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
diff changeset
30 <conditional name="scores">
721a4e666191 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/spec2vec commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
diff changeset
31 <param name="use_scores" label="Use Scores Object" type="boolean" truevalue="TRUE" falsevalue="FALSE"
721a4e666191 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/spec2vec commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
diff changeset
32 checked="false"/>
721a4e666191 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/spec2vec commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
diff changeset
33 <when value="TRUE">
721a4e666191 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/spec2vec commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
diff changeset
34 <param label="Scores object" name="scores_in" type="data" format="json"
721a4e666191 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/spec2vec commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
diff changeset
35 help="Scores objects calculated previously using one of the matchms similarity tools." />
721a4e666191 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/spec2vec commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
diff changeset
36 </when>
721a4e666191 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/spec2vec commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
diff changeset
37 <when value="FALSE">
721a4e666191 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/spec2vec commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
diff changeset
38 <param label="Queries spectra" name="queries" type="data" format="msp,mgf"
721a4e666191 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/spec2vec commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
diff changeset
39 help="Query mass spectra to match against references."/>
721a4e666191 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/spec2vec commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
diff changeset
40 <param label="Reference spectra" name="references" type="data" format="msp,mgf"
721a4e666191 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/spec2vec commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
diff changeset
41 help="Reference mass spectra to match against as library."/>
721a4e666191 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/spec2vec commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
diff changeset
42 </when>
721a4e666191 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/spec2vec commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
diff changeset
43 </conditional>
721a4e666191 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/spec2vec commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
diff changeset
44 </xml>
721a4e666191 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/spec2vec commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
diff changeset
45
721a4e666191 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/spec2vec commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
diff changeset
46 <xml name="citations">
721a4e666191 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/spec2vec commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
diff changeset
47 <citations>
721a4e666191 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/spec2vec commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
diff changeset
48 <citation type="doi">10.1371/journal.pcbi.1008724</citation>
721a4e666191 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/spec2vec commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
diff changeset
49 </citations>
721a4e666191 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/spec2vec commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
diff changeset
50 </xml>
721a4e666191 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/spec2vec commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
diff changeset
51
721a4e666191 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/spec2vec commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
diff changeset
52 <token name="@init_scores@">
721a4e666191 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/spec2vec commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
diff changeset
53 from matchms.importing import load_from_msp, scores_from_json
721a4e666191 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/spec2vec commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
diff changeset
54 from matchms import Scores
721a4e666191 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/spec2vec commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
diff changeset
55 #if $scores.use_scores
721a4e666191 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/spec2vec commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
diff changeset
56 scores = scores_from_json("$scores_in")
721a4e666191 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/spec2vec commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
diff changeset
57 #else
721a4e666191 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/spec2vec commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
diff changeset
58 scores = Scores(references=list(load_from_msp("$references")), queries=list(load_from_msp("$queries")), is_symmetric=False)
721a4e666191 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/spec2vec commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
diff changeset
59 #end if
721a4e666191 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/spec2vec commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
diff changeset
60 </token>
721a4e666191 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/spec2vec commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
diff changeset
61
721a4e666191 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/spec2vec commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
diff changeset
62 <token name="@init_logger@">
721a4e666191 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/spec2vec commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
diff changeset
63 from matchms import set_matchms_logger_level
721a4e666191 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/spec2vec commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
diff changeset
64 set_matchms_logger_level("WARNING")
721a4e666191 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/spec2vec commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
diff changeset
65 </token>
721a4e666191 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/spec2vec commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
diff changeset
66
721a4e666191 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/spec2vec commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
diff changeset
67 <token name="@init_model@">
721a4e666191 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/spec2vec commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
diff changeset
68 import json
721a4e666191 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/spec2vec commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
diff changeset
69 from spec2vec.serialization.model_importing import load_weights, Word2VecLight
721a4e666191 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/spec2vec commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
diff changeset
70
721a4e666191 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/spec2vec commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
diff changeset
71 with open("${model_metadata}", "r", encoding="utf-8") as f:
721a4e666191 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/spec2vec commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
diff changeset
72 model: dict = json.load(f)
721a4e666191 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/spec2vec commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
diff changeset
73 del (model["mapfile_path"])
721a4e666191 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/spec2vec commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
diff changeset
74
721a4e666191 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/spec2vec commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
diff changeset
75 weights = load_weights("${model_weights}", model["__weights_format"])
721a4e666191 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/spec2vec commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
diff changeset
76 model = Word2VecLight(model, weights)
721a4e666191 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/spec2vec commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
diff changeset
77 </token>
721a4e666191 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/spec2vec commit f79a5b51599254817727bc9028b9797ea994cb4e
recetox
parents:
diff changeset
78 </macros>