Skip to content

Commit

Permalink
Merge pull request #821 from FriederikeHanssen/fix_input_finding
Browse files Browse the repository at this point in the history
Use putIfAbsent
  • Loading branch information
maxulysse authored Nov 10, 2022
2 parents 9337d11 + b8837cc commit 8e5afb3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [#806](https://github.com/nf-core/sarek/pull/806) - Refactor all tests
- [#806](https://github.com/nf-core/sarek/pull/806) - Split up `modules.config` file
- [#810](https://github.com/nf-core/sarek/pull/810) - Update CHANGELOG
- [#821](https://github.com/nf-core/sarek/pull/821) - Change `replace` to `putIfAbsent` for automatic search of `input` if none is provided to avoid overwriting values

### Fixed

Expand Down
10 changes: 5 additions & 5 deletions lib/WorkflowSarek.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -81,20 +81,20 @@ class WorkflowSarek {
System.exit(1);
break
case 'markduplicates': log.warn "Using file ${params.outdir}/csv/mapped.csv"
params.replace("input","${params.outdir}/csv/mapped.csv");
params.putIfAbsent("input","${params.outdir}/csv/mapped.csv");
break
case 'prepare_recalibration': log.warn "Using file ${params.outdir}/csv/markduplicates_no_table.csv"
params.replace("input", "${params.outdir}/csv/markduplicates_no_table.csv");
params.putIfAbsent("input", "${params.outdir}/csv/markduplicates_no_table.csv");
break
case 'recalibrate': log.warn "Using file ${params.outdir}/csv/markduplicates.csv"
params.replace("input", "${params.outdir}/csv/markduplicates.csv");
params.putIfAbsent("input", "${params.outdir}/csv/markduplicates.csv");
break
case 'variant_calling': log.warn "Using file ${params.outdir}/csv/recalibrated.csv"
params.replace("input", "${params.outdir}/csv/recalibrated.csv");
params.putIfAbsent("input", "${params.outdir}/csv/recalibrated.csv");
break
// case 'controlfreec': csv_file = file("${params.outdir}/variant_calling/csv/control-freec_mpileup.csv", checkIfExists: true); break
case 'annotate': log.warn "Using file ${params.outdir}/csv/variantcalled.csv"
params.replace("input","${params.outdir}/csv/variantcalled.csv");
params.putIfAbsent("input","${params.outdir}/csv/variantcalled.csv");
break
default: log.warn "Please provide an input samplesheet to the pipeline e.g. '--input samplesheet.csv'"
exit 1, "Unknown step $params.step"
Expand Down

0 comments on commit 8e5afb3

Please sign in to comment.