Mercurial > repos > perssond > ashlar
comparison ashlar.xml @ 1:f183d9de4622 draft
planemo upload for repository https://github.com/ohsu-comp-bio/ashlar commit 95998c84e130c9f3d2183591957464df7d90dd53
author | goeckslab |
---|---|
date | Wed, 24 Aug 2022 19:19:40 +0000 |
parents | b3054f3d42b2 |
children | 33ab2058c6d9 |
comparison
equal
deleted
inserted
replaced
0:b3054f3d42b2 | 1:f183d9de4622 |
---|---|
1 <tool id="ashlar" name="ASHLAR" version="@VERSION@.6" profile="17.09"> | 1 <tool id="ashlar" name="ASHLAR" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="19.01"> |
2 <description>Alignment by Simultaneous Harmonization of Layer/Adjacency Registration</description> | 2 <description>Alignment by Simultaneous Harmonization of Layer/Adjacency Registration</description> |
3 <macros> | 3 <macros> |
4 <import>macros.xml</import> | 4 <import>macros.xml</import> |
5 </macros> | 5 </macros> |
6 | 6 |
7 <expand macro="requirements"/> | 7 <expand macro="requirements"/> |
8 @VERSION_CMD@ | 8 <expand macro="version_cmd"/> |
9 | 9 |
10 <command detect_errors="exit_code"><![CDATA[ | 10 <command detect_errors="exit_code"><![CDATA[ |
11 | 11 |
12 #def clean(file,type) | 12 #def clean(file,type) |
13 #set name_clean = str($file.element_identifier).replace('.ome.tiff','').replace('.tiff','').replace('.tiff.','') | 13 #set name_clean = str($file.element_identifier).replace('.ome.tiff','').replace('.tiff','').replace('.tiff.','') |
14 | 14 |
15 #if $type == "raw" | 15 #if $type == "raw" |
16 #set file_clean = $name_clean + ".ome.tiff" | 16 #set file_clean = $name_clean + '.ome.tiff' |
17 #elif $type == "ffp" | 17 #elif $type == "ffp" |
18 #set file_clean = $name_clean + "_ffp.ome.tiff" | 18 #set file_clean = $name_clean + '_ffp.ome.tiff' |
19 #elif $type == "dfp" | 19 #elif $type == "dfp" |
20 #set file_clean = $name_clean + "_dfp.ome.tiff" | 20 #set file_clean = $name_clean + '_dfp.ome.tiff' |
21 #end if | 21 #end if |
22 | 22 |
23 #return $file_clean | 23 #return $file_clean |
24 #end def | 24 #end def |
25 | 25 |
26 ## Link the illumination files to appropriate file extension | 26 ## Link the illumination files to appropriate file extension |
27 #for $dfp in $ldfp: | 27 #if $ldfp |
28 ln -s "$dfp" "$clean($dfp,"dfp")" && | 28 #for $dfp in $ldfp: |
29 #end for | 29 ln -s '$dfp' '$clean($dfp,"dfp")' && |
30 #for $ffp in $lffp: | 30 #end for |
31 ln -s "$ffp" "$clean($ffp,"ffp")" && | 31 #end if |
32 #end for | 32 |
33 #if $lffp | |
34 #for $ffp in $lffp: | |
35 ln -s '$ffp' '$clean($ffp,"ffp")' && | |
36 #end for | |
37 #end if | |
33 | 38 |
34 @CMD_BEGIN@ | 39 @CMD_BEGIN@ |
35 | 40 |
36 ## Supply the raw images | 41 ## Supply the raw images |
37 #for $raw in $lraw: | 42 #for $raw in $lraw: |
38 "$raw" | 43 '$raw' |
39 #end for | 44 #end for |
40 | 45 |
41 ## Additional arguments | 46 ## Additional arguments |
42 -m $max_shift | 47 -m $max_shift |
43 | 48 |
44 #if $flip_x | 49 $flip_x |
45 --flip-x | 50 $flip_y |
46 #end if | |
47 | |
48 #if $flip_y | |
49 --flip-y | |
50 #end if | |
51 | 51 |
52 -c $adv.align_channel | 52 -c $adv.align_channel |
53 | 53 |
54 #if $adv.filter_sigma | 54 #if $adv.filter_sigma |
55 --filter-sigma $adv.filter_sigma | 55 --filter-sigma $adv.filter_sigma |
57 | 57 |
58 #if $adv.tile_size | 58 #if $adv.tile_size |
59 --tile-size $adv.tile_size | 59 --tile-size $adv.tile_size |
60 #end if | 60 #end if |
61 | 61 |
62 #if $lffp | |
62 --ffp | 63 --ffp |
63 #for $ffp in $lffp: | 64 #for $ffp in $lffp: |
64 "$clean($ffp,"ffp")" | 65 '$clean($ffp,"ffp")' |
65 #end for | 66 #end for |
67 #end if | |
68 | |
69 #if $ldfp | |
66 --dfp | 70 --dfp |
67 #for $dfp in $ldfp: | 71 #for $dfp in $ldfp: |
68 "$clean($dfp,"dfp")" | 72 '$clean($dfp,"dfp")' |
69 #end for | 73 #end for |
70 --pyramid | 74 #end if |
75 | |
76 $adv.pyramid | |
77 $adv.flip_mosaic_x | |
78 $adv.flip_mosaic_y | |
79 | |
71 -f registered.ome.tif; | 80 -f registered.ome.tif; |
72 | 81 |
73 #if $upgrade.decide == "do_upgrade" | 82 #if $upgrade.decide == "do_upgrade" |
74 python ${__tool_directory__}/pyramid_upgrade.py | 83 python3 '${__tool_directory__}/pyramid_upgrade.py' |
75 registered.ome.tif | 84 registered.ome.tif |
76 | 85 |
77 #if $upgrade.markers_file | 86 #if $upgrade.markers_file |
78 -n `python "$get_markers" "${upgrade.markers_file}"` | 87 -n `echo \$(cat $upgrade.markers_file | tail -n +2 | awk -F, '{print \$3}')`; |
79 #end if | 88 #end if |
80 #end if | 89 #end if |
81 ]]></command> | 90 ]]></command> |
82 | 91 |
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> | 92 <inputs> |
97 <param name="lraw" type="data_collection" format="tiff" collection_type="list" label="Raw Images"/> | 93 <param name="lraw" type="data_collection" format="ome.tiff,tiff" collection_type="list" label="Raw Images"/> |
98 <param name="ldfp" type="data_collection" format="tiff" collection_type="list" label="Deep Field Profile Images"/> | 94 <param name="ldfp" type="data_collection" format="ome.tiff,tiff" collection_type="list" optional="true" label="Deep Field Profile Images"/> |
99 <param name="lffp" type="data_collection" format="tiff" collection_type="list" label="Flat Field Profile Images"/> | 95 <param name="lffp" type="data_collection" format="ome.tiff,tiff" collection_type="list" optional="true" label="Flat Field Profile Images"/> |
100 | 96 <param name="flip_x" type="boolean" truevalue="--flip-x" falsevalue="" label="Flip X-axis"/> |
101 <param name="flip_x" type="boolean" value="false" label="Flip X-axis"/> | 97 <param name="flip_y" type="boolean" truevalue="--flip-y" falsevalue="" label="Flip Y-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"/> | 98 <param name="max_shift" type="integer" value="30" label="Maximum allowed per-tile corrective shift" help="In micros"/> |
105 | |
106 <conditional name="upgrade"> | 99 <conditional name="upgrade"> |
107 <param name="decide" type="select" label="Upgrade to BF6-Compliant OME-TIFF Pyramid"> | 100 <param name="decide" type="select" label="Upgrade to BF6-Compliant OME-TIFF Pyramid"> |
108 <option value="do_upgrade">Upgrade Pyramid</option> | 101 <option value="do_upgrade">Upgrade Pyramid</option> |
109 <option value="dont_upgrade">Leave Legacy Pyramid</option> | 102 <option value="dont_upgrade">Leave Legacy Pyramid</option> |
110 </param> | 103 </param> |
116 </conditional> | 109 </conditional> |
117 <section name="adv" title="Advanced Options" expanded="false"> | 110 <section name="adv" title="Advanced Options" expanded="false"> |
118 <param name="align_channel" type="integer" value="0" label="Align Channel Number"/> | 111 <param name="align_channel" type="integer" value="0" label="Align Channel Number"/> |
119 <param name="filter_sigma" type="float" optional="true" label="Sigma"/> | 112 <param name="filter_sigma" type="float" optional="true" label="Sigma"/> |
120 <param name="tile_size" type="integer" optional="true" label="Cyto Mask Channel"/> | 113 <param name="tile_size" type="integer" optional="true" label="Cyto Mask Channel"/> |
114 <param name="flip_mosaic_x" type="boolean" truevalue="--flip-mosaic-x" falsevalue="" label="Flip output image horizontally"/> | |
115 <param name="flip_mosaic_y" type="boolean" truevalue="--flip-mosaic-y" falsevalue="" label="Flip output image vertically"/> | |
116 <param name="pyramid" type="boolean" checked="true" truevalue="--pyramid" falsevalue="" label="Write output as a single pyramidal TIFF"/> | |
121 </section> | 117 </section> |
122 </inputs> | 118 </inputs> |
123 | 119 |
124 <outputs> | 120 <outputs> |
125 <data format="tiff" name="output" from_work_dir="registered.ome.tif" label="${tool.name} on ${on_string}"/> | 121 <data format="ome.tiff" name="output" from_work_dir="registered.ome.tif" label="${tool.name} on ${on_string}"/> |
126 </outputs> | 122 </outputs> |
123 <tests> | |
124 <test> | |
125 <param name="lraw"> | |
126 <collection type="list"> | |
127 <element name="rR1" value="ashlar_test_c0.tiff" /> | |
128 <element name="rR2" value="ashlar_test_c1.tiff" /> | |
129 </collection> | |
130 </param> | |
131 <output name="output" ftype="ome.tiff"> | |
132 <assert_contents> | |
133 <has_size value="4000000" delta="1000000" /> | |
134 </assert_contents> | |
135 </output> | |
136 </test> | |
137 </tests> | |
127 <help><![CDATA[ | 138 <help><![CDATA[ |
128 Ashlar python package for microscopy registration, developed by HMS (repo: https://github.com/labsyspharm/ashlar) | 139 -------------------------------------------------------------------------------- |
129 ashlar [-h] [-o DIR] [-c [CHANNEL]] | 140 ASHLAR: Alignment by Simultaneous Harmonization of Layer/Adjacency Registration |
130 [--output-channels [CHANNEL [CHANNEL ...]]] [-m SHIFT] | 141 -------------------------------------------------------------------------------- |
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 | 142 |
136 Stitch and align one or more multi-series images | 143 **Whole-slide microscopy image stitching and registration in Python** |
137 | 144 |
138 positional arguments: | 145 **Ashlar** performs fast, high-quality stitching of microscopy images. It also |
139 FILE an image file to be processed (one file per cycle) | 146 co-registers multiple rounds of cyclic imaging for methods such as CyCIF and |
147 CODEX. Ashlar can read image data directly from BioFormats-supported microscope | |
148 vendor file formats as well as a directory of plain TIFF files. Output is saved | |
149 as pyramidal, tiled OME-TIFF. | |
140 | 150 |
141 optional arguments: | 151 Note that Ashlar requires unstitched individual "tile" images as input, so it is |
142 -h, --help show this help message and exit | 152 not suitable for microscopes or slide scanners that only provide pre-stitched |
143 -o DIR, --output DIR write output image files to DIR; default is the | 153 images. |
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 | 154 |
176 OHSU Wrapper Repo: https://github.com/ohsu-comp-bio/ashlar | 155 *Visit https://labsyspharm.github.io/ashlar/ for the most up-to-date information on ASHLAR.* |
177 Conda Package Available From: https://anaconda.org/ohsu-comp-bio/ashlar | |
178 ]]></help> | 156 ]]></help> |
179 <expand macro="citations" /> | 157 <expand macro="citations" /> |
180 </tool> | 158 </tool> |