Mercurial > repos > bgruening > bia_download
changeset 0:ff80c1b5816b draft default tip
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 2723029a5b134c68a21432cc8256ee1e5e111a00
author | bgruening |
---|---|
date | Fri, 07 Mar 2025 14:25:06 +0000 |
parents | |
children | |
files | biaftplink.xml macros.xml test-data/ftpLink.txt |
diffstat | 3 files changed, 110 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/biaftplink.xml Fri Mar 07 14:25:06 2025 +0000 @@ -0,0 +1,88 @@ +<tool id="bia_download" name="FTP Link for Bioimage Archive" version="@VERSION@+galaxy0" profile="22.05"> + <description>Download images from Bioimage Archive</description> + <macros> + <import>macros.xml</import> + </macros> + <expand macro="requirements" /> + <command detect_errors="aggressive"> +<![CDATA[ + curl -s https://www.ebi.ac.uk/biostudies/api/v1/studies/$accession/info | jq -r .ftpLink >> ftpLink.txt && + wget -q -r -l 0 -A "*.tif,*.png,*.jpg,*.zip" -i ftpLink.txt && + + find . -type f -name "*.zip" | while read zip_file; do + unzip -o "\$zip_file" -d "\$(dirname "\$zip_file")"; + done + +]]> + </command> + <inputs> + <param name="accession" type="text" label="The accession ID of BioImages-Core or BioStudies-JCB" help="for eg. S-BIAD570, S-JCBD-201309038"/> + <param name="ftplink_output" type="boolean" label="Generate FTP links?" help="If set, a file containing FTP links associated with the accession will be generated." /> + </inputs> + <outputs> + <collection name="tif_images" type="list" label="${tool.name} on ${on_string}: TIF Images"> + <discover_datasets pattern="(?P<designation>.*)\.tif" format="tif" directory="ftp.ebi.ac.uk" recurse="true" /> + </collection> + <collection name="png_images" type="list" label="${tool.name} on ${on_string}: PNG Images"> + <discover_datasets pattern="(?P<designation>.*)\.png" format="png" directory="ftp.ebi.ac.uk" recurse="true" /> + </collection> + <collection name="jpg_images" type="list" label="${tool.name} on ${on_string}: JPG Images"> + <discover_datasets pattern="(?P<designation>.*)\.jpg" format="jpg" directory="ftp.ebi.ac.uk" recurse="true" /> + </collection> + <data format="txt" name="ftplinks" from_work_dir="ftpLink.txt" label="${tool.name} on ${on_string}: FTP Links"> + <filter>ftplink_output</filter> + </data> + </outputs> + <tests> + <test expect_num_outputs='3'> + <param name="accession" value="S-BIAD961" /> + <param name="ftplink_output" value="False" /> + <output_collection name="tif_images" type="list" count="1"> + <element name="Study_Component-4_mznanog_mCherry-AAT"> + <assert_contents><has_size value="14092624" /></assert_contents> + </element> + </output_collection> + </test> + <test expect_num_outputs='4'> + <param name="accession" value="S-JCBD-201309038" /> + <param name="ftplink_output" value="True" /> + <output_collection name="tif_images" type="list" count="2"> + <element name="JCB_STIL_serial"> + <assert_contents><has_size value="7446240" /></assert_contents> + </element> + <element name="Sir_JCB_STIL_serial"> + <assert_contents><has_size value="7436060" /></assert_contents> + </element> + </output_collection> + <output name="ftplinks" ftype="txt" file="ftpLink.txt" lines_diff="0" /> + </test> + <test expect_num_outputs='3'> + <param name="accession" value="S-BSST564" /> + <param name="ftplink_output" value="False" /> + <output_collection name="jpg_images" type="list" count="4"> + <element name="580-16_P0-2"> + <assert_contents><has_size value="1026747" /></assert_contents> + </element> + </output_collection> + </test> + <test expect_num_outputs='3'> + <param name="accession" value="S-BSST221" /> + <param name="ftplink_output" value="False" /> + <output_collection name="png_images" type="list" count="81"> + <element name="d1 normalized_CXCL13"> + <assert_contents><has_size value="1583299" /></assert_contents> + </element> + <element name="normalized_KI67"> + <assert_contents><has_size value="1722406" /></assert_contents> + </element> + </output_collection> + </test> + </tests> + <help> +<![CDATA[ + **What it does** + This tool downloads images from the Bioimage Archive and optionally outputs FTP links associated with the input accession. The tools currently supports downloading TIF, PNG and JPG formats that are supported by Galaxy. +]]> + </help> + <expand macro="citations" /> +</tool>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/macros.xml Fri Mar 07 14:25:06 2025 +0000 @@ -0,0 +1,21 @@ +<macros> + <token name="@VERSION@">0.2.0</token> + <xml name="requirements"> + <requirements> + <requirement type="package" version="1.21.4">wget</requirement> + <requirement type="package" version="8.12.1">curl</requirement> + <requirement type="package" version="1.7.1">jq</requirement> + <yield /> + </requirements> + </xml> + <xml name="citations"> + <citations> + <citation type="bibtex"> + @misc{bia,, + title = "BioImage Archive Downloading via ftp", + note = "https://www.ebi.ac.uk/bioimage-archive/help-download/", + url = "https://www.ebi.ac.uk/bioimage-archive/help-download/"}</citation> + </citations> + </xml> +</macros> +