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