Skip to content

Commit ccf54ae

Browse files
authored
Merge branch 'master' into reannz_mahuika
2 parents d5d6bd3 + e6a60e5 commit ccf54ae

File tree

7 files changed

+104
-97
lines changed

7 files changed

+104
-97
lines changed

.github/workflows/main.yml

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
name: Configs tests
2-
3-
on: [pull_request, push]
2+
on:
3+
pull_request:
4+
branches:
5+
- "*"
6+
push:
7+
branches:
8+
- master
49

510
# Cancel if a newer run is started
611
concurrency:
@@ -17,15 +22,22 @@ jobs:
1722
run: python ${GITHUB_WORKSPACE}/bin/cchecker.py ${GITHUB_WORKSPACE}/nfcore_custom.config ${GITHUB_WORKSPACE}/.github/workflows/main.yml
1823

1924
check_nextflow_config:
20-
runs-on: ubuntu-latest
2125
name: Check if nextflow config runs in repository root
26+
runs-on: ubuntu-latest
27+
strategy:
28+
fail-fast: false
29+
matrix:
30+
NXF_VER:
31+
- 25.04.0
32+
- latest-everything
2233
steps:
23-
- uses: actions/checkout@v4
24-
- name: Install Nextflow
25-
run: |
26-
wget -qO- get.nextflow.io | bash
27-
sudo mv nextflow /usr/local/bin/
28-
- run: nextflow config -show-profiles ${GITHUB_WORKSPACE}
34+
- uses: actions/checkout@v4
35+
- name: Set up Nextflow
36+
uses: nf-core/setup-nextflow@v2
37+
with:
38+
version: ${{ matrix.NXF_VER }}
39+
- run: nextflow config -show-profiles ${GITHUB_WORKSPACE}
40+
- run: nextflow lint ${GITHUB_WORKSPACE}
2941

3042
profile_test:
3143
runs-on: ubuntu-latest

