comparison ashlar.xml @ 0:b3054f3d42b2 draft

"planemo upload for repository https://github.com/ohsu-comp-bio/ashlar commit 27f0c9be58e9e5aecc69067d0e60b5cb945de4b2-dirty"
author perssond
date Fri, 12 Mar 2021 00:14:49 +0000
parents
children f183d9de4622
comparison
equal deleted inserted replaced
-1:000000000000 0:b3054f3d42b2
1 <tool id="ashlar" name="ASHLAR" version="@VERSION@.6" profile="17.09">
2 <description>Alignment by Simultaneous Harmonization of Layer/Adjacency Registration</description>
3 <macros>
4 <import>macros.xml</import>
5 </macros>
6
7 <expand macro="requirements"/>
8 @VERSION_CMD@
9
10 <command detect_errors="exit_code"><![CDATA[
11
12 #def clean(file,type)
13 #set name_clean = str($file.element_identifier).replace('.ome.tiff','').replace('.tiff','').replace('.tiff.','')
14
15 #if $type == "raw"
16 #set file_clean = $name_clean + ".ome.tiff"
17 #elif $type == "ffp"
18 #set file_clean = $name_clean + "_ffp.ome.tiff"
19 #elif $type == "dfp"
20 #set file_clean = $name_clean + "_dfp.ome.tiff"
21 #end if
22
23 #return $file_clean
24 #end def
25
26 ## Link the illumination files to appropriate file extension
27 #for $dfp in $ldfp:
28 ln -s "$dfp" "$clean($dfp,"dfp")" &&
29 #end for
30 #for $ffp in $lffp:
31 ln -s "$ffp" "$clean($ffp,"ffp")" &&
32 #end for
33
34 @CMD_BEGIN@
35
36 ## Supply the raw images
37 #for $raw in $lraw:
38 "$raw"
39 #end for
40
41 ## Additional arguments
42 -m $max_shift
43
44 #if $flip_x
45 --flip-x
46 #end if
47
48 #if $flip_y
49 --flip-y
50 #end if
51
52 -c $adv.align_channel
53
54 #if $adv.filter_sigma
55 --filter-sigma $adv.filter_sigma
56 #end if
57
58 #if $adv.tile_size
59 --tile-size $adv.tile_size
60 #end if
61
62 --ffp
63 #for $ffp in $lffp:
64 "$clean($ffp,"ffp")"
65 #end for
66 --dfp
67 #for $dfp in $ldfp:
68 "$clean($dfp,"dfp")"
69 #end for
70 --pyramid
71 -f registered.ome.tif;
72
73 #if $upgrade.decide == "do_upgrade"
74 python ${__tool_directory__}/pyramid_upgrade.py
75 registered.ome.tif
76
77 #if $upgrade.markers_file
78 -n `python "$get_markers" "${upgrade.markers_file}"`
79 #end if
80 #end if
81 ]]></command>
82
83 <configfiles>
84 <configfile name="get_markers">
85 import pandas as pd
86 import sys
87
88 marker_file = sys.argv[1]
89 df = pd.read_csv(marker_file)
90 print(' '.join(df['marker_name'].array))
91 </configfile>
92 </configfiles>
93
94
95
96 <inputs>
97 <param name="lraw" type="data_collection" format="tiff" collection_type="list" label="Raw Images"/>
98 <param name="ldfp" type="data_collection" format="tiff" collection_type="list" label="Deep Field Profile Images"/>
99 <param name="lffp" type="data_collection" format="tiff" collection_type="list" label="Flat Field Profile Images"/>
100
101 <param name="flip_x" type="boolean" value="false" label="Flip X-axis"/>
102 <param name="flip_y" type="boolean" value="false" label="Flip Y-axis"/>
103
104 <param name="max_shift" type="integer" value="30" label="Maximum allowed per-tile corrective shift" help="In micros"/>
105
106 <conditional name="upgrade">
107 <param name="decide" type="select" label="Upgrade to BF6-Compliant OME-TIFF Pyramid">
108 <option value="do_upgrade">Upgrade Pyramid</option>
109 <option value="dont_upgrade">Leave Legacy Pyramid</option>
110 </param>
111 <when value="do_upgrade">
112 <param name="markers_file" type="data" format="csv,tabular" optional="true" label="Markers File (optional)"/>
113 </when>
114 <when value="dont_upgrade">
115 </when>
116 </conditional>
117 <section name="adv" title="Advanced Options" expanded="false">
118 <param name="align_channel" type="integer" value="0" label="Align Channel Number"/>
119 <param name="filter_sigma" type="float" optional="true" label="Sigma"/>
120 <param name="tile_size" type="integer" optional="true" label="Cyto Mask Channel"/>
121 </section>
122 </inputs>
123
124 <outputs>
125 <data format="tiff" name="output" from_work_dir="registered.ome.tif" label="${tool.name} on ${on_string}"/>
126 </outputs>
127 <help><![CDATA[
128 Ashlar python package for microscopy registration, developed by HMS (repo: https://github.com/labsyspharm/ashlar)
129 ashlar [-h] [-o DIR] [-c [CHANNEL]]
130 [--output-channels [CHANNEL [CHANNEL ...]]] [-m SHIFT]
131 [--filter-sigma SIGMA] [-f FORMAT] [--pyramid]
132 [--tile-size PIXELS] [--ffp [FILE [FILE ...]]]
133 [--dfp [FILE [FILE ...]]] [--plates] [-q] [--version]
134 [FILE [FILE ...]]
135
136 Stitch and align one or more multi-series images
137
138 positional arguments:
139 FILE an image file to be processed (one file per cycle)
140
141 optional arguments:
142 -h, --help show this help message and exit
143 -o DIR, --output DIR write output image files to DIR; default is the
144 current directory
145 -c [CHANNEL], --align-channel [CHANNEL]
146 align images using channel number CHANNEL; numbering
147 starts at 0
148 --output-channels [CHANNEL [CHANNEL ...]]
149 output only channels listed in CHANNELS; numbering
150 starts at 0
151 -m SHIFT, --maximum-shift SHIFT
152 maximum allowed per-tile corrective shift in microns
153 --filter-sigma SIGMA width in pixels of Gaussian filter to apply to images
154 before alignment; default is 0 which disables
155 filtering
156 -f FORMAT, --filename-format FORMAT
157 use FORMAT to generate output filenames, with {cycle}
158 and {channel} as required placeholders for the cycle
159 and channel numbers; default is
160 cycle_{cycle}_channel_{channel}.tif
161 --pyramid write output as a single pyramidal TIFF
162 --tile-size PIXELS set tile width and height to PIXELS (pyramid output
163 only); default is 1024
164 --ffp [FILE [FILE ...]]
165 read flat field profile image from FILES; if specified
166 must be one common file for all cycles or one file for
167 each cycle
168 --dfp [FILE [FILE ...]]
169 read dark field profile image from FILES; if specified
170 must be one common file for all cycles or one file for
171 each cycle
172 --plates enable plate mode for HTS data
173 -q, --quiet suppress progress display
174 --version print version
175
176 OHSU Wrapper Repo: https://github.com/ohsu-comp-bio/ashlar
177 Conda Package Available From: https://anaconda.org/ohsu-comp-bio/ashlar
178 ]]></help>
179 <expand macro="citations" />
180 </tool>