Mercurial > repos > goeckslab > gate_finder
comparison main_macros.xml @ 0:6df8d6e42152 draft
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/vitessce commit 9b2dc921e692af8045773013d9f87d4d790e2ea1
author | goeckslab |
---|---|
date | Thu, 08 Sep 2022 17:22:53 +0000 |
parents | |
children | 8097f9124f87 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:6df8d6e42152 |
---|---|
1 <macros> | |
2 <token name="@TOOL_VERSION@">1.0.4</token> | |
3 <token name="@VERSION_SUFFIX@">0</token> | |
4 <token name="@PROFILE@">20.01</token> | |
5 | |
6 <xml name="vitessce_requirements"> | |
7 <requirements> | |
8 <container type="docker">quay.io/goeckslab/vitessce:@TOOL_VERSION@</container> | |
9 </requirements> | |
10 </xml> | |
11 | |
12 <xml name="macro_stdio"> | |
13 <stdio> | |
14 <exit_code range="1:" level="fatal" description="Error occurred. Please check Tool Standard Error" /> | |
15 </stdio> | |
16 </xml> | |
17 | |
18 <xml name="vitessce_cmd" token_tool_id="vitessce_spatial"> | |
19 <command> | |
20 <![CDATA[ | |
21 export BF_MAX_MEM="\${GALAXY_MEMORY_MB}m" && | |
22 mkdir -p '${output.files_path}/A/0' && | |
23 ln -sf '$image' '${output.files_path}/A/0/image01.ome.tiff' && | |
24 #if $masks | |
25 info=\$(showinf -nopix -nometa -noflat '${output.files_path}/A/0/image01.ome.tiff') && | |
26 echo '>showinf -nopix -nometa -noflat \$image' && | |
27 echo "\$info\n" && | |
28 masks_info=\$(showinf -nopix -nometa -noflat '$masks') && | |
29 echo '>showinf -nopix -nometa -noflat \$masks' && | |
30 echo "\$masks_info\n" && | |
31 masks_n_resolutions=\$(echo "\$masks_info" | grep '^\s*Resolutions\s*=' -m1 | cut -d'=' -f2 | xargs) && | |
32 if [ -z \$masks_n_resolutions ]; then | |
33 n_resolutions=\$(echo "\$info" | grep '^\s*Resolutions\s*=' -m1 | cut -d'=' -f2 | xargs) && | |
34 pyramid_scale=1 && | |
35 if [ -z "\$n_resolutions" ]; then | |
36 echo "Warning: Failded to retrieve the number of pyramid resolutions. Set pyramid resolutions to 4 and scale to 2!"; | |
37 n_resolutions=4; | |
38 pyramid_scale=2; | |
39 else | |
40 echo "Found the number of pyramid resolutions: \$n_resolutions"; | |
41 if [ "\$n_resolutions" -gt 1 ]; then | |
42 sizeX0=\$(echo "\$info" | grep '^\s*sizeX\[0\]\s*=' -m1 | cut -d'=' -f2 | xargs) ; | |
43 sizeX1=\$(echo "\$info" | grep '^\s*sizeX\[1\]\s*=' -m1 | cut -d'=' -f2 | xargs) ; | |
44 if [ "\$sizeX0" -gt 0 ] && [ "\$sizeX1" -gt 0 ]; then | |
45 pyramid_scale=\$(((\$sizeX0 + \$sizeX1 / 2 ) / \$sizeX1)); | |
46 echo "Calculate pyramid scale: \$sizeX0 / \$sizeX1 ~= \$pyramid_scale."; | |
47 else | |
48 pyramid_scale=2; | |
49 echo "Warning: Failed to calculate the pyramid scale; set it to 2!"; | |
50 fi; | |
51 fi; | |
52 fi; | |
53 tile_info=\$(showinf -nopix -nometa -noflat '${output.files_path}/A/0/image01.ome.tiff' | grep '^\s*Tile\ssize\s*=' -m1); | |
54 tile_x=\$(echo "\$tile_info" | cut -d' ' -f4); | |
55 tile_y=\$(echo "\$tile_info" | cut -d' ' -f6); | |
56 convert_cmd="bfconvert -pyramid-resolutions \$n_resolutions -pyramid-scale \$pyramid_scale -noflat -tilex \$tile_x -tiley \$tile_y '$masks' '${output.files_path}/A/0/masks01.ome.tiff'"; | |
57 echo "\n>\$convert_cmd"; | |
58 eval \$convert_cmd; | |
59 masks_info_new=\$(showinf -nopix -nometa -noflat '${output.files_path}/A/0/masks01.ome.tiff'); | |
60 echo "\n>showinf -nopix -nometa -noflat '${output.files_path}/A/0/masks01.ome.tiff'"; | |
61 echo "\$masks_info_new\n"; | |
62 else | |
63 ln -sf '$masks' '${output.files_path}/A/0/masks01.ome.tiff'; | |
64 fi && | |
65 #end if | |
66 python '$__tool_directory__/@TOOL_ID@.py' | |
67 --inputs '$inputs' | |
68 --output '${output.files_path}' | |
69 --image '${output.files_path}/A/0/image01.ome.tiff' | |
70 #if $masks | |
71 --masks '${output.files_path}/A/0/masks01.ome.tiff' | |
72 #end if | |
73 #if $do_phenotyping.phenotyping_choice | |
74 --anndata '$anndata' | |
75 #end if | |
76 && | |
77 cp -R '$__tool_directory__/static' '${output.files_path}' && | |
78 cp '$__tool_directory__/index.html' '$output'; | |
79 | |
80 ]]> | |
81 </command> | |
82 </xml> | |
83 | |
84 </macros> |