Mercurial > repos > watsocam > palom
view palom_svs.xml @ 2:e30f622ef2c3 draft default tip
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/palom commit 08d9f2d59c26e67a162d75ae6e8b5fa734ab7b3c
author | goeckslab |
---|---|
date | Tue, 06 Sep 2022 21:15:56 +0000 |
parents | 69f8e01b2e17 |
children |
line wrap: on
line source
<tool id="palom" name="palom" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@"> <description>Piecewise alignment for layers of image mosaics.</description> <macros> <import>macros.xml</import> </macros> <expand macro="requirements" /> <command detect_errors="exit_code"><![CDATA[ ln -s '$reference_image' './ref.svs' && ln -s '$channels' './channels.csv' && #for $i in $moving_images: ln -s '$i' '${i.name}' && #end for python '$script' ]]></command> <configfiles> <configfile name = "script"> import os import pathlib import pandas as pd import matplotlib.pyplot as plt import palom from palom.cli.svs import run_palom plt.switch_backend('agg') cwd = os.getcwd() ref_img = pathlib.Path(os.path.join(cwd,'ref.svs')) images = [ref_img] channels = ['hematoxylin'] modes = ['hematoxylin'] #for $i in $moving_images: img = pathlib.Path('${i.name}') images.append(img) #end for channel_df = pd.read_csv(os.path.join(cwd, 'channels.csv')) channel_df = channel_df.astype({'channel':'string'}) channels += list(channel_df['channel']) modes += list(channel_df['mode']) pixel_size = None #if $pixel_size: pixel_size = float($pixel_size) #end if level = int($level) downscale_factor = int($downscale_factor) output_path = pathlib.Path(os.path.join(cwd, 'registered.ome.tiff')) qc_path = output_path.parent / 'qc' os.mkdir(qc_path) run_palom( img_paths = images, img_modes = modes, pixel_size = pixel_size, channel_names = channels, output_path = output_path, qc_path = qc_path, level = level, downscale_factor = downscale_factor ) </configfile> </configfiles> <inputs> <param name="reference_image" type="data" format="tiff" label="Hematoxylin reference image" help=".svs format image to align to"/> <param name="moving_images" type="data_collection" label="Moving Images (data collection)" help="A collection of .svs format images to align to the reference image"/> <param name="channels" type="data" label="Channel and mode dataframe" help="A CSV file with 'channel' and 'mode' columns, with a row for each moving image"/> <param name="pixel_size" type="float" optional="true" label="Pixel size (optional)" help="defaults to px size of reference image"/> <param name="level" type="integer" value="0" label="Pyramid level" help="pyramid level, defaults to 0 (lowest level)"/> <param name="downscale_factor" type="integer" value="2" label="Pyramid downscale factor" help="Default of 2 makes pyramid downscaling compatible with Avivator and Vitessce"/> </inputs> <outputs> <collection name="qc_plots" type="list" label="${tool.name}: qc_plots"> <discover_datasets pattern="__name_and_ext__" directory="qc" ext="png" visible="false"/> </collection> <data name="registered" from_work_dir="registered.ome.tiff" format="ome.tiff"/> </outputs> <tests> <test> <param name="reference_image" value="test_ref.svs"/> <param name="moving_images"> <collection type="list"> <element name="m1" value="test_moving.svs"/> </collection> </param> <param name="channels" value="test_channels.csv"/> <param name="level" value="1"/> <output_collection name="qc_plots" type="list"> <element name="01-test_moving.svs" ftype="png"> <assert_contents> <has_size value="277000" delta="100000" /> </assert_contents> </element> </output_collection> <output name="registered" ftype="ome.tiff"> <assert_contents> <has_size value="59000000" delta="20000000" /> </assert_contents> </output> </test> </tests> <help><![CDATA[ ------ PALOM ------ **PALOM** performs registration of whole-slide images with different IHC stainings. **Inputs** 1.) Reference image for aligning image mosiacs to 2.) A collection of images to be aligned 3.) File describing the channels/targets **Outputs** 1.) Registered image as ome.tiff 2.) Colleciton of QC plots More details on Github: https://github.com/Yu-AnChen/palom ]]></help> <expand macro="citations" /> </tool>