Skip to content

Commit 0537a1e

Browse files
authored
Merge pull request #181 from LouisLeNezet/co2_footprint
Add nf-co2 plugin and configuration
2 parents b93b876 + e1bc23b commit 0537a1e

File tree

5 files changed

+32
-4
lines changed

5 files changed

+32
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88
### `Added`
99

1010
- [#175](https://github.com/nf-core/phaseimpute/pull/175) - Add support for all input files in `.json` or `.yaml` format.
11+
- [#181](https://github.com/nf-core/phaseimpute/pull/181) - Add nf-co2footprint plugin to the config file.
1112

1213
### `Changed`
1314

docs/output.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,8 @@ Results generated by MultiQC collate pipeline QC from supported tools e.g. FastQ
210210
- `pipeline_info/`
211211
- Reports generated by Nextflow: `execution_report.html`, `execution_timeline.html`, `execution_trace.txt` and `pipeline_dag.dot`/`pipeline_dag.svg`.
212212
- Reports generated by the pipeline: `pipeline_report.html`, `pipeline_report.txt` and `software_versions.yml`. The `pipeline_report*` files will only be present if the `--email` / `--email_on_fail` parameter's are used when running the pipeline.
213-
- Reformatted samplesheet files used as input to the pipeline: `samplesheet.valid.csv`.
214213
- Parameters used by the pipeline run: `params.json`.
214+
- Report generated by [`nf-co2footprint`](https://nextflow-io.github.io/nf-co2footprint/): `co2footprint_trace.txt`, `co2footprint_summary.txt` and `co2footprint_report`.html.
215215

216216
</details>
217217

nextflow.config

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,14 @@ manifest {
339339
// Nextflow plugins
340340
plugins {
341341
id '[email protected]' // Validation of pipeline parameters and creation of an input channel from a sample sheet
342+
id '[email protected]' // Calculate the carbon footprint of a Nextflow pipeline
343+
}
344+
345+
// CO2 footprint calculation
346+
co2footprint {
347+
traceFile = "${params.outdir}/pipeline_info/co2footprint_trace_${params.trace_report_suffix}.txt"
348+
reportFile = "${params.outdir}/pipeline_info/co2footprint_report_${params.trace_report_suffix}.html"
349+
summaryFile = "${params.outdir}/pipeline_info/co2footprint_summary_${params.trace_report_suffix}.txt"
342350
}
343351

344352
validation {

workflows/phaseimpute/tests/main.nf.test

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,12 @@ nextflow_pipeline {
2525
.collect { getRecursiveFileNames(it, outputDir) }
2626
.flatten(),
2727
path("$outputDir/imputation/glimpse1/concat/all.batch0.glimpse1.vcf.gz").vcf.summary.replaceAll(", phasedAutodetect=(false|true)", ""),
28-
path("$outputDir/imputation/glimpse1/concat/all.batch0.glimpse1.vcf.gz").vcf.header.getGenotypeSamples().sort()
28+
path("$outputDir/imputation/glimpse1/concat/all.batch0.glimpse1.vcf.gz").vcf.header.getGenotypeSamples().sort(),
29+
path("${outputDir}/pipeline_info/")
30+
.list()
31+
.collect { getRecursiveFileNames(it, outputDir) }
32+
.flatten()
33+
.collect { removeTimestamp(it) }
2934
).match()
3035
}
3136
)
@@ -299,3 +304,7 @@ def getRecursiveFileNames(fileOrDir, outputDir) {
299304
}
300305
return fileOrDir.toString().replace("${outputDir}/", "")
301306
}
307+
308+
def removeTimestamp(filename) {
309+
filename.replaceAll(/_\d{4}-\d{2}-\d{2}_\d{2}-\d{2}-\d{2}/, "")
310+
}

workflows/phaseimpute/tests/main.nf.test.snap

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -408,13 +408,23 @@
408408
"NA12878",
409409
"NA19401",
410410
"NA20359"
411+
],
412+
[
413+
"pipeline_info/co2footprint_report.html",
414+
"pipeline_info/co2footprint_summary.txt",
415+
"pipeline_info/co2footprint_trace.txt",
416+
"pipeline_info/execution_report.html",
417+
"pipeline_info/execution_timeline.html",
418+
"pipeline_info/nf_core_pipeline_software_mqc_versions.yml",
419+
"pipeline_info/params.json",
420+
"pipeline_info/pipeline_dag.html"
411421
]
412422
],
413423
"meta": {
414-
"nf-test": "0.9.2",
424+
"nf-test": "0.9.1",
415425
"nextflow": "24.10.1"
416426
},
417-
"timestamp": "2024-11-27T18:11:44.567996758"
427+
"timestamp": "2025-02-20T09:18:56.431336345"
418428
},
419429
"Check test_dog": {
420430
"content": [

0 commit comments

Comments
 (0)