diff 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
line wrap: on
line diff
--- a/ashlar.xml	Fri Mar 12 00:14:49 2021 +0000
+++ b/ashlar.xml	Wed Aug 24 19:19:40 2022 +0000
@@ -1,11 +1,11 @@
-<tool id="ashlar" name="ASHLAR" version="@VERSION@.6" profile="17.09">
+<tool id="ashlar" name="ASHLAR" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="19.01">
     <description>Alignment by Simultaneous Harmonization of Layer/Adjacency Registration</description>
     <macros>
         <import>macros.xml</import>
     </macros>
  
     <expand macro="requirements"/>
-    @VERSION_CMD@
+    <expand macro="version_cmd"/>
 
     <command detect_errors="exit_code"><![CDATA[
 
@@ -13,41 +13,41 @@
           #set name_clean = str($file.element_identifier).replace('.ome.tiff','').replace('.tiff','').replace('.tiff.','')
 
           #if $type == "raw"
-            #set file_clean = $name_clean + ".ome.tiff"
+            #set file_clean = $name_clean + '.ome.tiff'
           #elif $type == "ffp"
-            #set file_clean = $name_clean + "_ffp.ome.tiff"
+            #set file_clean = $name_clean + '_ffp.ome.tiff'
           #elif $type == "dfp"
-            #set file_clean = $name_clean + "_dfp.ome.tiff"
+            #set file_clean = $name_clean + '_dfp.ome.tiff'
           #end if
 
           #return $file_clean
         #end def
 
         ## Link the illumination files to appropriate file extension
-        #for $dfp in $ldfp:
-            ln -s "$dfp" "$clean($dfp,"dfp")" &&
-        #end for
-        #for $ffp in $lffp:
-            ln -s "$ffp" "$clean($ffp,"ffp")" &&
-        #end for
+        #if $ldfp
+            #for $dfp in $ldfp:
+                ln -s '$dfp' '$clean($dfp,"dfp")' &&
+            #end for
+        #end if
+
+        #if $lffp
+            #for $ffp in $lffp:
+                ln -s '$ffp' '$clean($ffp,"ffp")' &&
+            #end for
+        #end if
 
         @CMD_BEGIN@
 
         ## Supply the raw images
         #for $raw in $lraw:
-            "$raw"
+            '$raw'
         #end for
 
         ## Additional arguments
         -m $max_shift
 
-        #if $flip_x
-        --flip-x
-        #end if
-
-        #if $flip_y
-        --flip-y
-        #end if
+        $flip_x
+        $flip_y
 
         -c $adv.align_channel
 
@@ -59,50 +59,43 @@
         --tile-size $adv.tile_size
         #end if
 
+        #if $lffp
         --ffp
-        #for $ffp in $lffp:
-            "$clean($ffp,"ffp")"
-        #end for
+            #for $ffp in $lffp:
+                '$clean($ffp,"ffp")'
+            #end for
+        #end if
+
+        #if $ldfp
         --dfp
-        #for $dfp in $ldfp:
-            "$clean($dfp,"dfp")"
-        #end for
-        --pyramid
+            #for $dfp in $ldfp:
+                '$clean($dfp,"dfp")'
+            #end for
+        #end if
+
+        $adv.pyramid
+        $adv.flip_mosaic_x
+        $adv.flip_mosaic_y
+
         -f registered.ome.tif;
 
         #if $upgrade.decide == "do_upgrade"
-        python ${__tool_directory__}/pyramid_upgrade.py
-        registered.ome.tif
+            python3 '${__tool_directory__}/pyramid_upgrade.py'
+            registered.ome.tif
 
-        #if $upgrade.markers_file
-        -n `python "$get_markers" "${upgrade.markers_file}"`
-        #end if
+            #if $upgrade.markers_file
+                -n `echo \$(cat $upgrade.markers_file | tail -n +2 | awk -F, '{print \$3}')`;
+            #end if
         #end if
     ]]></command>
 
-    <configfiles>
-        <configfile name="get_markers">
-import pandas as pd
-import sys
-
-marker_file = sys.argv[1]
-df = pd.read_csv(marker_file)
-print(' '.join(df['marker_name'].array)) 
-        </configfile>
-    </configfiles>
-
-
-
     <inputs>
-        <param name="lraw" type="data_collection" format="tiff" collection_type="list" label="Raw Images"/>
-        <param name="ldfp" type="data_collection" format="tiff" collection_type="list" label="Deep Field Profile Images"/>
-        <param name="lffp" type="data_collection" format="tiff" collection_type="list" label="Flat Field Profile Images"/>
-
-        <param name="flip_x" type="boolean" value="false" label="Flip X-axis"/>
-        <param name="flip_y" type="boolean" value="false" label="Flip Y-axis"/>
-
+        <param name="lraw" type="data_collection" format="ome.tiff,tiff" collection_type="list" label="Raw Images"/>
+        <param name="ldfp" type="data_collection" format="ome.tiff,tiff" collection_type="list" optional="true" label="Deep Field Profile Images"/>
+        <param name="lffp" type="data_collection" format="ome.tiff,tiff" collection_type="list" optional="true" label="Flat Field Profile Images"/>
+        <param name="flip_x" type="boolean" truevalue="--flip-x" falsevalue="" label="Flip X-axis"/>
+        <param name="flip_y" type="boolean" truevalue="--flip-y" falsevalue="" label="Flip Y-axis"/>
         <param name="max_shift" type="integer" value="30" label="Maximum allowed per-tile corrective shift" help="In micros"/>
