Skip to content

Commit

Permalink
added new cloud region and function for bucket change
Browse files Browse the repository at this point in the history
  • Loading branch information
l-mansouri committed Nov 22, 2023
1 parent f09ad97 commit e8695ff
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
3 changes: 3 additions & 0 deletions conf/cloud-region/ap_southeast_1.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
params {
reference_data_bucket = "s3://ap-southeast-1-lb-featured-datasets"
}
12 changes: 11 additions & 1 deletion main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,16 @@ log.info ""
// Check input parameters
// ---------------------------------------------------*/

def replaceBucket(file, bucket="${params.reference_data_bucket}", pattern="${params.bucket_pattern}") {
reg_exp = ~/(s3:\/\/[a-zA-Z0-9\-]*$pattern)/
file = file.toString()
if (file =~ reg_exp) {
replace_bucket = (file =~ reg_exp)[0]
file = file.replaceAll(replace_bucket[0], bucket)
}
return file
}

if(params.families_file) {
Channel
.fromPath( "${params.families_file}")
Expand All @@ -60,7 +70,7 @@ Channel
.fromPath(params.families_file)
.ifEmpty { exit 1, "Cannot find input file : ${params.families_file}" }
.splitCsv(header:true, sep:'\t', strip: true)
.map {row -> [ row.proband_id, file(row.vcf_path), file(row.vcf_index_path)] }
.map {row -> [ row.proband_id, file(replaceBucket(row.vcf_path)), file(replaceBucket(row.vcf_index_path))] }
.into {ch_vcf_paths; ch_vcf_paths2}

// Conditional creation of channels, custom if provided else default from bin/
Expand Down
1 change: 1 addition & 0 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ profiles {
awsbatch { includeConfig 'conf/executors/awsbatch.config' }
eu_west_1 { includeConfig 'conf/cloud-region/eu_west_1.config' }
eu_west_2 { includeConfig 'conf/cloud-region/eu_west_2.config' }
ap_southeast_1 { includeConfig 'conf/cloud-region/ap_southeast_1.config' }
test_full { includeConfig "conf/tests/full/test_full.config" }
test_full_family { includeConfig 'conf/tests/full/test_full_family.config' }
test_full_single_vcf { includeConfig 'conf/tests/full/test_full_single_vcf.config' }
Expand Down

0 comments on commit e8695ff

Please sign in to comment.