Skip to content

Commit

Permalink
Merge pull request #46 from uclahs-cds/nwiltsie_fix_scratch
Browse files Browse the repository at this point in the history
Remove local set_env and check_limits methods
  • Loading branch information
nwiltsie authored Dec 21, 2023
2 parents 7f10450 + be57078 commit 0faae57
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 36 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
- Add new flow diagram to README
- Add additional details to Pipeline Steps section of README
- Option to provide base recalibration tables for any subset of samples to skip `BaseRecalibrator`

### [Changed]
- Use modularized `set_env` function
- Use modularized `check_limits` function

---

Expand Down
36 changes: 0 additions & 36 deletions config/methods.config
Original file line number Diff line number Diff line change
Expand Up @@ -6,42 +6,6 @@ includeConfig "${projectDir}/external/pipeline-Nextflow-config/config/schema/sch
includeConfig "${projectDir}/external/pipeline-Nextflow-config/config/retry/retry.config"

methods {
// Function to ensure that resource requirements don't go beyond
// a maximum limit or below a minimum limit
check_limits = { obj, type ->
if (type == 'memory') {
try {
if (obj.compareTo(params.max_memory as nextflow.util.MemoryUnit) == 1)
return params.max_memory as nextflow.util.MemoryUnit
else if (obj.compareTo(params.min_memory as nextflow.util.MemoryUnit) == -1)
return params.min_memory as nextflow.util.MemoryUnit
else
return obj
} catch (all) {
println " ### WARNING ### Max memory '${params.max_memory}' or min memory '${params.min_memory}' is not valid! Using default value: $obj"
return obj
}
} else if (type == 'time') {
try {
if (obj.compareTo(params.max_time as nextflow.util.Duration) == 1)
return params.max_time as nextflow.util.Duration
else if (obj.compareTo(params.min_time as nextflow.util.Duration) == -1)
return params.min_time as nextflow.util.Duration
else
return obj
} catch (all) {
println " ### WARNING ### Max time '${params.max_time}' or min time '${params.min_time}' is not valid! Using default value: $obj"
return obj
}
} else if (type == 'cpus') {
try {
return Math.max( Math.min( obj, params.max_cpus as int ), params.min_cpus as int )
} catch (all) {
println " ### WARNING ### Max cpus '${params.max_cpus}' or min cpus '${params.min_cpus}' is not valid! Using default value: $obj"
return obj
}
}
}

set_log_output_dir = {
def tz = TimeZone.getTimeZone("UTC")
Expand Down

0 comments on commit 0faae57

Please sign in to comment.