comparison ipapy2_gibbs_sampler_add.xml @ 0:428abc41a101 draft default tip

planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
author recetox
date Fri, 16 May 2025 08:01:46 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:428abc41a101
1 <tool id="ipapy2_gibbs_sampler_add" name="ipaPy2 gibbs sampler additive" version="@TOOL_VERSION@+galaxy0" profile="@PROFILE@">
2 <macros>
3 <import>macros.xml</import>
4 </macros>
5
6 <expand macro="requirements"/>
7
8 <command detect_errors="exit_code"><![CDATA[
9 python3 '${__tool_directory__}/ipapy2_gibbs_sampler_add.py'
10 --input_dataset_mapped_isotope_patterns '${mapped_isotope_patterns}' '${mapped_isotope_patterns.ext}'
11 --input_dataset_annotations '${annotations}' '${annotations.ext}'
12 --noits '${noits}'
13 --burn '${burn}'
14 --delta_add '${delta_add}'
15 --all_out '${all_out}'
16 #if $zs:
17 --zs '${zs}' '${zs.ext}'
18 #else:
19 --zs '' ''
20 #end if
21 #if $zs_out:
22 --zs_out '${zs_out}' '${zs_out.ext}'
23 #else:
24 --zs_out '' ''
25 #end if
26 --output_dataset '${annotations_out}' '${annotations_out.ext}'
27 ]]></command>
28
29 <inputs>
30 <expand macro="gibbs"/>
31 <param name="delta_add" type="float" value="1" min="0" label="adducts weight" help="parameter used when computing the conditional priors. The parameter must be positive. The smaller the parameter the more weight the adducts connections have on the posterior probabilities. Default 1." />
32 </inputs>
33
34 <outputs>
35 <data label="${tool.name} annotations on ${on_string}" name="annotations_out" format_source="mapped_isotope_patterns"/>
36 <data label="${tool.name} zs on ${on_string}" name="zs_out" format="txt">
37 <filter>options['all_out']</filter>
38 </data>
39 </outputs>
40
41 <tests>
42 <test expect_num_outputs="2">
43 <param name="mapped_isotope_patterns" value="mapped_isotope_patterns.csv"/>
44 <param name="annotations" value="clean_annotations.csv"/>
45 <param name="noits" value="1000"/>
46 <param name="delta_add" value="0.1"/>
47 <!-- Not the best way to test, but the results are stochastic hence difficult to test-->
48 <output name="annotations_out">
49 <assert_contents>
50 <has_n_columns n="15" sep=","/>
51 <has_n_lines n="15" delta="5" />
52 <has_line line="id,name,formula,adduct,m/z,charge,RT range,ppm,isotope pattern score,fragmentation pattern score,prior,post,post Gibbs,chi-square pval,peak_id" />
53 </assert_contents>
54 </output>
55 </test>
56 </tests>
57
58 <help><![CDATA[
59
60 .. _ipapy2_gibbs_sampler_add:
61
62 =======================================
63 ipaPy2 Gibbs Sampler Additive Tool
64 =======================================
65
66 **Tool Description**
67
68 This tool implements a Gibbs sampler for the IPA (Integrated Probabilistic Annotation) model, focusing on additive (adducts-based) connections between features. It refines metabolite annotation probabilities by iteratively sampling from the posterior distribution, considering relationships between features that can be explained by known adduct transformations.
69
70 How it works
71 ------------
72
73 - The Gibbs sampler updates annotation probabilities by considering **adducts connections**: relationships between features that can be explained by known adduct transformations.
74 - The influence of adducts connections is controlled by the ``adducts weight`` (`delta_add`) parameter: smaller values increase the influence of adducts connections on the posterior probabilities.
75 - The process is stochastic, so results may vary between runs.
76 - Optionally, the sampler can output the sampled states (`zs_out`) for further analysis.
77
78 Inputs
79 ------
80
81 1. **Mapped isotope patterns**
82 Dataset containing mapped isotope patterns (e.g., output from the ipaPy2 map isotope patterns tool).
83
84 2. **Annotations**
85 Initial annotation table to be refined by the Gibbs sampler.
86
87 3. **Number of iterations (`noits`)**
88 Number of Gibbs sampler iterations to perform.
89
90 4. **Burn-in (`burn`)**
91 Number of initial iterations to discard (burn-in period).
92
93 5. **Adducts weight (`delta_add`)**
94 Parameter used when computing the conditional priors. Must be positive. The smaller the value, the more weight adducts connections have on the posterior probabilities (default: 1).
95
96 6. **All out (`all_out`)**
97 If enabled, outputs all intermediate results including sampled states.
98
99 7. **zs**
100 (Optional) Input file for initial state of the sampler.
101
102 Outputs
103 -------
104
105 - **annotations_out**
106 Refined annotation table with updated posterior probabilities.
107
108 - **zs_out**
109 (Optional) File containing sampled states from the Gibbs sampler (if `all_out` is enabled).
110
111 Example
112 -------
113
114 Suppose you have mapped isotope patterns and an initial annotation table. You can run the Gibbs sampler as follows:
115
116 .. code-block::
117
118 mapped_isotope_patterns.csv
119 clean_annotations.csv
120
121 Set the number of iterations (e.g., ``noits = 1000``) and the adducts weight (e.g., ``delta_add = 0.1``), then run the tool. The output will be a refined annotation table and, optionally, a file with sampled states.
122
123 Notes
124 -----
125
126 - The results are stochastic; repeated runs may yield slightly different outputs.
127 - For best results, ensure all input files are correctly formatted and contain the required columns.
128 - The tool supports multiple file formats (CSV, TSV, Parquet, Tabular) for flexibility.
129
130 References
131 ----------
132
133 - For more details on the Gibbs sampling algorithm and its application in metabolomics, refer to the ipaPy2 documentation or associated publications.
134
135 ]]></help>
136
137 <expand macro="citations"/>
138 </tool>