-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDownloadExample.py
More file actions
59 lines (38 loc) · 1.79 KB
/
DownloadExample.py
File metadata and controls
59 lines (38 loc) · 1.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import os
from google_drive_downloader import GoogleDriveDownloader as gdd
### Please specify data to download and process! ###
process_data = ['mouse_brain', 'mouse_kidney']
# (list) List specifying dataset to download and process
## ['mouse_brain', 'mouse_kidney']
data_path_parameter = {'mouse_brain' : {'gdd_id': '1pB25UcE2nL5ZOuOaoAxTFHf1D3rbnH3f',
'zip_path': '/mouse_brain_downloaded.zip'},
'mouse_kidney': {'gdd_id': '1N7TxmohOJRi5kTkvf02RaEoCoAuaQ-X7',
'zip_path': '/mouse_kidney_downloaded.zip'}}
if __name__ == '__main__':
"""
Reconstruct data shared on the google drive.
Parameters
----------
process_data : list
List specifying dataset to download and process
Returns
--------
Outputs data to disk.
"""
configfiles = []
working_folder = os.getcwd() + '/data_downloaded'
recon_folder = working_folder + '/recon_result'
if not os.path.isdir(working_folder):
os.mkdir(working_folder)
print("\nsetting up data folder "+working_folder)
if not os.path.isdir(recon_folder):
os.mkdir(recon_folder)
print("\nsetting up recon folder "+recon_folder)
for item in process_data:
item_gdd_id = data_path_parameter[item]['gdd_id']
zipdir = working_folder + data_path_parameter[item]['zip_path']
gdd.download_file_from_google_drive(file_id=item_gdd_id,
dest_path=zipdir,
unzip=True,
showsize=True,
overwrite=True)