Skip to content

Commit 25cbe53

Browse files
authored
Merge pull request #1614 from nilchia/vpt
add vpt
2 parents 662df3c + 4070e95 commit 25cbe53

File tree

4 files changed

+1187
-0
lines changed

4 files changed

+1187
-0
lines changed

tools/vpt/.shed.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: vpt
2+
owner: bgruening
3+
description: Vizgen Post-processing Tool
4+
homepage_url: https://vizgen.github.io/vizgen-postprocessing/
5+
long_description: |
6+
The Vizgen Post-processing Tool (VPT) enables users to reprocess and refine the single-cell results of MERSCOPE experiments. VPT is a command line tool that emphasizes scalable, reproducible analysis, and can be run on a workstation, a cluster, or be deployed in a cloud computing environment.
7+
remote_repository_url: https://github.com/bgruening/galaxytools/tree/master/tools/vpt
8+
type: unrestricted
9+
categories:
10+
- Single Cell
11+
- Spatial Omics
12+
- Transcriptomics
13+
- Imaging
14+
auto_tool_repositories:
15+
name_template: "{{ tool_id }}"
16+
description_template: "Wrapper for {{ tool_name }}."
17+
suite:
18+
name: "suite_vpt"
19+
description: "A suite of Galaxy tools designed to work with the vpt-tools collection."
20+
type: repository_suite_definition

