-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3da9343
commit fca811a
Showing
4 changed files
with
41 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
api/scpca_portal/management/commands/download_input_files.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import logging | ||
|
||
from django.core.management.base import BaseCommand | ||
|
||
from scpca_portal import common, loader, s3 | ||
from scpca_portal.models import Project | ||
|
||
logger = logging.getLogger() | ||
logger.setLevel(logging.INFO) | ||
logger.addHandler(logging.StreamHandler()) | ||
|
||
|
||
class Command(BaseCommand): | ||
def handle(self, *args, **kwargs): | ||
loader.prep_data_dirs() | ||
|
||
project = Project.objects.filter(scpca_id="SCPCP000006").first() | ||
|
||
download_config = common.PROJECT_DOWNLOAD_CONFIGS["SPATIAL_SINGLE_CELL_EXPERIMENT"] | ||
libraries = project.get_libraries(download_config) | ||
|
||
library_data_file_paths = [ | ||
fp for lib in libraries for fp in lib.get_download_config_file_paths(download_config) | ||
] | ||
project_data_file_paths = project.get_download_config_file_paths(download_config) | ||
|
||
s3.download_input_files( | ||
library_data_file_paths + project_data_file_paths, project.s3_input_bucket | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters