Oleksandr Frei and Sandeep Karthikeyan has access to certain datasets from dbGAP, please reach out if you need help.

- ​eRA user ID:     oleksandr.frei@medisin.uio.no
- ​eRA user e-mail: oleksandr.frei@medisin.uio.no
- eRA account can be associated with login.gov account.
- ​Password expires every 6 month.
- ​https://auth.nih.gov/CertAuthV3/forms/passwordlinks.html -  help
- ​eRA password reset: https://public.era.nih.gov/ams/public/accounts/password/reset.era?mode=init&requestedURL=s%3A%2F%2Fpublic.era.nih.gov%3A443%2Fcommons%2FcommonsInit.do
- NORMENT's dbGAP project: 91306-1 

https://dbgap.ncbi.nlm.nih.gov/aa/wga.cgi?page=request_details_pi&filter=arid&arid=367762

The download process is somewhat tricky.


Steps to install aspera client for downloading files from dbGAP:

<code>
- First, one must create an eRA account (this require help from UiO administrator "eirik.ivarrud@admin.uio.no" <eirik.ivarrud@admin.uio.no>  who manage dbGAP access for UiO employees)i
- Second, eRA account must be added to NORMENT dbGAP application. Ole Andreassen should do this.
- Third, eRA account password needs a reset every 6 month (you can do it later if password expired). Now it's recommended to link eRA account with login.gov authentication scheme (more info on eRA site).
- Fourth, you should have ibm-aspera-connect and ibm-aspera-desktopclient installed on your machine, in order to download. This can be done on Windows, MAC and Ubuntu, but we strongly recommend doing this on Ubuntu machine. More info below.
- Then you need to execute certain commands using ibm-aspera-connect to download the data
- You also need  "SRA toolkit" (to decrypt the data). More info below.
- Finally, you execute certain commands to decrypt the data.

Installing ibm-aspera client & desktopclient.

On Ubuntu one need to install both "Connect" and "Desktopclient" from https://www.ibm.com/aspera/connect/
ibm-aspera-connect-3.9.9.177872-linux-g2.12-64.tar.gz
ibm-aspera-desktopclient-3.9.6.176292-linux-64.deb
One of these is to get ascp binary; the other is to get the key ( /home/username/.aspera/connect/etc/asperaweb_id_dsa.openssh )

If you don't see the key, copy it from here:
https://github.com/mlangill/MicrobeDB/tree/master/scripts/aspera_32/connect/etc
Likely you'll need the following two files: asperaweb_id_dsa.openssh and asperaweb_id_dsa.putty
If the above location doesn't work, take the files from the bottom of this page of the wiki.


To download the data, I've used the following command (the -W flag looks like some sensitive string, I dropped it's content for security)
This command is provided by dbGAP website (require access with eRA account)

ascp -QTr -l 300M -k 1 -i  /home/oleksanf/.aspera/connect/etc/asperaweb_id_dsa.openssh -W A3........................1D dbtest@gap-upload.ncbi.nlm.nih.gov:data/instant/oleksandr.frei@medisin.uio.no/79153 .




Then one need SRA software from NCBI to decrypt. 
https://trace.ncbi.nlm.nih.gov/Traces/sra/sra.cgi?view=software
http://ftp-trace.ncbi.nlm.nih.gov/sra/sdk/2.10.5/sratoolkit.2.10.5-ubuntu64.tar.gz

UPD Nov 22, 202: I re-odwnloaded SRA toolkit from here https://github.com/ncbi/sra-tools/wiki/01.-


Downloading-SRA-Toolkit
and used the following command to decrypy:
/home/oleksanf/vmshare/data/MVP_v2/sratoolkit.2.10.8-ubuntu64/bin/vdb-decrypt --ngc prj_547_D27385.ngc Study_Report.phs001672.MVP.v4.p1.MULTI.pdf.ncbi_enc
This way there is no need to "configure" SRA toolkit.

On linux one just use 'vdb-decrypt' tool. You'll need a project-specific key that can be downloaded from dbGAP website.
In this case it was called 'prj_547_D27385.ngc' (I didn't store it). 

</code>


Here are aspera keys (copied from https://github.com/mlangill/MicrobeDB/tree/master/scripts/aspera_32/connect/etc )

/home/oleksanf/.aspera/connect/etc/asperaweb_id_dsa.putty
<code>
PuTTY-User-Key-File-2: ssh-dss
Encryption: none
Comment: imported-openssh-key
Public-Lines: 10

8Ko=
Private-Lines: 1
AAAAFEyfl0vHTa7g6mGwIMXrdTQQ8fZs
Private-MAC: b0784da9f013d9eeb8e0187b3b8b6bd5cfd72e8c
</code>

/home/oleksanf/.aspera/connect/etc/asperaweb_id_dsa.openssh
<code>
-----BEGIN DSA PRIVATE KEY-----

Ta7g6mGwIMXrdTQQ8fZs
-----END DSA PRIVATE KEY-----
</code>
