Programmatic Download on Synapse by Python
I'm Trying Run a Code on Colab, but I've Run into Some Issues While Downloading Data from Synapse. Here Is the Download Link for the Data Upon Entering the...
I'm trying run a code on Colab, but I've run into some issues while downloading data from Synapse.
Here is the download link for the data
Upon entering the website, clicking on the download option at the upper right corner reveals a programmatic option. I chose to download using Python.
You will then get a block of code as follows.
import synapseclient
import synapseutils
syn = synapseclient.Synapse()
syn.login('synapse_username','password')
files = synapseutils.syncFromSynapse(syn, ' syn3193805 ')
However, I encountered recurring error message when running the code".
WARNING:synapseclient_default:
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
ifcollision=overwrite.localis being IGNORED because the download destination is synapse's cache. Instead, the behavior is "overwrite.local".
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
At first, I noticed that there were unnecessary spaces on both sides of the file ID. I removed them, but I still encountered the same error."
-Before-
files = synapseutils.syncFromSynapse(syn, ' syn3193805 ')
-After-
files = synapseutils.syncFromSynapse(syn, 'syn3193805')
I also thought that this message may not affect the program's operation, so I waited for a long time. However, it remained stuck and continued to spin. enter image description here
Has anyone ever encountered a similar issue before? How can it be resolved? Thank you!
1 Answer
I think I have solved the problem myself. Just need to specify the download path for the data.
import synapseclient
import synapseutils
syn = synapseclient.Synapse()
syn.login('synapse_username','password')
destination_folder = "C:\\Users\\XXX\\Desktop\\Project"
files = synapseutils.syncFromSynapse(syn, 'syn3193805', path=destination_folder)