-
Notifications
You must be signed in to change notification settings - Fork 263
add WebAtlas pipeline 0.5.3 #1794
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 30 commits
13a2601
8233bb9
b71249c
35c66af
108d647
fd3266c
0cd5c0e
aa1e49c
901a369
1540d6d
34b1925
bc2d3fe
c3f2812
27fa161
a134f3e
2498267
7e1bc4a
40b4e92
6796c5a
e6558fa
abb8456
3ed298f
6cdd180
27aabb8
fd21dba
bab3e74
8a22392
dd1191c
f4fad45
1b962c7
5f5d7f2
e514d8e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| name: webatlas | ||
| owner: iuc | ||
| description: The Galaxy WebAtlas tools to process spatial and single-cell experiment data for visualisation in a web browser using Vitessce. | ||
| homepage_url: https://github.com/haniffalab/webatlas-pipeline | ||
| long_description: The Galaxy WebAtlas tools provide a framework for processing spatial and single-cell experiment data, enabling visualisation with Vitessce. | ||
| remote_repository_url: https://github.com/bgruening/galaxytools/tree/master/tools/webatlas | ||
| categories: | ||
| - Spatial Omics | ||
| - Single Cell | ||
| auto_tool_repositories: | ||
| name_template: "{{ tool_id }}" | ||
| description_template: "Wrapper for {{ tool_name }}." | ||
| suite: | ||
| name: "suite_webatlas" | ||
| description: "A suite of Galaxy tools to process single-cell and spatial experiment data for visualisation using Vitessce." | ||
| type: repository_suite_definition |
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,98 @@ | ||
| <tool id="webatlas_consolidate_md" name="WebAtlas Consolidate Metadata" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" python_template_version="3.5" profile="@PROFILE_VERSION@"> | ||
| <description>Converts an image to Zarr and consolidates metadata</description> | ||
| <macros> | ||
| <import>macros.xml</import> | ||
| </macros> | ||
| <expand macro="requirements"/> | ||
| <command detect_errors="exit_code"><![CDATA[ | ||
| if tiffinfo $input_image | grep "Compression Scheme:" | grep -wq "JPEG"; | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. single quotes
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is this doing? Can we not make decisions based on Galaxy metadata of those datasets?
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. checks if it is a JPEG compressed TIFF image. I don't think this information is stored in the metadata. |
||
| then | ||
| if od -h -j2 -N2 $input_image | head -n1 | sed 's/[0-9]* *//' | grep -q -E '002b|2b00'; | ||
| then | ||
| tiffcp -c none -m 0 -8 $input_image uncompressed.tiff; | ||
| else | ||
| tiffcp -c none -m 0 $input_image uncompressed.tiff || tiffcp -c none -m 0 -8 $input_image uncompressed.tiff; | ||
| fi; | ||
| bioformats2raw --no-hcs uncompressed.tiff $stem-'$image_type'.zarr; | ||
| else | ||
| bioformats2raw --no-hcs $input_image $stem-'$image_type'.zarr; | ||
| fi; | ||
| consolidate_md.py --file_in $stem-'$image_type'.zarr && | ||
| mkdir -p '$output_zarr.extra_files_path' && | ||
| mv $stem-'$image_type'.zarr $output_zarr.extra_files_path | ||
| ]]></command> | ||
| <inputs> | ||
| <param name="input_image" type="data" format="tif,tiff,jpg" label="TIFF or JPEG image" help="Input image to convert to Zarr. JPEG-compressed TIFF images are automatically decompressed before conversion."/> | ||
| <expand macro="stem"/> | ||
| <param name="image_type" type="select" label="Input image type" help="Choose the type of input image."> | ||
| <option value="label">label</option> | ||
| <option value="raw">raw</option> | ||
| </param> | ||
| </inputs> | ||
| <outputs> | ||
| <data name="output_zarr" format="zarr" label="${tool.name} on ${on_string}: Zarr output"/> | ||
| </outputs> | ||
| <tests> | ||
| <test expect_num_outputs="1"> | ||
| <param name="input_image" location="https://zenodo.org/records/20029977/files/visium-breast-cancer-label.tif"/> | ||
| <param name="stem" value="visium-breast-cancer"/> | ||
| <param name="image_type" value="label"/> | ||
| <output name="output_zarr"> | ||
| <extra_files type="file" name="visium-breast-cancer-label.zarr/OME/METADATA.ome.xml"> | ||
| <assert_contents> | ||
| <has_text text="<Description>{"shape": [21571, 19505]}</Description><Pixels BigEndian="true" DimensionOrder="XYZCT""/> | ||
| </assert_contents> | ||
| </extra_files> | ||
| </output> | ||
| </test> | ||
| <test expect_num_outputs="1"> | ||
| <param name="input_image" location="https://zenodo.org/records/20029977/files/tissue_image.tif"/> | ||
| <param name="stem" value="visium-breast-cancer"/> | ||
| <param name="image_type" value="raw"/> | ||
| <output name="output_zarr"> | ||
| <extra_files type="file" name="visium-breast-cancer-raw.zarr/OME/METADATA.ome.xml"> | ||
| <assert_contents> | ||
| <has_text_matching expression="Pixels BigEndian="true" DimensionOrder="XYZCT" ID="Pixels:0" Interleaved="false" PhysicalSizeX="0.5475[0-9]+" PhysicalSizeXUnit="µm" PhysicalSizeY="0.5476[0-9]+" PhysicalSizeYUnit="µm" SignificantBits="8" SizeC="3" SizeT="1" SizeX="19505" SizeY="21571" SizeZ="1" Type="uint8""/> | ||
| </assert_contents> | ||
| </extra_files> | ||
| </output> | ||
| </test> | ||
| </tests> | ||
| <help><![CDATA[ | ||
| This tool converts image data into the Zarr format and consolidates its metadata to improve performance in downstream visualization. | ||
|
|
||
| It typically processes label images generated by **WebAtlas Generate Image** and raw images provided as input or generated within the WebAtlas workflow. | ||
|
|
||
| ---- | ||
|
|
||
| **Supported Input Types** | ||
|
|
||
| - **TIFF image** (including JPEG-compressed TIFF) | ||
| - **JPEG image** | ||
|
|
||
| ---- | ||
|
|
||
| **Processing Steps** | ||
|
|
||
| - (If applicable) Decompression of JPEG-compressed TIFF images prior to conversion | ||
| - Conversion of the input image to Zarr format using *bioformats2raw* | ||
| - Consolidation of Zarr metadata | ||
|
|
||
| ---- | ||
|
|
||
| **Metadata Consolidation** | ||
|
|
||
| Zarr datasets normally store metadata in many small files. This tool consolidates them into a single metadata file. | ||
|
|
||
| This can significantly reduce the time necessary to load the metadata in downstream visualization. | ||
|
|
||
| ---- | ||
|
|
||
| **Output** | ||
|
|
||
| - **Zarr dataset (image with consolidated metadata)** | ||
|
|
||
| The output is used as input for the downstream WebAtlas tools **WebAtlas OME Zarr Metadata**, **WebAtlas Build Vitessce Config**, and **WebAtlas Write**. | ||
| ]]></help> | ||
| <expand macro="citations"/> | ||
| </tool> | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this tool be included in the build_config.xml as a background python script?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consolidate_md is the tool with one of the longest runtimes out of all WebAtlas tools. Users might want to rerun only build_config to adjust Vitessce options, so I doubt including a long runtime tool would be convenient