Skip to content

Instantly share code, notes, and snippets.

@mfansler
Last active March 26, 2024 20:07
Show Gist options
  • Star 19 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save mfansler/71f09c8b6c9a95ec4e759a8ffc488be3 to your computer and use it in GitHub Desktop.
Save mfansler/71f09c8b6c9a95ec4e759a8ffc488be3 to your computer and use it in GitHub Desktop.
Install ascp on Linux
#!/bin/bash
## How to install ascp, in a gist.
## The URI below is not persistent!
## Check for latest link: https://www.ibm.com/aspera/connect/
wget -qO- https://ak-delivery04-mul.dhe.ibm.com/sar/CMA/OSA/0a07f/0/ibm-aspera-connect_4.1.0.46-linux_x86_64.tar.gz | tar xvz
## run it
chmod +x ibm-aspera-connect_4.1.0.46-linux_x86_64.sh
./ibm-aspera-connect_4.1.0.46-linux_x86_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}
}
@mfansler
Copy link
Author

Looks like they no longer serve non-zipped versions.

@Shicheng-Guo
Copy link

Shicheng-Guo commented Aug 20, 2020

Here, Can I use the private key generated by ssh-keygen -f ./private.openssh
because I cannot find the private key for ascp or the primary private key has been set a Key passphrase and he forget it (manager).

@mfansler
Copy link
Author

@Shicheng-Guo no, you need to use the one included in the ascp installation. It should be at .aspera/connect/etc/asperaweb_id_dsa.openssh, which installs to the user home if following the install script I provided.

@hmkim
Copy link

hmkim commented Nov 22, 2021

Download a connector from https://www.ibm.com/aspera/connect/

@mfansler
Copy link
Author

@hmkim yes, thanks. Since IBM apparently does not persist the download links, one almost always has to go through the site to get a working URL. I try to update the one in the Gist occasionally, but with NCBI phasing out aspera, I revisit this infrequently.

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