Skip to content

Commit

Permalink
Resolve intervals when needed (#73)
Browse files Browse the repository at this point in the history
* Resolve intervals as needed

* Update CHANGELOG

* Bump version

* Update in DOC

* Mask version numbers in tests

* Ensure intervals directory is mounted on docker for RTC

* Add slash

---------

Co-authored-by: Nicholas Wiltsie <[email protected]>
  • Loading branch information
yashpatel6 and nwiltsie authored May 29, 2024
1 parent e354c45 commit 3ee8f38
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 16 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,13 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

## [Unreleased]

---

## [1.0.1] - 2024-05-29
### [Changed]
- Update Nextflow configuration test workflows
### [Fixed]
- Resolve interval path for original given intervals to ensure the index file for intervals is found when present

---

Expand Down
2 changes: 1 addition & 1 deletion module/base-recalibration.nf
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ process run_BaseRecalibrator_GATK {

script:
all_ir_bams = indelrealigned_bams.collect{ "--input '${it}'" }.join(' ')
targeted_options = params.is_targeted ? "--intervals ${intervals} --interval-padding 100" : ""
targeted_options = params.is_targeted ? "--intervals \"\$(realpath ${intervals})\" --interval-padding 100" : ""
"""
set -euo pipefail
if [ ! -f ${sample_id}_recalibration_table.grp ]
Expand Down
2 changes: 2 additions & 0 deletions module/indel-realignment.nf
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ process run_RealignerTargetCreator_GATK {
path(bundle_mills_and_1000g_gold_standards_vcf_gz_tbi)
path(bundle_known_indels_vcf_gz)
path(bundle_known_indels_vcf_gz_tbi)
path(original_intervals)
tuple path(bam), path(bam_index), val(interval_id), path(interval)

output:
Expand Down Expand Up @@ -174,6 +175,7 @@ workflow realign_indels {
"${params.bundle_mills_and_1000g_gold_standard_indels_vcf_gz}.tbi",
params.bundle_known_indels_vcf_gz,
"${params.bundle_known_indels_vcf_gz}.tbi",
"${params.getOrDefault('intervals', null) ?: params.work_dir + '/NO_FILE.bed'}",
input_ch_rtc
)

Expand Down
4 changes: 2 additions & 2 deletions module/summary-qc.nf
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ process run_GetPileupSummaries_GATK {
tuple val(sample_id), path("*getpileupsummaries.table"), emit: pileupsummaries

script:
interval_options = all_intervals.collect{ "--intervals '$it'" }.join(' ')
interval_options = all_intervals.collect{ "--intervals \"\$(realpath ${it})\"" }.join(' ')
output_filename = generate_standard_filename(
"GATK-${params.gatk_version}",
params.dataset_id,
Expand Down Expand Up @@ -168,7 +168,7 @@ process run_DepthOfCoverage_GATK {
params.is_DOC_run

script:
interval_options = all_intervals.collect{ "--intervals '$it'" }.join(' ')
interval_options = all_intervals.collect{ "--intervals \"\$(realpath ${it})\"" }.join(' ')
output_filename = generate_standard_filename(
"GATK-${params.gatk_version}",
params.dataset_id,
Expand Down
2 changes: 1 addition & 1 deletion nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ manifest {
name = 'recalibrate-BAM'
author = 'Yash Patel, Nicholas Wiltsie'
description = 'Nextflow pipeline to perform Indel Realignment and Base Quality Score Recalibration'
version = '1.0.0'
version = '1.0.1'
}
20 changes: 14 additions & 6 deletions test/configtest-F16.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@
"timeline.file",
"trace.file"
],
"version_fields": [
"manifest.version",
"params.log_output_dir",
"params.output_dir_base",
"report.file",
"trace.file",
"timeline.file"
],
"expected_result": {
"docker": {
"all_group_ids": "$(for i in `id --real --groups`; do echo -n \"--group-add=$i \"; done)",
Expand All @@ -39,7 +47,7 @@
"author": "Yash Patel, Nicholas Wiltsie",
"description": "Nextflow pipeline to perform Indel Realignment and Base Quality Score Recalibration",
"name": "recalibrate-BAM",
"version": "1.0.0"
"version": "VER.SI.ON"
},
"params": {
"aligner": "BWA-MEM2-2.2.1",
Expand Down Expand Up @@ -74,7 +82,7 @@
"is_DOC_run": false,
"is_emit_original_quals": true,
"is_targeted": false,
"log_output_dir": "/tmp/outputs/recalibrate-BAM-1.0.0/TWGSAMIN000001/log-recalibrate-BAM-1.0.0-19970704T165655Z",
"log_output_dir": "/tmp/outputs/recalibrate-BAM-VER.SI.ON/TWGSAMIN000001/log-recalibrate-BAM-VER.SI.ON-19970704T165655Z",
"max_cpus": "16",
"max_memory": "31 GB",
"metapipeline_delete_input_bams": false,
Expand All @@ -85,7 +93,7 @@
"min_cpus": "1",
"min_memory": "1 MB",
"output_dir": "/tmp/outputs",
"output_dir_base": "/tmp/outputs/recalibrate-BAM-1.0.0/TWGSAMIN000001/GATK-4.2.4.1",
"output_dir_base": "/tmp/outputs/recalibrate-BAM-VER.SI.ON/TWGSAMIN000001/GATK-4.2.4.1",
"parallelize_by_chromosome": true,
"patient_id": "TWGSAMIN000001",
"picard_version": "2.26.10",
Expand Down Expand Up @@ -414,15 +422,15 @@
},
"report": {
"enabled": true,
"file": "/tmp/outputs/recalibrate-BAM-1.0.0/TWGSAMIN000001/log-recalibrate-BAM-1.0.0-19970704T165655Z/nextflow-log/report.html"
"file": "/tmp/outputs/recalibrate-BAM-VER.SI.ON/TWGSAMIN000001/log-recalibrate-BAM-VER.SI.ON-19970704T165655Z/nextflow-log/report.html"
},
"timeline": {
"enabled": true,
"file": "/tmp/outputs/recalibrate-BAM-1.0.0/TWGSAMIN000001/log-recalibrate-BAM-1.0.0-19970704T165655Z/nextflow-log/timeline.html"
"file": "/tmp/outputs/recalibrate-BAM-VER.SI.ON/TWGSAMIN000001/log-recalibrate-BAM-VER.SI.ON-19970704T165655Z/nextflow-log/timeline.html"
},
"trace": {
"enabled": true,
"file": "/tmp/outputs/recalibrate-BAM-1.0.0/TWGSAMIN000001/log-recalibrate-BAM-1.0.0-19970704T165655Z/nextflow-log/trace.txt"
"file": "/tmp/outputs/recalibrate-BAM-VER.SI.ON/TWGSAMIN000001/log-recalibrate-BAM-VER.SI.ON-19970704T165655Z/nextflow-log/trace.txt"
},
"workDir": "/scratch/851543"
}
Expand Down
20 changes: 14 additions & 6 deletions test/configtest-F32.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@
"timeline.file",
"trace.file"
],
"version_fields": [
"manifest.version",
"params.log_output_dir",
"params.output_dir_base",
"report.file",
"trace.file",
"timeline.file"
],
"expected_result": {
"docker": {
"all_group_ids": "$(for i in `id --real --groups`; do echo -n \"--group-add=$i \"; done)",
Expand All @@ -39,7 +47,7 @@
"author": "Yash Patel, Nicholas Wiltsie",
"description": "Nextflow pipeline to perform Indel Realignment and Base Quality Score Recalibration",
"name": "recalibrate-BAM",
"version": "1.0.0"
"version": "VER.SI.ON"
},
"params": {
"aligner": "BWA-MEM2-2.2.1",
Expand Down Expand Up @@ -74,7 +82,7 @@
"is_DOC_run": false,
"is_emit_original_quals": true,
"is_targeted": false,
"log_output_dir": "/tmp/outputs/recalibrate-BAM-1.0.0/TWGSAMIN000001/log-recalibrate-BAM-1.0.0-19970704T165655Z",
"log_output_dir": "/tmp/outputs/recalibrate-BAM-VER.SI.ON/TWGSAMIN000001/log-recalibrate-BAM-VER.SI.ON-19970704T165655Z",
"max_cpus": "32",
"max_memory": "64 GB",
"metapipeline_delete_input_bams": false,
Expand All @@ -85,7 +93,7 @@
"min_cpus": "1",
"min_memory": "1 MB",
"output_dir": "/tmp/outputs",
"output_dir_base": "/tmp/outputs/recalibrate-BAM-1.0.0/TWGSAMIN000001/GATK-4.2.4.1",
"output_dir_base": "/tmp/outputs/recalibrate-BAM-VER.SI.ON/TWGSAMIN000001/GATK-4.2.4.1",
"parallelize_by_chromosome": true,
"patient_id": "TWGSAMIN000001",
"picard_version": "2.26.10",
Expand Down Expand Up @@ -414,15 +422,15 @@
},
"report": {
"enabled": true,
"file": "/tmp/outputs/recalibrate-BAM-1.0.0/TWGSAMIN000001/log-recalibrate-BAM-1.0.0-19970704T165655Z/nextflow-log/report.html"
"file": "/tmp/outputs/recalibrate-BAM-VER.SI.ON/TWGSAMIN000001/log-recalibrate-BAM-VER.SI.ON-19970704T165655Z/nextflow-log/report.html"
},
"timeline": {
"enabled": true,
"file": "/tmp/outputs/recalibrate-BAM-1.0.0/TWGSAMIN000001/log-recalibrate-BAM-1.0.0-19970704T165655Z/nextflow-log/timeline.html"
"file": "/tmp/outputs/recalibrate-BAM-VER.SI.ON/TWGSAMIN000001/log-recalibrate-BAM-VER.SI.ON-19970704T165655Z/nextflow-log/timeline.html"
},
"trace": {
"enabled": true,
"file": "/tmp/outputs/recalibrate-BAM-1.0.0/TWGSAMIN000001/log-recalibrate-BAM-1.0.0-19970704T165655Z/nextflow-log/trace.txt"
"file": "/tmp/outputs/recalibrate-BAM-VER.SI.ON/TWGSAMIN000001/log-recalibrate-BAM-VER.SI.ON-19970704T165655Z/nextflow-log/trace.txt"
},
"workDir": "/scratch/851543"
}
Expand Down

0 comments on commit 3ee8f38

Please sign in to comment.