conf/cfc.config

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -38,21 +38,24 @@ params {
3838
* in your config, or use the
3939
* `-plugins nf-co2footprint@<VERSION>` parameter in your nextflow call.
4040
*/
41-
co2footprint {
42-
String co2Timestamp = new java.util.Date().format( 'yyyy-MM-dd_HH-mm-ss')
43-
44-
// Determine timestamp suffix
45-
String timestampSuffix = params.get('trace_report_suffix') ?: (this.hasProperty('trace_timestamp') ? this.trace_timestamp : co2Timestamp)
41+
params {
42+
// Uses nf-core's `trace_report_suffix`
43+
trace_report_suffix = new java.util.Date().format('yyyy-MM-dd_HH-mm-ss')
44+
}
4645

47-
// File parameters
48-
if (params.containsKey('outdir')) {
49-
String infoDir = "${params.outdir}/pipeline_info"
50-
traceFile = "${infoDir}/co2footprint_trace_${timestampSuffix}.txt"
51-
reportFile = "${infoDir}/co2footprint_report_${timestampSuffix}.html"
52-
summaryFile = "${infoDir}/co2footprint_summary_${timestampSuffix}.txt"
46+
co2footprint {
47+
trace {
48+
file = "${params.outdir}/pipeline_info/co2footprint_trace_${params.trace_report_suffix}.txt"
49+
}
50+
summary {
51+
file = "${params.outdir}/pipeline_info/co2footprint_summary_${params.trace_report_suffix}.txt"
52+
}
53+
report {
54+
file = "${params.outdir}/pipeline_info/co2footprint_report_${params.trace_report_suffix}.html"
5355
}
5456

5557
// Standard parameters
5658
location = 'DE'
5759
pue = 1.3
5860
}
61+

conf/cfc_dev.config

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,20 @@ params {
3737
* in your config, or use the
3838
* `-plugins nf-co2footprint@<VERSION>` parameter in your nextflow call.
3939
*/
40-
co2footprint {
41-
String co2Timestamp = new java.util.Date().format( 'yyyy-MM-dd_HH-mm-ss')
42-
43-
// Determine timestamp suffix
44-
String timestampSuffix = params.get('trace_report_suffix') ?: (this.hasProperty('trace_timestamp') ? this.trace_timestamp : co2Timestamp)
40+
params {
41+
// Uses nf-core's `trace_report_suffix`
42+
trace_report_suffix = new java.util.Date().format('yyyy-MM-dd_HH-mm-ss')
43+
}
4544

46-
// File parameters
47-
if (params.containsKey('outdir')) {
48-
String infoDir = "${params.outdir}/pipeline_info"
49-
traceFile = "${infoDir}/co2footprint_trace_${timestampSuffix}.txt"
50-
reportFile = "${infoDir}/co2footprint_report_${timestampSuffix}.html"
51-
summaryFile = "${infoDir}/co2footprint_summary_${timestampSuffix}.txt"
45+
co2footprint {
46+
trace {
47+
file = "${params.outdir}/pipeline_info/co2footprint_trace_${params.trace_report_suffix}.txt"
48+
}
49+
summary {
50+
file = "${params.outdir}/pipeline_info/co2footprint_summary_${params.trace_report_suffix}.txt"
51+
}
52+
report {
53+
file = "${params.outdir}/pipeline_info/co2footprint_report_${params.trace_report_suffix}.html"
5254
}
5355

5456
// Standard parameters

conf/cheaha.config

Lines changed: 37 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
1+
// Prevent schemas warnings for profile parameters
2+
validation {
3+
ignoreParams = [
4+
'cheaha_scratch_dir'
5+
]
6+
}
7+
18
// Define the Scratch directory
2-
def scratch_dir = System.getenv("USER_SCRATCH") ?: "/tmp"
9+
params.cheaha_scratch_dir = env('USER_SCRATCH') ?: '/tmp'
310

411
params {
512
config_profile_name = 'cheaha'
@@ -9,40 +16,14 @@ params {
916
}
1017

1118
env {
12-
TMPDIR="$scratch_dir"
13-
SINGULARITY_TMPDIR="$scratch_dir"
19+
TMPDIR=params.cheaha_scratch_dir
20+
SINGULARITY_TMPDIR=params.cheaha_scratch_dir
1421
}
1522

1623
singularity {
1724
enabled = true
1825
autoMounts = true
19-
runOptions = "--contain --workdir $scratch_dir -B /scratch"
20-
}
21-
22-
def getQueues = { time, memory ->
23-
def queue_list = ["long"]
24-
25-
if (time <= 2.h) {
26-
queue_list.add("express")
27-
}
28-
29-
if (time <= 12.h) {
30-
queue_list.add("short")
31-
}
32-
33-
if (time <= 50.h) {
34-
queue_list.add("medium")
35-
}
36-
37-
if (memory >= 300.GB) {
38-
queue_list.add("largemem-long")
39-
40-
if (time <= 50.h) {
41-
queue_list.add("largemem")
42-
}
43-
}
44-
45-
return queue_list.join(",")
26+
runOptions = "--contain --workdir ${params.cheaha_scratch_dir} -B /scratch"
4627
}
4728

4829
process {
@@ -54,5 +35,29 @@ process {
5435
executor = 'slurm'
5536
maxRetries = 3
5637
beforeScript = 'module load Singularity/3.5.2-GCC-5.4.0-2.26'
57-
queue = { getQueues( task.time, task.memory ) }
58-
}
38+
queue = {
39+
def queue_list = ["long"]
40+
41+
if (task.time <= 2.h) {
42+
queue_list.add("express")
43+
}
44+
45+
if (task.time <= 12.h) {
46+
queue_list.add("short")
47+
}
48+
49+
if (task.time <= 50.h) {
50+
queue_list.add("medium")
51+
}
52+
53+
if (task.memory >= 300.GB) {
54+
queue_list.add("largemem-long")
55+
56+
if (task.time <= 50.h) {
57+
queue_list.add("largemem")
58+
}
59+
}
60+
61+
return queue_list.join(",")
62+
}
63+
}

conf/m3c.config

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -58,18 +58,20 @@ params {
5858
* in your config, or use the
5959
* `-plugins nf-co2footprint@<VERSION>` parameter in your nextflow call.
6060
*/
61-
co2footprint {
62-
String co2Timestamp = new java.util.Date().format( 'yyyy-MM-dd_HH-mm-ss')
63-
64-
// Determine timestamp suffix
65-
String timestampSuffix = params.get('trace_report_suffix') ?: (this.hasProperty('trace_timestamp') ? this.trace_timestamp : co2Timestamp)
61+
params {
62+
// Uses nf-core's `trace_report_suffix`
63+
trace_report_suffix = new java.util.Date().format('yyyy-MM-dd_HH-mm-ss')
64+
}
6665

67-
// File parameters
68-
if (params.containsKey('outdir')) {
69-
String infoDir = "${params.outdir}/pipeline_info"
70-
traceFile = "${infoDir}/co2footprint_trace_${timestampSuffix}.txt"
71-
reportFile = "${infoDir}/co2footprint_report_${timestampSuffix}.html"
72-
summaryFile = "${infoDir}/co2footprint_summary_${timestampSuffix}.txt"
66+
co2footprint {
67+
trace {
68+
file = "${params.outdir}/pipeline_info/co2footprint_trace_${params.trace_report_suffix}.txt"
69+
}
70+
summary {
71+
file = "${params.outdir}/pipeline_info/co2footprint_summary_${params.trace_report_suffix}.txt"
72+
}
73+
report {
74+
file = "${params.outdir}/pipeline_info/co2footprint_report_${params.trace_report_suffix}.html"
7375
}
7476

7577
// Standard parameters

conf/pipeline/sarek/cfc.config

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,34 +9,20 @@ params {
99
// Specific nf-core/sarek process configuration
1010
process {
1111
withName:'StrelkaSingle|Strelka|StrelkaBP|MantaSingle|Manta' {
12-
cpus = { check_resource( 20 * task.attempt) }
13-
memory = { check_resource( 59.GB * task.attempt) }
12+
cpus = { 20 * task.attempt }
13+
memory = { 59.GB * task.attempt }
1414
}
1515
withName:'MSIsensor_scan|MSIsensor_msi' {
16-
memory = { check_resource( 55.GB * task.attempt ) }
16+
memory = { 55.GB * task.attempt }
1717

1818
}
1919
withName:BamQC {
20-
memory = { check_resource( 372.GB * task.attempt) }
20+
memory = { 372.GB * task.attempt }
2121
}
2222

2323
withName:MapReads{
24-
cpus = { check_resource( 20 * task.attempt ) }
25-
memory = { check_resource( 59.GB * task.attempt) }
24+
cpus = { 20 * task.attempt }
25+
memory = { 59.GB * task.attempt }
2626
}
2727
}
2828

29-
def check_resource(obj) {
30-
try {
31-
if (obj.getClass() == nextflow.util.MemoryUnit && obj.compareTo(params.max_memory as nextflow.util.MemoryUnit) == 1)
32-
return params.max_memory as nextflow.util.MemoryUnit
33-
else if (obj.getClass() == nextflow.util.Duration && obj.compareTo(params.max_time as nextflow.util.Duration) == 1)
34-
return params.max_time as nextflow.util.Duration
35-
else if (obj.getClass() == java.lang.Integer)
36-
return Math.min(obj, params.max_cpus as int)
37-
else
38-
return obj
39-
} catch (all) {
40-
println " ### ERROR ### Max params max_memory:'${params.max_memory}', max_time:'${params.max_time}' or max_cpus:'${params.max_cpus}' is not valid! Using default value: $obj"
41-
}
42-
}

pipeline/sarek.config

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,4 @@ profiles {
3030
munin {
3131
includeConfig "${params.custom_config_base}/conf/pipeline/sarek/munin.config"
3232
}
33-
uppmax {
34-
includeConfig "${params.custom_config_base}/conf/pipeline/sarek/uppmax.config"
35-
}
3633
}

0 commit comments

Comments
 (0)