Mercurial > repos > yhoogstrate > ega_download_streamer
diff ega_download_streamer.xml @ 0:0add1e8d751a draft
planemo upload for repository https://github.com/ErasmusMC-Bioinformatics/ega_client_galaxy_wrapper commit 72bbd9452fb48044cfafb0074b49a67a8530ff9c-dirty
author | yhoogstrate |
---|---|
date | Tue, 29 Mar 2016 03:54:13 -0400 |
parents | |
children | 5bfcb2bffd03 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ega_download_streamer.xml Tue Mar 29 03:54:13 2016 -0400 @@ -0,0 +1,92 @@ +<tool id="ega_download_streamer" name="EGA Download streamer" version="2.1.6.g0"> + <description>data from the European Genome-phenome Archive in a secure manner</description> + <requirements> + <requirement type="package" version="2.1.6">EGA_download_streamer</requirement> + </requirements> + <stdio> + <!-- Anything other than zero is an error --> + <regex match="Login failed" source="both" level="fatal"/> + <exit_code range="1:" /> + <exit_code range=":-1" /> + </stdio> + <version_command>java -jar $EGA_DOWNLOAD_STREAMER_ROOT_DIR/jars/EgaDemoClient.jar -version | grep -i Version | grep -v -i new</version_command> + <command><![CDATA[ + #import random + #import string + + #set $encryption_key = ''.join(random.SystemRandom().choice(string.ascii_uppercase + string.ascii_lowercase + string.digits) for _ in range(2048)) + #set $random_request_uid = 'request_'+str($ega_file_identifier)+'_'+''.join(random.SystemRandom().choice(string.ascii_uppercase + string.ascii_lowercase + string.digits) for _ in range(64)) + + echo \$user > credentials.txt && + echo \$pass >> credentials.txt && + + echo "Creating an encryption request at server" && + java -jar + "\$EGA_DOWNLOAD_STREAMER_ROOT_DIR/jars/EgaDemoClient.jar" + -pf "credentials.txt" + -rf "$ega_file_identifier" + -re "$encryption_key" + -label "${random_request_uid}" | grep -v "Login failed" && + + echo "\n\n\nDownloading request" && + java -jar + "\$EGA_DOWNLOAD_STREAMER_ROOT_DIR/jars/EgaDemoClient.jar" + -pf "credentials.txt" + -dr "${random_request_uid}" + -nt 7 > download.log && + + cat download.log && + + ## Commands below may fail if authentication was not a success + ENCRYPTED_FILES_NAME=\$(grep -oE "Completed Download Target:[ ]+(.*?)\.cip" download.log | sed -r "s/^Completed Download Target:[ ]+//" ) && + DECRYPTED_FILES_NAME=\${ENCRYPTED_FILES_NAME%.cip} && + + echo "\n\n\n Decrpyting \$ENCRYPTED_FILES_NAME to \$DECRYPTED_FILES_NAME" && + java -jar + "\$EGA_DOWNLOAD_STREAMER_ROOT_DIR/jars/EgaDemoClient.jar" + -pf credentials.txt + -dc "\$ENCRYPTED_FILES_NAME" + -dck "$encryption_key" && + + if file --mime-type "\$DECRYPTED_FILES_NAME" | grep -q /gzip$; then + echo "Unpacking as well" && + gunzip -cf "\$DECRYPTED_FILES_NAME" > "$output" ; + else + mv "\$DECRYPTED_FILES_NAME" "$output" ; + fi ; + + echo "Cleaning up credentials" && + echo "overwriten" > "credentials.txt" && + rm "credentials.txt" + ]]></command> + <inputs> + <param name="ega_file_identifier" type="text" value="" label="Identifier of the file in EGA" /> + </inputs> + <outputs> + <data name="output" auto_format="true" label="${tool.name} on ${ega_file_identifier}" /> + </outputs> + <tests> + <test> + <param name="ega_file_identifier" value="EGAF00001059069" /> + + <output name="output" file="EGAF00001059069.fastq" /> + </test> + </tests> + + <help> +**What it does** + +Individual files or whole datasets may be downloaded from European Genome-phenome Archive (EGA) in a secure manner by first placing a download request and then downloading the file/s associated with the request. All files are automatically encrypted prior to streaming and must be decrypted using the streamer after download is complete. + +To download a given dataset, the user should provide the corresponding EGA file identifier (e.g. EGAF00001059069). + +**Configuration** + +The admin has to configure the server such that the environment variables $user and $pass are exported and reflect the credentials of the EGA account. The user and password shall not be visible to users. This can also be done in the config/jobs_conf.xml file. + +https://www.ebi.ac.uk/ega/about/your_EGA_account/download_streaming_client + </help> + + <citations> + </citations> +</tool>