Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions nextflow/configs/profiles/sumner2.config
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ params {
globus_remote_endpoint = "70850914-722d-11e7-aa01-22000bf2d287" // JAX T2 storage endpoint
globus_remote_folder = "/tier2/vkumar/"
dropbox_prefix = "labdropbox:\"/KumarLab's shared workspace/VideoData/MDS_Tests/\""
rclone_config = "/projects/kumar-lab/meta/secrets/tokens/rclone_dropbox.conf"
}

apptainer {
Expand Down
9 changes: 6 additions & 3 deletions nextflow/modules/remote_io.nf
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ process FILTER_UNPROCESSED_DROPBOX {
input:
path test_files
val dropbox_prefix
path rclone_config

output:
path "unprocessed_files.txt", emit: unprocessed_files
Expand All @@ -62,7 +63,7 @@ process FILTER_UNPROCESSED_DROPBOX {
touch unprocessed_files.txt
while read test_file; do
test_pose=\${test_file/.*}_pose_est_v6.h5
rclone ls ${dropbox_prefix}\${test_pose} > /dev/null 2>&1
rclone ls --config=${rclone_config} ${dropbox_prefix}\${test_pose} > /dev/null 2>&1
if [[ \$? != 0 ]]; then
echo \$test_file >> unprocessed_files.txt
fi
Expand Down Expand Up @@ -122,14 +123,15 @@ process GET_DATA_FROM_DROPBOX {
input:
path files_to_transfer
val dropbox_prefix
path rclone_config

output:
path "fetched_files.txt", emit: remote_files

script:
"""
echo ${dropbox_prefix}
rclone copy --transfers=1 --include-from ${files_to_transfer} ${dropbox_prefix} retrieved_files/.
rclone copy --config=${rclone_config} --transfers=1 --include-from ${files_to_transfer} ${dropbox_prefix} retrieved_files/.
find \$(pwd)/retrieved_files/ -type f > fetched_files.txt
"""
}
Expand All @@ -142,9 +144,10 @@ process PUT_DATA_TO_DROPBOX {
path file_to_upload
tuple path(result_file), val(publish_filename)
val dropbox_prefix
path rclone_config

script:
"""
rclone copy --transfers=1 ${result_file} ${dropbox_prefix}/${publish_filename}
rclone copy --config=${rclone_config} --transfers=1 ${result_file} ${dropbox_prefix}/${publish_filename}
"""
}
4 changes: 2 additions & 2 deletions nextflow/workflows/io.nf
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ workflow PREPARE_DATA {
if (location == "local") {
file_batch = FILTER_LOCAL_BATCH(all_valid_files, params.ignore_invalid_inputs, params.filter_processed, params.pubdir).process_filelist
} else if (location == "dropbox") {
in_video_list = FILTER_UNPROCESSED_DROPBOX(all_valid_files, params.dropbox_prefix).unprocessed_files
file_batch = GET_DATA_FROM_DROPBOX(in_video_list, params.dropbox_prefix).remote_files
in_video_list = FILTER_UNPROCESSED_DROPBOX(all_valid_files, params.dropbox_prefix, params.rclone_config).unprocessed_files
file_batch = GET_DATA_FROM_DROPBOX(in_video_list, params.dropbox_prefix, params.rclone_config).remote_files
} else if (location == "globus") {
CHECK_GLOBUS_AUTH()
in_video_list = FILTER_UNPROCESSED_GLOBUS(params.globus_remote_endpoint, all_valid_files).unprocessed_files
Expand Down