comparison pyega3.xml @ 0:caf213d51d6c draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/pyega3 commit 3da28c7772346e1872b6d768b904305be0c61db7"
author iuc
date Fri, 30 Oct 2020 22:18:41 +0000
parents
children 1162bfd9f782
comparison
equal deleted inserted replaced
-1:000000000000 0:caf213d51d6c
1 <tool id="pyega3" name="EGA Download Client" version="@VERSION@+galaxy0" profile="19.09" >
2 <macros>
3 <token name="@VERSION@">3.4.0</token>
4 </macros>
5 <requirements>
6 <requirement type="package" version="@VERSION@">pyega3</requirement>
7 </requirements>
8 <command detect_errors="exit_code"><![CDATA[
9 #set $username = $__user__.extra_preferences.get('ega_account|username', "")
10 #if $username == "":
11 #set $username = "ega-test-data@ebi.ac.uk (default user)"
12 #end if
13 echo "Running as user: $username. Set your credentials via: User -> Preferences -> Manage Information" &&
14
15 #if $action.action_type == "list_datasets"
16 pyega3 -cf '$credentials'
17 datasets
18 #elif $action.action_type == "list_dataset_files"
19 pyega3 -cf '$credentials'
20 files '$action.dataset_id'
21 #elif $action.action_type == "download_file"
22 pyega3 -cf '$credentials'
23 fetch '$action.file_id'
24 #if $action.range.reference_name
25 --reference-name '$action.range.reference_name'
26 #if $action.range.start
27 --start $action.range.start
28 #end if
29 #if $action.range.end
30 --end $action.range.end
31 #end if
32 #end if
33 --saveto '$downloaded_file'
34 #end if
35 ]]></command>
36 <configfiles>
37 <configfile name="credentials"><![CDATA[
38 #set $password = $__user__.extra_preferences.get('ega_account|password', "")
39 #set $username = $__user__.extra_preferences.get('ega_account|username', "")
40 #if $username == "" or $password == "":
41 #set $username = "ega-test-data@ebi.ac.uk"
42 #set $password = "egarocks"
43 #end if
44 {
45 "username": "$username",
46 "password": "$password"
47 }
48 ]]></configfile>
49 </configfiles>
50 <inputs>
51 <conditional name="action">
52 <param name="action_type" type="select" label="What would you like to do?">
53 <option value="list_datasets"> List my authorized datasets </option>
54 <option value="list_dataset_files"> List files in a datasets </option>
55 <option value="download_file"> Download a file </option>
56 </param>
57 <when value="list_dataset_files">
58 <param name="dataset_id" type="text" optional="false" label="EGA Dataset Accession ID" help="Identifier starting with 'EGAD'. For example: EGAD00001003338">
59 <validator type="regex" message="EGA dataset ID must be a string of numbers prefixed by 'EGAD'">EGAD[0-9]+</validator>
60 </param>
61 </when>
62 <when value="list_datasets"/>
63 <when value="download_file">
64 <param name="file_id" type="text" optional="false" label="EGA File Accession Identifier" help="Identifier starting with 'EGAF'. For example: EGAF00001753735">
65 <validator type="regex" message="EGA Accession ID must be a string of numbers prefixed by 'EGAD' (datasets) or 'EGAF' (files)">EGAF[0-9]+</validator>
66 </param>
67 <section name="range" title="Request a specific Genomic range?" expanded="false">
68 <param argument="--reference-name" type="text" optional="true" label="Reference Sequence Name" help="For example 'chr1', '1', or 'chrX'. If unspecified, all data is returned." />
69 <param argument="--start" type="integer" optional="true" min="0" label="Start Position" help="0-based, inclusive. Only used if a reference sequence name was specified"/>
70 <param argument="--end" type="integer" optional="true" min="0" label="End Position" help="0-based, exclusive. Only used if a reference sequence name was specified"/>
71 </section>
72 </when>
73 </conditional>
74 </inputs>
75 <outputs>
76 <data name="authorized_datasets" format="txt" from_work_dir="pyega3_output.log" label="${tool.name}: authorized datasets">
77 <filter> action['action_type'] == 'list_datasets' </filter>
78 </data>
79 <data name="dataset_file_list" format="txt" from_work_dir="pyega3_output.log" label="${tool.name}: dataset file list">
80 <filter> action['action_type'] == 'list_dataset_files' </filter>
81 </data>
82 <data name="downloaded_file" auto_format="true" label="${tool.name}: ${action.file_id} ${action.range.reference_name} ${action.range.start} ${action.range.end}">
83 <filter> action['action_type'] == 'download_file' </filter>
84 </data>
85 </outputs>
86 <tests>
87 <test expect_num_outputs="1"><!-- list datasets with default credentials -->
88 <param name="action_type" value="list_datasets"/>
89 <output name="authorized_datasets" ftype="txt">
90 <assert_contents>
91 <has_text text="pyEGA3 - EGA python client version @VERSION@"/>
92 <has_text text="EGAD00001003338"/>
93 </assert_contents>
94 </output>
95 </test>
96 <test expect_num_outputs="1"><!-- list dataset files with default credentials -->
97 <param name="action_type" value="list_dataset_files"/>
98 <param name="dataset_id" value="EGAD00001003338"/>
99 <output name="dataset_file_list" ftype="txt">
100 <assert_contents>
101 <has_text text="pyEGA3 - EGA python client version @VERSION@"/>
102 <has_line_matching expression="^\[.*\]\s+File ID\s+Status\s+Bytes\s+Check sum\s+File name$"/>
103 <has_text text="EGAF00001753734"/>
104 </assert_contents>
105 </output>
106 </test>
107 <test expect_num_outputs="1"> <!-- download a single file -->
108 <param name="action_type" value="download_file"/>
109 <param name="file_id" value="EGAF00001775036"/>
110 <output name="downloaded_file" md5="3b89b96387db5199fef6ba613f70e27c"/>
111 </test>
112 <test expect_num_outputs="1"> <!-- download a single file, with genomic range specified -->
113 <param name="action_type" value="download_file"/>
114 <param name="file_id" value="EGAF00001753756"/>
115 <param name="reference_name" value="1"/>
116 <param name="start" value="100"/>
117 <param name="end" value="10000"/>
118 <output name="downloaded_file" ftype="bam" md5="e576a38748feec45aa45191f6e902ce2"/>
119 </test>
120 </tests>
121 <help><![CDATA[
122 The pyEGA3 download client is a python-based tool for viewing and downloading files from authorized EGA datasets.
123
124 If you have an EGA account, you can set your EGA credentials in the user preferences menu of Galaxy. Otherwise, default EGA credentials with access to an example dataset will be used.
125
126 pyEGA3 uses the EGA Data API and has several key features:
127
128 - Files are transferred over secure https connections and received unencrypted, so no need for decryption after download.
129 - Downloads resume from where they left off in the event that the connection is interrupted.
130 - pyEGA3 supports file segmenting and parallelized download of segments, improving overall performance.
131 - After download completes, file integrity is verified using checksums.
132 - pyEGA3 implements the GA4GH-compliant htsget protocol for download of genomic ranges for data files with accompanying index files.
133
134 ]]></help>
135 <citations>
136 <citation type="doi">10.1038/ng.3312</citation>
137 </citations>
138 </tool>