Access Data – Step by Step Guide

Bellow are the two available methods for accessing data from FEGA Portugal. More technical details are available on the overview page.

Method 1: SSH File Transfer Protocol

  1. The most immediate way to download files from a LEGA node is by accessing its distribution endpoint using SFTP:
sftp -o User=$username -P 2222 -i $privkey_file $lega_ip
  1. Download it using:
get <filename>
  1. and then decrypting the entire C4GH file using Crypt4GH, with the following command:
crypt4gh decrypt --sk $privkey_file < $filename.c4gh > $filename

This will download the entire file and decrypt it as a whole when the download concludes.

Console Example – Retrieving data using SSH FTP

Method 2: EGA-QuickView

To avoid downloading the complete file, EGA-QuickView was developed. This tool takes advantage of Crypt4GH using block encryption and the fact that the LEGA distribution allows for requests for certain bytes of a file without downloading all the previous ones.

To do that, a user chooses a local empty directory to work as a mount point where files in the outbox will appear decrypted while connected, and uses the following command setting up the values accordingly:

ega-qv -f -o seckey=$privkey_file "$username"@"$lega_ip" $local_dir

The mount point will stay connected until the execution is stopped (e.g. using Ctrl+C, killing the process or closing the terminal tab).

The easier way to use this is creating a new tab if the terminal is needed in the meanwhile, but a user could also use the same command without the “-f” flag to run EGA-QuickView in the background. The latter solution comes with the disadvantage that the user will have to manually umount the directory (e.g. using umount $local_dir) when the connection is no longer needed.