Skip to content

Instantly share code, notes, and snippets.

@krzemienski
Forked from mfansler/install-ascp.sh
Created December 10, 2020 16:37
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 krzemienski/555a9409b0acd80b3afbcaf7a48e6bb2 to your computer and use it in GitHub Desktop.
Save krzemienski/555a9409b0acd80b3afbcaf7a48e6bb2 to your computer and use it in GitHub Desktop.
Install ascp on Linux
#!/bin/bash
## How to install ascp, in a gist.
## Check for latest link: http://downloads.asperasoft.com/en/downloads/8?list
wget -qO- https://download.asperasoft.com/download/sw/connect/3.9.8/ibm-aspera-connect-3.9.8.176272-linux-g2.12-64.tar.gz | tar xvz
## run it
chmod +x ibm-aspera-connect-3.9.8.176272-linux-g2.12-64.sh
./ibm-aspera-connect-3.9.8.176272-linux-g2.12-64.sh
## add it to the path now and in the future
export PATH=$PATH:~/.aspera/connect/bin/
echo 'export PATH=$PATH:~/.aspera/connect/bin/' >> ~/.bash_profile
#!/bin/bash
## Some helper functions to put in .bash_profile
# download SRR from NCBI SRA via Aspera Connect
# Usage:
#
# $ get-srr SRR304976
#
get-srr () {
SRR=${1}
SRR_6=$(echo $SRR | cut -c1-6)
# Tune the ascp parameters for your bandwidth!
ascp -i ~/.aspera/connect/etc/asperaweb_id_dsa.openssh \
-k 2 -T -l200m \
anonftp@ftp.ncbi.nlm.nih.gov:/sra/sra-instant/reads/ByRun/sra/SRR/${SRR_6}/${SRR}/${SRR}.sra \
.
}
# download all SRRs listed in a file
get-srr-all () {
while read srr; do
get-srr $srr
done <${1}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment