Skip to content

Commit 2723029

Browse files
authored
Merge pull request #1582 from pavanvidem/biaftp-update
Biaftp update supporting .png, .jpg images along with .tif. Now only the accession id is enough to get the data.
2 parents 585821b + 7fb18de commit 2723029

File tree

4 files changed

+67
-35
lines changed

4 files changed

+67
-35
lines changed

tools/image_processing/bia-ftplinks/.shed.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ owner: bgruening
33
categories:
44
- Imaging
55
description: Tool to query ftp links for study from bioimage archive
6+
long_description: |
7+
Tool to query ftp links for study from bioimage archive.
8+
homepage_url: https://www.ebi.ac.uk/biostudies/bioimages/studies
69
remote_repository_url: https://github.com/bgruening/galaxytools/tree/master/tools
710
type: unrestricted
811
auto_tool_repositories:

tools/image_processing/bia-ftplinks/biaftplink.xml

Lines changed: 58 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -6,53 +6,82 @@
66
<expand macro="requirements" />
77
<command detect_errors="aggressive">
88
<![CDATA[
9-
wget -r 'ftp://ftp.ebi.ac.uk/biostudies/$mode/$path'/Files;
10-
#if '$ftp_output'
11-
#set study = $path.split('/')[-1].rstrip('/')
12-
curl https://www.ebi.ac.uk/biostudies/api/v1/studies/$study/info -s |jq -r .ftpLink >>ftpLink.txt
13-
#end if
9+
curl -s https://www.ebi.ac.uk/biostudies/api/v1/studies/$accession/info | jq -r .ftpLink >> ftpLink.txt &&
10+
wget -q -r -l 0 -A "*.tif,*.png,*.jpg,*.zip" -i ftpLink.txt &&
11+
12+
find . -type f -name "*.zip" | while read zip_file; do
13+
unzip -o "\$zip_file" -d "\$(dirname "\$zip_file")";
14+
done
15+
1416
]]>
1517
</command>
1618
<inputs>
17-
<param name="mode" type="text" label="Storage mode" help="The storage mode, can be either nfs or fire."/>
18-
<param name="path" type="text" label="The path of accession. e.g. S-BIAD/570/S-BIAD570 "/>
19+
<param name="accession" type="text" label="The accession ID of BioImages-Core or BioStudies-JCB" help="for eg. S-BIAD570, S-JCBD-201309038"/>
1920
<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." />
2021
</inputs>
2122
<outputs>
22-
<data name="images" format="tiff">
23-
<discover_datasets pattern="__name_and_ext__" format="tif,tiff" directory="ftp.ebi.ac.uk" visible="true" recurse="true" />
24-
</data>
25-
<data format="txt" name="ftplinks" from_work_dir="ftpLink.txt" label="FTP Links">
23+
<collection name="tif_images" type="list" label="${tool.name} on ${on_string}: TIF Images">
24+
<discover_datasets pattern="(?P&lt;designation&gt;.*)\.tif" format="tif" directory="ftp.ebi.ac.uk" recurse="true" />
25+
</collection>
26+
<collection name="png_images" type="list" label="${tool.name} on ${on_string}: PNG Images">
27+
<discover_datasets pattern="(?P&lt;designation&gt;.*)\.png" format="png" directory="ftp.ebi.ac.uk" recurse="true" />
28+
</collection>
29+
<collection name="jpg_images" type="list" label="${tool.name} on ${on_string}: JPG Images">
30+
<discover_datasets pattern="(?P&lt;designation&gt;.*)\.jpg" format="jpg" directory="ftp.ebi.ac.uk" recurse="true" />
31+
</collection>
32+
<data format="txt" name="ftplinks" from_work_dir="ftpLink.txt" label="${tool.name} on ${on_string}: FTP Links">
2633
<filter>ftplink_output</filter>
2734
</data>
2835
</outputs>
2936
<tests>
30-
<test expect_num_outputs='1'>
31-
<param name="mode" value="fire" />
32-
<param name="path" value="S-BIAD/961/S-BIAD961" />
37+
<test expect_num_outputs='3'>
38+
<param name="accession" value="S-BIAD961" />
3339
<param name="ftplink_output" value="False" />
34-
<output name="images">
35-
<discovered_dataset designation="Study_Component-4_mznanog_mCherry-AAT" ftype="tif">
40+
<output_collection name="tif_images" type="list" count="1">
41+
<element name="Study_Component-4_mznanog_mCherry-AAT">
3642
<assert_contents><has_size value="14092624" /></assert_contents>
37-
</discovered_dataset>
38-
</output>
43+
</element>
44+
</output_collection>
3945
</test>
40-
<test expect_num_outputs='2'>
41-
<param name="mode" value="fire" />
42-
<param name="path" value="S-BIAD/961/S-BIAD961" />
46+
<test expect_num_outputs='4'>
47+
<param name="accession" value="S-JCBD-201309038" />
4348
<param name="ftplink_output" value="True" />
44-
<output name="images">
45-
<discovered_dataset designation="Study_Component-4_mznanog_mCherry-AAT" ftype="tif">
46-
<assert_contents><has_size value="14092624" /></assert_contents>
47-
</discovered_dataset>
48-
</output>
49-
<output name="ftplinks" ftype="txt" file="ftpLink.txt" lines_diff="0" />
50-
</test>
49+
<output_collection name="tif_images" type="list" count="2">
50+
<element name="JCB_STIL_serial">
51+
<assert_contents><has_size value="7446240" /></assert_contents>
52+
</element>
53+
<element name="Sir_JCB_STIL_serial">
54+
<assert_contents><has_size value="7436060" /></assert_contents>
55+
</element>
56+
</output_collection>
57+
<output name="ftplinks" ftype="txt" file="ftpLink.txt" lines_diff="0" />
58+
</test>
59+
<test expect_num_outputs='3'>
60+
<param name="accession" value="S-BSST564" />
61+
<param name="ftplink_output" value="False" />
62+
<output_collection name="jpg_images" type="list" count="4">
63+
<element name="580-16_P0-2">
64+
<assert_contents><has_size value="1026747" /></assert_contents>
65+
</element>
66+
</output_collection>
67+
</test>
68+
<test expect_num_outputs='3'>
69+
<param name="accession" value="S-BSST221" />
70+
<param name="ftplink_output" value="False" />
71+
<output_collection name="png_images" type="list" count="81">
72+
<element name="d1 normalized_CXCL13">
73+
<assert_contents><has_size value="1583299" /></assert_contents>
74+
</element>
75+
<element name="normalized_KI67">
76+
<assert_contents><has_size value="1722406" /></assert_contents>
77+
</element>
78+
</output_collection>
79+
</test>
5180
</tests>
5281
<help>
5382
<![CDATA[
5483
**What it does**
55-
This tool downloads images from the Bioimage Archive and optionally outputs FTP links associated with the input accession.
84+
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.
5685
]]>
5786
</help>
5887
<expand macro="citations" />

