|
6 | 6 | <expand macro="requirements" /> |
7 | 7 | <command detect_errors="aggressive"> |
8 | 8 | <![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 | +
|
14 | 16 | ]]> |
15 | 17 | </command> |
16 | 18 | <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"/> |
19 | 20 | <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." /> |
20 | 21 | </inputs> |
21 | 22 | <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<designation>.*)\.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<designation>.*)\.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<designation>.*)\.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"> |
26 | 33 | <filter>ftplink_output</filter> |
27 | 34 | </data> |
28 | 35 | </outputs> |
29 | 36 | <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" /> |
33 | 39 | <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"> |
36 | 42 | <assert_contents><has_size value="14092624" /></assert_contents> |
37 | | - </discovered_dataset> |
38 | | - </output> |
| 43 | + </element> |
| 44 | + </output_collection> |
39 | 45 | </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" /> |
43 | 48 | <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> |
51 | 80 | </tests> |
52 | 81 | <help> |
53 | 82 | <![CDATA[ |
54 | 83 | **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. |
56 | 85 | ]]> |
57 | 86 | </help> |
58 | 87 | <expand macro="citations" /> |
|
0 commit comments