comparison SpyBOAT.xml @ 5:d5a4180410c4 draft default tip

"planemo upload commit 7bc843096b70fe1c8fc149e69d8f87fceac4eb3b"
author gregor.m
date Sat, 28 Nov 2020 18:50:09 +0000
parents a4c6fcf2c456
children
comparison
equal deleted inserted replaced
4:a4c6fcf2c456 5:d5a4180410c4
1 <tool id="spyboat" name="SpyBOAT" version="@TOOL_VERSION@">
2 <description>wavelet transforms image stacks</description>
3 <macros>
4 <token name="@TOOL_VERSION@">0.1.1</token>
5 </macros>
6
7 <requirements>
8 <requirement type="package" version="@TOOL_VERSION@">spyboat</requirement>
9 </requirements>
10 <version_command>python $__tool_directory__/spyboat_cli.py --version</version_command>
11 <command detect_errors="exit_code"><![CDATA[
12 python $__tool_directory__/spyboat_cli.py
13 --input_path '$movie'
14 #if $gauss_sigma:
15 --gauss_sigma $gauss_sigma
16 #end if
17 #if $rescale_factor:
18 --rescale $rescale_factor
19 #end if
20
21 #if $masking.selection_mode == "create_static_mask":
22 --masking static
23 --mask_frame $masking.mask_frame
24 --mask_thresh $masking.mask_thresh
25 #else if $masking.selection_mode == "create_dynamic_mask":
26 --masking dynamic
27 --mask_thresh $masking.mask_thresh
28 #end if
29
30 --dt $dt
31 --Tmin $tmin
32 --Tmax $tmax
33 --nT $nt
34 #if $tcutoff
35 --Tcutoff $tcutoff
36 #end if
37 #if $win_size:
38 --win_size $win_size
39 #end if
40
41 --phase_out $phase_out
42 --period_out $period_out
43 --power_out $power_out
44 --amplitude_out $amplitude_out
45 #if $preprocessed_out:
46 --preprocessed_out $preprocessed_out
47 #end if
48
49 --html_fname $html_out
50 --report_img_path '$html_out.extra_files_path'
51
52 --ncpu "\${GALAXY_SLOTS:-8}"
53 > $log
54
55 ]]></command>
56 <!-- "\${GALAXY_SLOTS:-8}" -->
57 <inputs>
58 <param name="movie" type="data" format="tiff" label="Movie to analyze"
59 help="Select a movie to wavelet analyze"/>
60
61 <!--
62 The following Wavelet parameters must have the same numerical type as defined in the
63 argparse parser in spyboat_cli.py
64 -->
65
66 <param name="gauss_sigma" type="float" label="Sigma"
67 help="Width of the Gaussian smoothing kernel, leave blank if no pre-smoothing desired." optional="true">
68 <validator type="in_range" min="0" max="9999999"/>
69 </param>
70
71 <param name="rescale_factor" type="integer" value="" label="Rescale factor"
72 help="Downsamples the input movie by this factor given in %, leave blank to disable downsampling"
73 optional="true">
74 <validator type="in_range" min="0" max="99"/>
75 </param>
76
77 <conditional name="masking">
78 <param label="Masking the output" name="selection_mode" type="select" help="Create a mask from the (blurred/rescaled) input to mask out regions without oscillations/signal in the output">
79 <option selected="true" value="no_masking">No masking</option>
80 <option value="create_static_mask">Create a static mask</option>
81 <option value="create_dynamic_mask">Create a dynamic mask</option>
82 </param>
83 <when value="no_masking">
84 </when>
85 <when value="create_static_mask">
86 <param name="mask_frame" type="integer" value="1" label="Create mask from frame"
87 help="Creates a static mask from the chosen frame of the input movie.">
88 <validator type="in_range" min="1" max="99999"/>
89 </param>
90 <param name="mask_thresh" type="float" value="0" label="Threshold"
91 help="All pixels below this threshold will be masked in the output.">
92 <validator type="in_range" min="0" max="999999"/>
93 </param>
94 </when>
95 <when value="create_dynamic_mask">
96 <param name="mask_thresh" type="float" value="0" label="Threshold"
97 help="For each frame of the input, all pixels below this threshold will be masked in the output.">
98 <validator type="in_range" min="0" max="999999"/>
99 </param>
100 </when>
101 </conditional>
102
103 <param name="dt" type="float" value="1" label="Sampling interval" help="Time span between two frames">
104 <validator type="in_range" min="0" max="9999999"/>
105 </param>
106 <param name="tmin" type="float" value="20" label="Smallest period" help="Lowest period for the wavelet transform">
107 <validator type="in_range" min="0" max="9999999"/>
108 </param>
109
110 <param name="tmax" type="float" value="30" label="Largest period"
111 help="Largest period for the wavelet transform">
112 <validator type="in_range" min="0" max="9999999"/>
113 </param>
114
115 <param name="nt" type="integer" value="150" label="Number of periods to scan for"
116 help="Determines period resolution of the Wavelet power spectra">
117 <validator type="in_range" min="0" max="9999999"/>
118 </param>
119
120 <param name="tcutoff" type="float" value="40" label="Tcutoff"
121 help="Cut-off-period for sinc filter detrending, a blank field disables detrending" optional="true">
122 <validator type="in_range" min="0" max="9999999"/>
123 </param>
124
125 <param name="win_size" type="float" value="" label="Sliding window size"
126 help="Window size for amplitude envelope estimation, leave blank to disable normalization "
127 optional="true">
128 <validator type="in_range" min="0" max="9999999"/>
129 </param>
130
131 <conditional name="save_preprocessed">
132 <param label="Save preprocessed input" name="selection" type="select" help="Save the blurred/rescaled input to history? ">
133 <option selected="true" value="No">No</option>
134 <option value="Yes">Yes</option>
135 </param>
136 <!-- there is an output filter picking up the choice -->
137 <when value="No">
138 </when>
139 <when value="Yes">
140 </when>
141 </conditional>
142 </inputs>
143
144 <outputs>
145 <data name="phase_out" format="tiff" label="${movie.name[:-4]}_phase"/>
146 <data name="period_out" format="tiff" label="${movie.name[:-4]}_period"/>
147 <data name="power_out" format="tiff" label="${movie.name[:-4]}_power"/>
148 <data name="amplitude_out" format="tiff" label="${movie.name[:-4]}_amplitude"/>
149 <data name="preprocessed_out" format="tiff" label="${movie.namee[:-4]}_preproc">
150 <filter>save_preprocessed['selection'] == 'Yes'</filter>
151 </data>
152
153 <data name="log" format="txt" label="log ${movie.name[:-4]}.txt"/>
154 <data format="html" name="html_out" label="Report ${movie.name[:-4]}"/>
155
156 </outputs>
157
158 <tests>
159 <test>
160 <param name="movie" value="test-movie.tif" ftype="tiff"/>
161 <output name="phase_out" file="phase_out.tif" ftype="tiff" compare="sim_size"/>
162 <output name="period_out" file="period_out.tif" ftype="tiff" compare="sim_size"/>
163 <output name="power_out" file="power_out.tif" ftype="tiff" compare="sim_size"/>
164 <output name="amplitude_out" file="amplitude_out.tif" ftype="tiff" compare="sim_size"/>
165 </test>
166 </tests>
167 <help><![CDATA[
168 **What it does**
169
170 Wavelet transforms a 3d-image stack (time,Y,X) pixel by pixel along the time axis and extracts/evaluates the wavelet ridge. Removal of low-frequency trends is provided via sinc filtering.
171 There are four output movies generated (phase, period, amplitude and power). They have exactly the same dimensions (time,Y,X) as the (rescaled) input.
172
173 Pre-smoothing of the data with Gaussian kernels is supported and often recommendable.
174
175 To limit the number of Wavelet transformations (computing time), downscaling of the input movie resolution is recommended.
176 Trimming away parts of the movie with no relevant data (e.g. outer dark edges) also speeds up the processing.
177
178 If multiple channels are present in your data, extract the channel of interest beforehand (e.g. with Fiji).
179
180 **Author**: Gregor Mönke (gregor.moenke@embl.de).
181
182 **Wrapper by**: Jelle Scholtalbers (jelle.scholtalbers@embl.de).
183
184 **Know what you are doing**
185
186 .. class:: warningmark
187
188 You will want to have understood the basics of time-frequency analysis with Wavelets, find more information about the analysis strategy employed at https://github.com/tensionhead/pyBOAT
189
190 **Parameter List**
191
192 - Sigma:
193
194 The Kernel bandwidth (in pixels) for the Gaussian kernels to use for pre-smoothing the input data. The default value of zero means that no pre-smoothing is done. Set this number to a desired kernel width to turn on pre-smoothing.
195
196 - Rescale factor:
197
198 Given in %, downsamples the spatial resolution of the input movie. This speeds
199 up the whole analysis by a lot.
200
201 - Masking:
202 SpyBOAT offers 'static' and 'dynamic' masking. 'static' means that a single mask is created by thresholding from a user selected frame. 'dynamic' creates a mask for each frame by thresholding, works better for moving/expanding/shrinking oscillatory fields.
203 - Sampling interval:
204
205 Time passed between consecutive measurements, e.g 'an image every 10 minutes'.
206
207 - Smallest Period:
208
209 The minimal period to scan for, this is the higher (in frequency) end of the spectrum. A warning will be given during processing if the chosen value deceeds the Nyquist limit (2 times the sampling interval).
210
211 - Largest period:
212
213 The maximal period to scan for, this is the lower (in frequency) end of the spectrum. The inbuild Sinc filter will remove any periods larger than this form the data. Due to the 'roll off' of the filter, this value should be chosen generously. A warning will be given during processing if the chosen value exceeds the length of the time series.
214
215 - Number of periods to scan for:
216
217 This is the the number of convolutions computed per pixel.
218
219 Spectral resolution = ( biggest period - smallest period ) / number of periods
220
221 - Tcutoff:
222
223 The cut-off period for the sinc filter, periods larger than this one will
224 be removed from the signal before the transform. If no value is given,
225 no detrending is performed. At least a gracious cut-off of around ~3 times
226 the largest period to be expected is recommended.
227
228 - Sliding window size
229
230 Length (in time units, e.g. hours) of the sliding window to estimate
231 an amplitude envelope. The signal then gets normalized by this envelope,
232 meaning that all amplitudes will be around ~1 after the transform. The
233 advantage is that signal with strong amplitude trends will have more
234 meaningful Wavelet powers after normalization.
235
236 ]]></help>
237 <citations>
238
239 <citation type="bibtex"> @article{monke2020optimal,
240 title={Optimal time frequency analysis for biological data-pyBOAT},
241 author={M{\"o}nke, Gregor and Sorgenfrei, Frieda A and Schmal, Christoph and Granada, Adri{\'a}n E},
242 journal={bioRxiv},
243 year={2020},
244 publisher={Cold Spring Harbor Laboratory}
245 }
246 </citation>
247 </citations>
248 </tool>