Hi team!
I have been helping folks use synapseutils to download all FASTQ or BAM files from a given directory (e.g., syn1773111) to an external hard drive. For example:
import synapseclient
import synapseutils
syn = synapseclient.Synapse()
syn.login('yyyyy','xxxxxxx')
entities = synapseutils.sync.syncFromSynapse(syn,"syn1773111")
One challenge for them has been that the files are always saved to their Users directory (~) under .synapseCache to deep subdirectories. I would like to have these files download to a pre-selected target destination though which would eliminate a lot of manual work and code that could easy cause problems on the source operating system.
Thanks so much!
Best,
Nathan
Created by Nathan Salomonis nsalomonis Hi Meredith,
This is great! Very clear.
Best,
Nathan
Oh, and if the article isn't clear or you need more examples, let us know! We're always trying to improve our documentation. Hi Nathan!
This support article might help answer your question (http://docs.synapse.org/articles/downloading_data.html) -- it specifies that the default download location (for the Python and R clients) will always be in the Synapse cache whereas the command line client downloads to your current working directory. However, each case you can specify the parameter for
```
downloadLocation
```
For example,
```
entity = syn.get("syn00123", downloadLocation="/path/to/folder")
```
To download a set of files (bulk download), there's this example given in the same article:
```
# Load required libraries
import synapseclient
import synapseutils
# login to Synapse
syn = synapseclient.login(email='me@example.com', password='secret', rememberMe=True)
# download all the files in folder syn123 to a local folder called "myFolder"
all_files = synapseutils.syncFromSynapse(syn, entity='syn123', path='/path/to/myFolder')
```
I hope this helps!
Best,
Meredith
Drop files to upload
synapseutils saving to a single selected output directory page is loading…