Skip to content

Commit

Permalink
mend
Browse files Browse the repository at this point in the history
  • Loading branch information
abearab committed Jun 23, 2024
1 parent fe07d58 commit 119f541
Showing 1 changed file with 23 additions and 27 deletions.
50 changes: 23 additions & 27 deletions CanDI/setup/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,34 +67,30 @@ def download_reformatted_data(self):
if not os.path.exists(self.manager_path + '/data/depmap/'):
os.makedirs(self.manager_path + '/data/depmap/')

if self.download_source == "dataverse":
urls, file_names = depmap_dataverse_download(
self.manager_path + '/data/depmap/',
return_type= ["url", "name"]
)

depmap_urls = {
file: url for url, file in zip(urls, file_names)
}

depmap_files = {}
for file in file_names:
f_key = file.split('.')[0]
f_key = f_key.replace('CCLE_','')
f_key = f_key.replace('CRISPR_','')
depmap_files[f_key] = file

formatted = {
f'{self.manager_path}/data/depmap/{file}': file for file in file_names
if 'readme' not in file.lower()
}

self.parser["depmap_urls"] = depmap_urls
self.parser["depmap_files"] = depmap_files
self.parser["formatted"] = formatted
urls, file_names = depmap_dataverse_download(
self.manager_path + '/data/depmap/',
return_type= ["url", "name"]
)

else:
raise RuntimeError("Set download source to 'dataverse' before running download_formated_data")
depmap_urls = {
file: url for url, file in zip(urls, file_names)
}

depmap_files = {}
for file in file_names:
f_key = file.split('.')[0]
f_key = f_key.replace('CCLE_','')
f_key = f_key.replace('CRISPR_','')
depmap_files[f_key] = file

formatted = {
f'{self.manager_path}/data/depmap/{file}': file for file in file_names
if 'readme' not in file.lower()
}

self.parser["depmap_urls"] = depmap_urls
self.parser["depmap_files"] = depmap_files
self.parser["formatted"] = formatted


class BroadDepMap(Manager):
Expand Down

0 comments on commit 119f541

Please sign in to comment.