Skip to content

Instantly share code, notes, and snippets.

@flying-sheep
Forked from lh3/BSdownload.md
Created December 13, 2018 15:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save flying-sheep/6e8d79f4d5f3f49ea1ad4133856f3b26 to your computer and use it in GitHub Desktop.
Save flying-sheep/6e8d79f4d5f3f49ea1ad4133856f3b26 to your computer and use it in GitHub Desktop.
Download files from Illumina's BaseSpace

References:

Steps:

  1. Follow steps 1-5 in the first link above to acquire access_token. This will take a while, but you only need to do this once. Never share this token!!
  2. Find the file you want to download. Copy the link, which looks something like: https://basespace.illumina.com/sample/9804795/files/tree/NA12878-L1_S1_L001_R1_001.fastq.gz?id=515013503. The "id" is the unique file identifier.
  3. Download the file with: wget -O filename 'https://api.basespace.illumina.com/v1pre3/files/{id}/content?access_token={token}', where {token} is from step 1 and {id} from step 2.

A final note on security. It seems that the token acquired at step 1 does not automatically expire (in that case, this really needs improvement), so it is VERY IMPORTANT NOT to share this token, or others will gain access to all your data. Step 3 is not secure as others may see your download link with ps -f.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment