Skip to content

Instantly share code, notes, and snippets.

@RyanSchu
Last active January 13, 2022 22:34
Show Gist options
  • Save RyanSchu/535291d0aa949189ba1977ddb8d44c21 to your computer and use it in GitHub Desktop.
Save RyanSchu/535291d0aa949189ba1977ddb8d44c21 to your computer and use it in GitHub Desktop.
Downloading Data from dbgap

Install the aspera cli client required by dbgap

aspera installation manual download page

wget https://download.asperasoft.com/download/sw/cli/3.7.7/aspera-cli-3.7.7.608.927cce8-linux-64-release.sh

update permissions of the installation executable and execute

chmod a+x ./aspera-cli-3.7.7.608.927cce8-linux-64-release.sh
./aspera-cli-3.7.7.608.927cce8-linux-64-release.sh

Optional but recommended: add aspera to the path

export PATH=~/.aspera/cli/bin:$PATH

make sure ascp is executable

ascp
#should produce the output
Usage: ascp [OPTION] SRC... DEST
          SRC to DEST, or multiple SRC to DEST dir
          SRC, DEST format: [[user@]host:]PATH
Display full usage: -h,--help

Get the download key from dbGaP

  1. Click Request Files on the page 'my requests' on dbGaP
  2. Select the files you want
  3. Click 'create download request' to produce a download key This key is only valid for a short time so its useful to prep the following commands ahead of time
  4. Using the ascp command download the data
#The download command follows the format
<PATH TO ASPERA INSTALL>/bin/ascp -QTr -l 300M -k 1 -i <PATH TO ASPERA INSTALL>etc/asperaweb_id_dsa.openssh -W <DOWNLOAD KEY> dbtest@gap-upload.ncbi.nlm.nih.gov:<SOURCE DIRECTORY> <OUTPUT DIRECTORY>
#Everything in <> should be replaced to match your case
#For example on my machine it looked like this
ascp -QTr -l 300M -k 1 -i ~/.aspera/cli/etc/asperaweb_id_dsa.openssh -W A51524DE6FF0540938BBEEF8C669EF669EFFF287D07234B7F90997D667C2021A4A4A0060A69EE49EDB66C48C3D3EAFFCED dbtest@gap-upload.ncbi.nlm.nih.gov:data/instant/rschubert/64117 /home/ryan
#Notice that the aspera install was in a hidden directory. ls -a will reveal these if you cant find them.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment