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
AAAAB3NzaC1kc3MAAACBAOQpAcPqbjIjGCOx7Lo+fLjppxlcRGwkfLnin8GpcjJi
RU4CQSkqC9PepNM2bKRZbDii84/X4OLVz/YWlhyWVxOmGRZxLyUDuPTXaZQR5xdq
9eM88bSLe3m+0HzEvLfeRDd72/38vCHTFxF+5rR3lR8XCikEgBe8kCvcHqtqmzz5
AAAAFQC8LMnqrMdxKJQmglVyX/utXHiaaQAAAIA+g+0Q/jLMcbZe1zEJ9dpvi73M
TrA/Ph48m3RROfd9S+dCYlPuLQpUJGveDYfY5kxYXXbLSNSrxAG5nayjcId57tbV
WYB1s3sXFz5zJX2cTrNRGoBo/K3ZsT6uAzWk/otBRjGAPfEp2/Vkb6QMgMR/pTei
eNwpuYDpyTFPoZq+gAAAAIEAobapDv5p2foH+cG5K07sIFD9r0RD7uKJnlqjYAXz
Fc8U76wXKgu6WXup2ac0Co+RnZp7Hsa9G+E+iJ6poI9pOR08XTdPly4yDULNST4P
wlfrbSFT9FVhzkWfpOvAUc8fkQAhZqv/PE6VhFQ8w03Z8GpqXx7b3NvBR+EfIx36
8Ko=
Private-Lines: 1
AAAAFEyfl0vHTa7g6mGwIMXrdTQQ8fZs
Private-MAC: b0784da9f013d9eeb8e0187b3b8b6bd5cfd72e8c
</code>

/home/oleksanf/.aspera/connect/etc/asperaweb_id_dsa.openssh
<code>
-----BEGIN DSA PRIVATE KEY-----
MIIBuwIBAAKBgQDkKQHD6m4yIxgjsey6Pny46acZXERsJHy54p/BqXIyYkVOAkEp
KgvT3qTTNmykWWw4ovOP1+Di1c/2FpYcllcTphkWcS8lA7j012mUEecXavXjPPG0
i3t5vtB8xLy33kQ3e9v9/Lwh0xcRfua0d5UfFwopBIAXvJAr3B6raps8+QIVALws
yeqsx3EolCaCVXJf+61ceJppAoGAPoPtEP4yzHG2XtcxCfXab4u9zE6wPz4ePJt0
UTn3fUvnQmJT7i0KVCRr3g2H2OZMWF12y0jUq8QBuZ2so3CHee7W1VmAdbN7Fxc+
cyV9nE6zURqAaPyt2bE+rgM1pP6LQUYxgD3xKdv1ZG+kDIDEf6U3onjcKbmA6ckx
T6GavoACgYEAobapDv5p2foH+cG5K07sIFD9r0RD7uKJnlqjYAXzFc8U76wXKgu6
WXup2ac0Co+RnZp7Hsa9G+E+iJ6poI9pOR08XTdPly4yDULNST4PwlfrbSFT9FVh
zkWfpOvAUc8fkQAhZqv/PE6VhFQ8w03Z8GpqXx7b3NvBR+EfIx368KoCFEyfl0vH
Ta7g6mGwIMXrdTQQ8fZs
-----END DSA PRIVATE KEY-----
</code>
