Mercurial > repos > recetox > spec2vec_training
comparison macros.xml @ 1:989d1e182576 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:23:47 +0000 |
parents | 4e4d3c8efb22 |
children |
comparison
equal
deleted
inserted
replaced
0:4e4d3c8efb22 | 1:989d1e182576 |
---|---|
1 <macros> | 1 <macros> |
2 <token name="@COMMIT_SHA@">c9b54b9</token> | 2 <token name="@TOOL_VERSION@">0.8.0</token> |
3 <token name="@TOOL_VERSION@">0.6.0</token> | |
4 <token name="@TOOL_DEV_VERSION@">0</token> | |
5 | 3 |
6 <xml name="creator"> | 4 <xml name="creator"> |
7 <creator> | 5 <creator> |
8 <person | 6 <person |
9 givenName="Maksym" | 7 givenName="Maksym" |
10 familyName="Skoryk" | 8 familyName="Skoryk" |
11 url="https://github.com/maximskorik" | 9 url="https://github.com/maximskorik" |
12 identifier="0000-0003-2056-8018" /> | 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" /> | |
13 <organization | 16 <organization |
14 url="https://www.recetox.muni.cz/" | 17 url="https://www.recetox.muni.cz/" |
15 email="GalaxyToolsDevelopmentandDeployment@space.muni.cz" | 18 email="GalaxyToolsDevelopmentandDeployment@space.muni.cz" |
16 name="RECETOX MUNI" /> | 19 name="RECETOX MUNI" /> |
17 </creator> | 20 </creator> |
18 </xml> | 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> | |
19 </macros> | 78 </macros> |