-
         <conditional name="upgrade">
             <param name="decide" type="select" label="Upgrade to BF6-Compliant OME-TIFF Pyramid">
                 <option value="do_upgrade">Upgrade Pyramid</option>
@@ -118,63 +111,48 @@
             <param name="align_channel" type="integer" value="0" label="Align Channel Number"/>
             <param name="filter_sigma" type="float" optional="true" label="Sigma"/>
             <param name="tile_size" type="integer"  optional="true" label="Cyto Mask Channel"/>
+            <param name="flip_mosaic_x" type="boolean" truevalue="--flip-mosaic-x" falsevalue="" label="Flip output image horizontally"/>
+            <param name="flip_mosaic_y" type="boolean" truevalue="--flip-mosaic-y" falsevalue="" label="Flip output image vertically"/>
+            <param name="pyramid" type="boolean" checked="true" truevalue="--pyramid" falsevalue="" label="Write output as a single pyramidal TIFF"/>
         </section>
     </inputs>
 
     <outputs>
-        <data format="tiff" name="output" from_work_dir="registered.ome.tif" label="${tool.name} on ${on_string}"/>
+        <data format="ome.tiff" name="output" from_work_dir="registered.ome.tif" label="${tool.name} on ${on_string}"/>
     </outputs>
+    <tests>
+        <test>
+            <param name="lraw">
+                <collection type="list">
+                    <element name="rR1" value="ashlar_test_c0.tiff" />
+                    <element name="rR2" value="ashlar_test_c1.tiff" />
+                </collection>
+            </param>
+            <output name="output" ftype="ome.tiff">
+                <assert_contents>
+                    <has_size value="4000000" delta="1000000" />
+                </assert_contents>
+            </output>
+        </test>
+    </tests>
     <help><![CDATA[
-Ashlar python package for microscopy registration, developed by HMS (repo: https://github.com/labsyspharm/ashlar)
-        ashlar [-h] [-o DIR] [-c [CHANNEL]]
-       [--output-channels [CHANNEL [CHANNEL ...]]] [-m SHIFT]
-       [--filter-sigma SIGMA] [-f FORMAT] [--pyramid]
-       [--tile-size PIXELS] [--ffp [FILE [FILE ...]]]
-       [--dfp [FILE [FILE ...]]] [--plates] [-q] [--version]
-       [FILE [FILE ...]]
-
-Stitch and align one or more multi-series images
-
-positional arguments:
-  FILE                  an image file to be processed (one file per cycle)
+--------------------------------------------------------------------------------
+ASHLAR: Alignment by Simultaneous Harmonization of Layer/Adjacency Registration
+--------------------------------------------------------------------------------
 
-optional arguments:
-  -h, --help            show this help message and exit
-  -o DIR, --output DIR  write output image files to DIR; default is the
-                        current directory
-  -c [CHANNEL], --align-channel [CHANNEL]
-                        align images using channel number CHANNEL; numbering
-                        starts at 0
-  --output-channels [CHANNEL [CHANNEL ...]]
-                        output only channels listed in CHANNELS; numbering
-                        starts at 0
-  -m SHIFT, --maximum-shift SHIFT
-                        maximum allowed per-tile corrective shift in microns
-  --filter-sigma SIGMA  width in pixels of Gaussian filter to apply to images
-                        before alignment; default is 0 which disables
-                        filtering
-  -f FORMAT, --filename-format FORMAT
-                        use FORMAT to generate output filenames, with {cycle}
-                        and {channel} as required placeholders for the cycle
-                        and channel numbers; default is
-                        cycle_{cycle}_channel_{channel}.tif
-  --pyramid             write output as a single pyramidal TIFF
-  --tile-size PIXELS    set tile width and height to PIXELS (pyramid output
-                        only); default is 1024
-  --ffp [FILE [FILE ...]]
-                        read flat field profile image from FILES; if specified
-                        must be one common file for all cycles or one file for
-                        each cycle
-  --dfp [FILE [FILE ...]]
-                        read dark field profile image from FILES; if specified
-                        must be one common file for all cycles or one file for
-                        each cycle
-  --plates              enable plate mode for HTS data
-  -q, --quiet           suppress progress display
-  --version             print version
+**Whole-slide microscopy image stitching and registration in Python**
 
-OHSU Wrapper Repo: https://github.com/ohsu-comp-bio/ashlar
-Conda Package Available From: https://anaconda.org/ohsu-comp-bio/ashlar
+**Ashlar** performs fast, high-quality stitching of microscopy images. It also
+co-registers multiple rounds of cyclic imaging for methods such as CyCIF and
+CODEX. Ashlar can read image data directly from BioFormats-supported microscope
+vendor file formats as well as a directory of plain TIFF files. Output is saved
+as pyramidal, tiled OME-TIFF.
+
+Note that Ashlar requires unstitched individual "tile" images as input, so it is
+not suitable for microscopes or slide scanners that only provide pre-stitched
+images.
+
+*Visit https://labsyspharm.github.io/ashlar/ for the most up-to-date information on ASHLAR.*
     ]]></help>
     <expand macro="citations" />
 </tool>