tools/image_processing/bia-ftplinks/macros.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
<macros>
2-
<token name="@VERSION@">0.1.0</token>
2+
<token name="@VERSION@">0.2.0</token>
33
<xml name="requirements">
44
<requirements>
5-
<requirement type="package" version="1.20.3">wget</requirement>
6-
<requirement type="package" version="8.4.0">curl</requirement>
7-
<requirement type="package" version="1.6">jq</requirement>
5+
<requirement type="package" version="1.21.4">wget</requirement>
6+
<requirement type="package" version="8.12.1">curl</requirement>
7+
<requirement type="package" version="1.7.1">jq</requirement>
88
<yield />
99
</requirements>
1010
</xml>
1111
<xml name="citations">
1212
<citations>
1313
<citation type="bibtex">
1414
@misc{bia,,
15-
title = "BioImage Archive Downloading via ftp",
15+
title = "BioImage Archive Downloading via ftp",
1616
note = "https://www.ebi.ac.uk/bioimage-archive/help-download/",
1717
url = "https://www.ebi.ac.uk/bioimage-archive/help-download/"}</citation>
1818
</citations>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
ftp://ftp.ebi.ac.uk/biostudies/fire/S-BIAD/961/S-BIAD961
1+
ftp://ftp.ebi.ac.uk/biostudies/fire/S-JCBD-/S-JCBD-xxx038/S-JCBD-201309038

0 commit comments

Comments
 (0)