Mercurial > repos > recetox > matchms_networking
comparison matchms_networking.xml @ 0:e4ec3592507f draft
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit f7bab98744e338dcdbdc9cf6f9de287632c76ea2
author | recetox |
---|---|
date | Tue, 18 Oct 2022 13:23:28 +0000 |
parents | |
children | 8147d93d372d |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:e4ec3592507f |
---|---|
1 <tool id="matchms_networking" name="matchMS networking" version="@TOOL_VERSION@+galaxy0" python_template_version="3.5"> | |
2 <description>create similarity network graph from matchMS similarity scores</description> | |
3 | |
4 <macros> | |
5 <import>macros.xml</import> | |
6 </macros> | |
7 <expand macro="creator"/> | |
8 | |
9 <requirements> | |
10 <requirement type="package" version="@TOOL_VERSION@">matchms</requirement> | |
11 </requirements> | |
12 | |
13 <environment_variables> | |
14 <environment_variable name="MPLCONFIGDIR">\$_GALAXY_JOB_TMP_DIR</environment_variable> | |
15 <environment_variable name="XDG_CACHE_HOME">\$_GALAXY_JOB_TMP_DIR</environment_variable> | |
16 </environment_variables> | |
17 | |
18 <command detect_errors="aggressive"><![CDATA[ | |
19 sh ${matchms_networking_cli} | |
20 ]]></command> | |
21 | |
22 <configfiles> | |
23 <configfile name="matchms_networking_cli"> | |
24 python3 ${__tool_directory__}/matchms_networking_wrapper.py \ | |
25 --graph_format "$graph_format" \ | |
26 --identifier "$identifier_key" \ | |
27 --top_n "$top_n" \ | |
28 --max_links "$max_links" \ | |
29 --score_cutoff "$score_cutoff" \ | |
30 --link_method "$link_method" \ | |
31 #if $keep_unconnected_nodes | |
32 --keep_unconnected_nodes \ | |
33 #end if | |
34 "$scores" \ | |
35 "$similarity_network_file" | |
36 </configfile> | |
37 </configfiles> | |
38 | |
39 <inputs> | |
40 <param label="Similarity scores" name="scores" type="data" format="json" | |
41 help="matchMS similarity-scores file."/> | |
42 <param label="Network-graph format" name="graph_format" type="select" | |
43 help="Output format of the similarity network."> | |
44 <option value="graphml">graphml</option> | |
45 <option value="cyjs">cyjs</option> | |
46 <option value="gexf">gexf</option> | |
47 <option value="gml">gml</option> | |
48 <option value="json">json</option> | |
49 </param> | |
50 <param label="Identifier key" name="identifier_key" type="text" | |
51 help="Unique metadata identifier of each spectrum from which scores are computed."/> | |
52 <param label="Number of top edges to keep" name="top_n" type="integer" value="20" | |
53 help="The number of highest-score edges to keep between a pair of nodes. Depending on 'Link method' parameter the top N edges will be selected either from disjoined | |
54 sets of individual specta or joined subset of scores between the given pair of spectra. This value has to be higher than the 'Maximum number of links'."/> | |
55 <param label="Maximum number of links per node" name="max_links" type="integer" value="10" | |
56 help="Maximum number of links to add per node."/> | |
57 <param label="Score cutoff" name="score_cutoff" type="float" value="0.7" min="0.0" max="1.0" | |
58 help="Minimum similarity score value to link two spectra."/> | |
59 <param label="Link method" name="link_method" type="select" display="radio" | |
60 help="Method for computing top N edges for each node. | |
61 If selected 'Single', top N nodes will be selected from disjoined sets of highest scores for nodes of a given pair (i.e., if a given edge belongs to top N scores of at least one node, it is kept). | |
62 If selected 'Mutual', top N nodes will be selected from a joined subset of a given spectra pair (i.e., if and only if a given edge belongs to top N scores of both nodes, it is kept)."> | |
63 <option value="single" selected="true">Single</option> | |
64 <option value="mutual">Mutual</option> | |
65 </param> | |
66 <param label="Keep unconnected nodes" name="keep_unconnected_nodes" type="boolean" checked="true" | |
67 help="If set to No all unconnected nodes will be removed."/> | |
68 </inputs> | |
69 | |
70 <outputs> | |
71 <data label="Similarity network of ${scores.name}" name="similarity_network_file"> | |
72 <change_format> | |
73 <when input="graph_format" value="graphml" format="graphml"/> | |
74 <when input="graph_format" value="cyjs" format="cyjs"/> | |
75 <when input="graph_format" value="gexf" format="gexf"/> | |
76 <when input="graph_format" value="gml" format="gml"/> | |
77 <when input="graph_format" value="json" format="json"/> | |
78 </change_format> | |
79 </data> | |
80 </outputs> | |
81 | |
82 <tests> | |
83 <test> | |
84 <param name="scores" value="scores.json" ftype="json"/> | |
85 <param name="graph_format" value="graphml"/> | |
86 <param name="identifier_key" value="compound_name"/> | |
87 <output name="similarity_network_file" ftype="graphml"> | |
88 <assert_contents> | |
89 <is_valid_xml /> | |
90 <has_line_matching expression='.*node id="C[0-9]*"\/.' n="138"/> | |
91 <has_line_matching expression='.*edge source="C[0-9]*" target="C[0-9]*".' n="16"/> | |
92 <has_line_matching expression='\s*.data key="d0".0\.[0-9]*.*' n="16"/> | |
93 </assert_contents> | |
94 </output> | |
95 </test> | |
96 <test> | |
97 <param name="scores" value="scores.json" ftype="json"/> | |
98 <param name="graph_format" value="cyjs"/> | |
99 <param name="identifier_key" value="compound_name"/> | |
100 <output name="similarity_network_file" ftype="cyjs"> | |
101 <assert_contents> | |
102 <has_text_matching expression='{"data": {"id": "C[0-9]*", "value": "C[0-9]*", "name": "C[0-9]*"}}' n="138"/> | |
103 <has_text_matching expression='{"data": {"weight": 0\.[0-9]*, "source": "C[0-9]*", "target": "C[0-9]*"}}' n="16"/> | |
104 </assert_contents> | |
105 </output> | |
106 </test> | |
107 <test> | |
108 <param name="scores" value="scores.json" ftype="json"/> | |
109 <param name="graph_format" value="gexf"/> | |
110 <param name="identifier_key" value="compound_name"/> | |
111 <output name="similarity_network_file" ftype="gexf"> | |
112 <assert_contents> | |
113 <is_valid_xml /> | |
114 <has_line_matching expression='.*node id="C[0-9]*" label="C[0-9]*" \/.' n="138"/> | |
115 <has_line_matching expression='\s*.edge source="C[0-9]*" target="C[0-9]*" id="[0-9]*" weight="0.[0-9]*" \/.' n="16"/> | |
116 </assert_contents> | |
117 </output> | |
118 </test> | |
119 <test> | |
120 <param name="scores" value="scores.json" ftype="json"/> | |
121 <param name="graph_format" value="gml"/> | |
122 <param name="identifier_key" value="compound_name"/> | |
123 <output name="similarity_network_file" ftype="gml"> | |
124 <assert_contents> | |
125 <has_line_matching expression='\s*node \[\n\s*id [0-9]*\n\s*label "C[0-9]*"\n\s*\]' n="138"/> | |
126 <has_line_matching expression='\s*edge \[\n\s*source [0-9]*\n\s*target [0-9]*\n\s*weight 0\.[0-9]*\n\s*\]' n="16"/> | |
127 </assert_contents> | |
128 </output> | |
129 </test> | |
130 <test> | |
131 <param name="scores" value="scores.json" ftype="json"/> | |
132 <param name="graph_format" value="json"/> | |
133 <param name="identifier_key" value="compound_name"/> | |
134 <output name="similarity_network_file" ftype="json"> | |
135 <assert_contents> | |
136 <has_text_matching expression='{"id": "C[0-9]*"}' n="138"/> | |
137 <has_text_matching expression='{"weight": 0\.[0-9]*, "source": "C[0-9]*", "target": "C[0-9]*"}' n="16"/> | |
138 </assert_contents> | |
139 </output> | |
140 </test> | |
141 <test> | |
142 <param name="scores" value="scores.json" ftype="json"/> | |
143 <param name="graph_format" value="graphml"/> | |
144 <param name="identifier_key" value="compound_name"/> | |
145 <param name="keep_unconnected_nodes" value="false"/> | |
146 <output name="similarity_network_file" ftype="graphml"> | |
147 <assert_contents> | |
148 <is_valid_xml /> | |
149 <has_line_matching expression='.*node id="C[0-9]*"\/.' n="25"/> | |
150 <has_line_matching expression='.*edge source="C[0-9]*" target="C[0-9]*".' n="16"/> | |
151 <has_line_matching expression='\s*.data key="d0".0\.[0-9]*.*' n="16"/> | |
152 </assert_contents> | |
153 </output> | |
154 </test> | |
155 <test> | |
156 <param name="scores" value="scores.json" ftype="json"/> | |
157 <param name="graph_format" value="graphml"/> | |
158 <param name="identifier_key" value="compound_name"/> | |
159 <param name="score_cutoff" value="0.4"/> | |
160 <param name="keep_unconnected_nodes" value="false"/> | |
161 <output name="similarity_network_file" ftype="graphml"> | |
162 <assert_contents> | |
163 <is_valid_xml /> | |
164 <has_line_matching expression='.*node id="C[0-9]*"\/.' n="59"/> | |
165 <has_line_matching expression='.*edge source="C[0-9]*" target="C[0-9]*".' n="52"/> | |
166 <has_line_matching expression='\s*.data key="d0".0\.[0-9]*.*' n="52"/> | |
167 </assert_contents> | |
168 </output> | |
169 </test> | |
170 <test> | |
171 <param name="scores" value="scores.json" ftype="json"/> | |
172 <param name="graph_format" value="cyjs"/> | |
173 <param name="identifier_key" value="compound_name"/> | |
174 <param name="score_cutoff" value="0.8"/> | |
175 <param name="link_method" value="mutual"/> | |
176 <param name="keep_unconnected_nodes" value="false"/> | |
177 <output name="similarity_network_file" ftype="cyjs"> | |
178 <assert_contents> | |
179 <has_text_matching expression='{"data": {"id": "C[0-9]*", "value": "C[0-9]*", "name": "C[0-9]*"}}' n="18"/> | |
180 <has_text_matching expression='{"data": {"weight": 0\.[0-9]*, "source": "C[0-9]*", "target": "C[0-9]*"}}' n="9"/> | |
181 </assert_contents> | |
182 </output> | |
183 </test> | |
184 </tests> | |
185 | |
186 <help><![CDATA[ | |
187 @HELP_matchms_networking@ | |
188 ]]></help> | |
189 | |
190 <expand macro="citations"/> | |
191 | |
192 </tool> |