tools/vpt/macros.xml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
<macros>
2+
<token name="@TOOL_VERSION@">1.3.0</token>
3+
<token name="@VERSION_SUFFIX@">0</token>
4+
<token name="@PROFILE@">23.0</token>
5+
<xml name="requirements">
6+
<requirements>
7+
<container type="docker">quay.io/bgruening/vpt:1.3.0-1</container>
8+
<yield/>
9+
</requirements>
10+
</xml>
11+
<xml name="creator">
12+
<creator>
13+
<organization name="European Galaxy Team" url="https://galaxyproject.org/eu/" />
14+
<person givenName="Amirhossein" familyName="Naghsh Nilchi" email="nilchia@informatik.uni-freiburg.de" />
15+
<person givenName="Pavan" familyName="Videm" email="videmp@informatik.uni-freiburg.de" />
16+
<person givenName="Björn" familyName="Grüning" email="gruening@informatik.uni-freiburg.de" />
17+
</creator>
18+
</xml>
19+
<token name="@CMD@"><![CDATA[
20+
mkdir -p 'input/images' 'output/' &&
21+
#for $image in $input_images:
22+
ln -s '$image' 'input/images/${image.element_identifier}.${image.ext}' &&
23+
#end for
24+
ln -s '$input_micron_to_mosaic' 'input/micron_to_mosaic_pixel_transform.csv' &&
25+
]]></token>
26+
<token name="@COMMON_ARGS@"><![CDATA[
27+
--processes \${GALAXY_SLOTS:-10}
28+
--verbose
29+
--log-file 'output/log'
30+
]]>
31+
</token>
32+
<xml name="common_input">
33+
<param argument="--input_images" type="data" format="tiff" multiple="true" label="MEROSCOPE tiff images"/>
34+
<param argument="--input_micron_to_mosaic" type="data" format="csv" label="Micron to mosaic mapping file"/>
35+
</xml>
36+
<xml name="normalization_param" token_label="Normalization">
37+
<param name="normalization" type="select" label="@LABEL@">
38+
<option value="default">default (min-max range normalization)</option>
39+
<option value="CLAHE">CLAHE (Contrast Limited Adaptive Histogram Equalization)</option>
40+
</param>
41+
</xml>
42+
<xml name="channel_options_basic">
43+
<yield/>
44+
<option value="Cellbound1">Cellbound1</option>
45+
<option value="Cellbound2">Cellbound2</option>
46+
<option value="Cellbound3">Cellbound3</option>
47+
</xml>
48+
<xml name="channel_options_none">
49+
<expand macro="channel_options_basic">
50+
<option value="None" selected="true">None</option>
51+
<option value="DAPI">DAPI</option>
52+
<option value="PolyT">PolyT</option>
53+
<yield/>
54+
</expand>
55+
</xml>
56+
<xml name="advanced_output">
57+
<section name="advanced_output" title="Advanced output options">
58+
<param name="log" type="boolean" truevalue="True" falsevalue="False" checked="true" label="Output log?"/>
59+
</section>
60+
</xml>
61+
<xml name="common_output">
62+
<data name="vpt_log" format="txt" from_work_dir="output/log" label="${tool.name} on ${on_string}: VPT log">
63+
<filter>advanced_output['log']</filter>
64+
</data>
65+
</xml>
66+
<xml name="sanitize_digits">
67+
<sanitizer invalid_char="">
68+
<valid initial="string.digits">
69+
<add value=","/>
70+
<add value="."/>
71+
</valid>
72+
</sanitizer>
73+
</xml>
74+
<xml name="citations">
75+
<citations>
76+
<citation type="bibtex">@Manual{github,
77+
title = {Vizgen Post-processing Tool},
78+
author = {Vizgen},
79+
organization = {Vizgen},
80+
year = {2022},
81+
url = {https://github.com/Vizgen/vizgen-postprocessing}}
82+
</citation>
83+
</citations>
84+
</xml>
85+
</macros>

tools/vpt/vpt_extract.xml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
<tool id="vpt_extract" name="Vizgen VPT - Extract" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@">
2+
<description>image patches</description>
3+
<macros>
4+
<import>macros.xml</import>
5+
</macros>
6+
<expand macro="requirements" />
7+
<expand macro="creator" />
8+
<command detect_errors="exit_code"><![CDATA[
9+
@CMD@
10+
vpt
11+
@COMMON_ARGS@
12+
extract-image-patch
13+
--input-images 'input/images/'
14+
--input-micron-to-mosaic 'input/micron_to_mosaic_pixel_transform.csv'
15+
--output-patch 'output/patch1.png'
16+
--center-x $center_x
17+
--center-y $center_y
18+
--size-x $size_x
19+
--size-y $size_y
20+
--input-z-index $input_z_index
21+
#if $red_stain_name != "None":
22+
--red-stain-name $red_stain_name
23+
#end if
24+
#if $green_stain_name != "None":
25+
--green-stain-name $green_stain_name
26+
#end if
27+
#if $blue_stain_name != "None":
28+
--blue-stain-name $blue_stain_name
29+
#end if
30+
--normalization $normalization
31+
]]></command>
32+
<inputs>
33+
<expand macro="common_input"/>
34+
<param argument="--center-x" type="integer" label="X coordinate in micron space"/>
35+
<param argument="--center-y" type="integer" label="Y coordinate in micron space"/>
36+
<param argument="--size-x" type="integer" min="1" value="108" label="Width of the patch in micron space"/>
37+
<param argument="--size-y" type="integer" min="1" value="108" label="Height of the patch in micron space"/>
38+
<param argument="--input_z_index" type="integer" min="0" value="2" label="The Z plane of the mosaic tiff images to use for the patch"/>
39+
<param argument="--red-stain-name" type="select" label="The stain that will be used for red channel of the patch">
40+
<expand macro="channel_options_none"/>
41+
</param>
42+
<param argument="--green-stain-name" type="select" label="The stain that will be used for green channel of the patch">
43+
<expand macro="channel_options_none"/>
44+
</param>
45+
<param argument="--blue-stain-name" type="select" label="The stain that will be used for blue channel of the patch">
46+
<expand macro="channel_options_none"/>
47+
</param>
48+
<expand macro="normalization_param" label="Normalization method that will be used on each channel of the patch"/>
49+
<expand macro="advanced_output"/>
50+
</inputs>
51+
<outputs>
52+
<data name="patch_image" format="png" from_work_dir="output/patch1.png" label="${tool.name} on ${on_string}: Patched image"/>
53+
<expand macro="common_output"/>
54+
</outputs>
55+
<tests>
56+
<test expect_num_outputs="2">
57+
<param name="input_images" location="https://zenodo.org/records/15319018/files/mosaic_Cellbound1_z0.tif,https://zenodo.org/records/15319018/files/mosaic_Cellbound1_z1.tif,https://zenodo.org/records/15319018/files/mosaic_Cellbound1_z2.tif,https://zenodo.org/records/15319018/files/mosaic_Cellbound1_z3.tif,https://zenodo.org/records/15319018/files/mosaic_Cellbound1_z4.tif,https://zenodo.org/records/15319018/files/mosaic_Cellbound1_z5.tif,https://zenodo.org/records/15319018/files/mosaic_Cellbound1_z6.tif,https://zenodo.org/records/15319018/files/mosaic_Cellbound2_z0.tif,https://zenodo.org/records/15319018/files/mosaic_Cellbound2_z1.tif,https://zenodo.org/records/15319018/files/mosaic_Cellbound2_z2.tif,https://zenodo.org/records/15319018/files/mosaic_Cellbound2_z3.tif,https://zenodo.org/records/15319018/files/mosaic_Cellbound2_z4.tif,https://zenodo.org/records/15319018/files/mosaic_Cellbound2_z5.tif,https://zenodo.org/records/15319018/files/mosaic_Cellbound2_z6.tif,https://zenodo.org/records/15319018/files/mosaic_Cellbound3_z0.tif,https://zenodo.org/records/15319018/files/mosaic_Cellbound3_z1.tif,https://zenodo.org/records/15319018/files/mosaic_Cellbound3_z2.tif,https://zenodo.org/records/15319018/files/mosaic_Cellbound3_z3.tif,https://zenodo.org/records/15319018/files/mosaic_Cellbound3_z4.tif,https://zenodo.org/records/15319018/files/mosaic_Cellbound3_z5.tif,https://zenodo.org/records/15319018/files/mosaic_Cellbound3_z6.tif,https://zenodo.org/records/15319018/files/mosaic_DAPI_z0.tif,https://zenodo.org/records/15319018/files/mosaic_DAPI_z1.tif,https://zenodo.org/records/15319018/files/mosaic_DAPI_z2.tif,https://zenodo.org/records/15319018/files/mosaic_DAPI_z3.tif,https://zenodo.org/records/15319018/files/mosaic_DAPI_z4.tif,https://zenodo.org/records/15319018/files/mosaic_DAPI_z5.tif,https://zenodo.org/records/15319018/files/mosaic_DAPI_z6.tif,https://zenodo.org/records/15319018/files/mosaic_PolyT_z0.tif,https://zenodo.org/records/15319018/files/mosaic_PolyT_z1.tif,https://zenodo.org/records/15319018/files/mosaic_PolyT_z2.tif,https://zenodo.org/records/15319018/files/mosaic_PolyT_z3.tif,https://zenodo.org/records/15319018/files/mosaic_PolyT_z4.tif,https://zenodo.org/records/15319018/files/mosaic_PolyT_z5.tif,https://zenodo.org/records/15319018/files/mosaic_PolyT_z6.tif"/>
58+
<param name="input_micron_to_mosaic" location="https://zenodo.org/records/15319018/files/micron_to_mosaic_pixel_transform.csv"/>
59+
<param name="center_x" value="200"/>
60+
<param name="center_y" value="200"/>
61+
<param name="size_x" value="208"/>
62+
<param name="size_y" value="208"/>
63+
<param name="input_z_index" value="2"/>
64+
<param name="red_stain_name" value="Cellbound1"/>
65+
<param name="green_stain_name" value="Cellbound3"/>
66+
<param name="blue_stain_name" value="DAPI"/>
67+
<param name="normalization" value="CLAHE"/>
68+
<section name="advanced_output">
69+
<param name="log" value="true"/>
70+
</section>
71+
<output name="patch_image" location="https://zenodo.org/records/15319018/files/patch1.png" ftype="png" compare="image_diff"/>
72+
<output name="vpt_log">
73+
<assert_contents>
74+
<has_text_matching expression="Extract image patch finished"/>
75+
</assert_contents>
76+
</output>
77+
</test>
78+
</tests>
79+
<help>
80+
The Vizgen Post-processing Tool (VPT) is a scalable and reproducible tool which enables users to reprocess and refine the single-cell results of MERSCOPE experiments.
81+
82+
The extract-image-patch tool extracts a patch from the mosaic image at the specified coordinates and size. The patch is saved as a PNG image. It can be used for manual segmentation or for training machine learning models.
83+
</help>
84+
<expand macro="citations" />
85+
</tool>

0 commit comments

Comments
 (0)