comparison matchms_fingerprint_similarity.xml @ 0:84af792d3a78 draft

planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit f79a5b51599254817727bc9028b9797ea994cb4e
author recetox
date Tue, 27 Jun 2023 14:27:04 +0000
parents
children df85b26201d1
comparison
equal deleted inserted replaced
-1:000000000000 0:84af792d3a78
1 <tool id="matchms_fingerprint_similarity" name="matchms fingerprint similarity" version="@TOOL_VERSION@+galaxy0" profile="21.09">
2 <description>calculate similarity between molecular fingerprints calculated from structural spectrum metadata descriptors</description>
3
4 <macros>
5 <import>macros.xml</import>
6 <import>help.xml</import>
7 </macros>
8 <expand macro="creator"/>
9 <edam_operations>
10 <edam_operation>operation_0360</edam_operation>
11 </edam_operations>
12 <expand macro="bio.tools"/>
13
14 <requirements>
15 <requirement type="package" version="@TOOL_VERSION@">matchms</requirement>
16 </requirements>
17
18
19 <command detect_errors="exit_code"><![CDATA[
20 python3 ${python_wrapper}
21 ]]> </command>
22
23 <configfiles>
24 <configfile name="python_wrapper">
25 @init_logger@
26
27 from matchms.similarity import FingerprintSimilarity
28 similarity = FingerprintSimilarity(similarity_measure="${fingerprint_similarity}")
29 @init_scores@
30
31 from matchms.filtering import add_fingerprint
32 import numpy as np
33
34 name="FingerprintSimilarity_${fingerprint_similarity}"
35
36 layer = similarity.matrix(
37 references=np.asarray(list(map(add_fingerprint, scores.references))),
38 queries=np.asarray(list(map(add_fingerprint, scores.queries))),
39 array_type = "numpy",
40 is_symmetric=scores.is_symmetric)
41
42 scores._scores.add_dense_matrix(layer, name)
43 scores.to_json("$scores_out")
44 </configfile>
45 </configfiles>
46
47 <inputs>
48 <expand macro="input_param"/>
49 <param label="Fingerprint similarity distance" name="fingerprint_similarity" type="select" display="radio"
50 help="Distance measure to use to compute between the molecular fingerprints - see [2] for details regarding the used fingerprint.">
51 <option value="jaccard" selected="true">jaccard</option>
52 <option value="dice">dice</option>
53 <option value="cosine">cosine</option>
54 </param>
55 </inputs>
56
57 <outputs>
58 <data label="$fingerprint_similarity distance between fingerprints in ${on_string}" name="scores_out" format="json"/>
59 </outputs>
60
61 <tests>
62 <test>
63 <param name="queries" value="similarity/rcx_gc-ei_ms_subset.msp" ftype="msp"/>
64 <param name="references" value="similarity/rcx_exposome_pesticides_subset.msp" ftype="msp"/>
65 <param name="fingerprint_similarity" value="dice" />
66 <output name="scores_out" value="fingerprints/dice.json" ftype="json" />
67 </test>
68 <test>
69 <param name="queries" value="similarity/rcx_gc-ei_ms_subset.msp" ftype="msp"/>
70 <param name="references" value="similarity/rcx_exposome_pesticides_subset.msp" ftype="msp"/>
71 <param name="fingerprint_similarity" value="cosine" />
72 <output name="scores_out" value="fingerprints/cosine.json" ftype="json" />
73 </test>
74 <test>
75 <param name="use_scores" value="True"/>
76 <param name="scores_in" value="metadata_match/inner_join_ri_20.json" ftype="json"/>
77 <param name="fingerprint_similarity" value="jaccard" />
78 <output name="scores_out" value="fingerprints/jaccard_scores.json" ftype="json" />
79 </test>
80 </tests>
81
82 <help>
83 Description
84 Molecular fingerprints are a digital representation of a molecule based on specific patterns, such as substructures or physicochemical properties.
85 They usually have a fixed length with each entry representing the presence or absence of a certain attribute.
86 Similarity between molecular fingerprints can serve as a proxy for structural similarity and can therefore be used to compare molecules.
87
88 .. rubric:: **Footnotes**
89 .. [1] SQL join types explained on LearnSQL_.
90 .. [2] Fingerprint - the `daylight fingerprint`_ is used to compute chemical similarity.
91 Fingerprints are derived from SMILES or InChI structure notations present in the spectrum metadata.
92
93 .. _LearnSQL: https://learnsql.com/blog/sql-joins-types-explained/
94 .. _daylight fingerprint: https://www.daylight.com/dayhtml/doc/theory/theory.finger.html
95
96 @HELP_matchms@
97 </help>
98
99 <expand macro="citations"/>
100 </tool>