Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Initial release of nf-core/datasync, created with the [nf-core](https://nf-co.re

### `Added`

- [[#74](https://github.com/nf-core/datasync/pull/74)] - Implement warning and `--download` parameter when working with remote directories and SHA checksums ([@delfiterradas](https://github.com/delfiterradas), review by [@atrigila](https://github.com/atrigila) and [@antoniasaracco](https://github.com/antoniasaracco)).
- [[#67](https://github.com/nf-core/datasync/pull/67)] - Copy only files which are successfully validated ([@delfiterradas](https://github.com/delfiterradas), review by [@atrigila](https://github.com/atrigila) and [@antoniasaracco](https://github.com/antoniasaracco)).
- [[#57](https://github.com/nf-core/datasync/pull/57)] - Add nf-tests with edge cases([@atrigila](https://github.com/atrigila), review by [@delfiterradas](https://github.com/delfiterradas)).
- [[#55](https://github.com/nf-core/datasync/pull/55)] - Add subdirectories with sample id to results. Improvements to MultiQC report (width of columns, sections and sub-section headers)colors to multiqc results and display first errors in tables ([@atrigila](https://github.com/atrigila), review by [@delfiterradas](https://github.com/delfiterradas)).
Expand Down
4 changes: 2 additions & 2 deletions assets/schema_input.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@
"checksum_md5": {
"type": "string",
"format": "file-path",
"pattern": "^\\S+\\.(csv|tsv)$",
"pattern": "^\\S+\\.(tsv|txt|md5)$",
"errorMessage": "Checksum_md5 cannot contain spaces"
},
"checksum_sha": {
"type": "string",
"format": "file-path",
"pattern": "^\\S+\\.(csv|tsv)$",
"pattern": "^\\S+\\.(tsv|txt|sha256)$",
"errorMessage": "Checksum_sha cannot contain spaces"
}
},
Expand Down
35 changes: 19 additions & 16 deletions conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,25 @@ process {
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]

withName: 'RCLONE_CHECKSUM' {
tag = { "${meta.id}_${hash}" }
ext.args = {
def base_args = [
'--no-check-certificate',
"--one-way"
]
if (params.download && meta.check_format == 'sha') {
base_args.add("--download")
}
base_args.join(' ')
}
publishDir = [
path: { "${params.outdir}/rclone/checksum/${meta.id}" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
}

withName: 'RCLONE_COPY' {
ext.args = {
def base_args = [
Expand Down Expand Up @@ -58,22 +77,6 @@ process {
]
}

withName: 'RCLONE_CHECKSUM' {
tag = { "${meta.id}_${hash}" }
ext.args = {
def base_args = [
'--no-check-certificate',
"--one-way"
]
base_args.join(' ')
}
publishDir = [
path: { "${params.outdir}/rclone/checksum/${meta.id}" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
}

withName: 'MULTIQC' {
ext.args = {
def args = ['--custom-css-file */multiqc_custom.css']
Expand Down
3 changes: 2 additions & 1 deletion conf/test_full.config
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ params {
input = params.pipelines_testdata_base_path + "test-data/samplesheet_full.csv"

//Rclone options
rclone_config = params.pipelines_testdata_base_path + "test-data/rclone.conf"
rclone_config = params.pipelines_testdata_base_path + "test-data/rclone.conf"
rclone_dry_run = true
download = true
}
1 change: 1 addition & 0 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ params {
rclone_config = null
rclone_dry_run = false
copy_matching_only = false
download = false

// Boilerplate options
outdir = null
Expand Down
6 changes: 6 additions & 0 deletions nextflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@
"description": "Only copy files that matched their provided input checksums.",
"fa_icon": "fas fa-eye",
"help_text": "If set, the pipeline will only copy files that were correctly validated and will skip any file that did not match their input checksum."
},
"download": {
"type": "boolean",
"description": "Download remote files for sha256 checksum verification.",
"fa_icon": "fas fa-eye",
"help_text": "If set, rclone checksum will download remote files for any sample for which a shasum file was provided."
}
}
},
Expand Down
2 changes: 2 additions & 0 deletions tests/edge.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ nextflow_pipeline {
params {
input = "https://raw.githubusercontent.com/nf-core/test-datasets/refs/heads/datasync/test-data/samplesheet_edge.csv"
outdir = "$outputDir"
download = true
}
}

Expand Down Expand Up @@ -41,6 +42,7 @@ nextflow_pipeline {
input = "https://raw.githubusercontent.com/nf-core/test-datasets/refs/heads/datasync/test-data/samplesheet_edge.csv"
outdir = "$outputDir"
copy_matching_only = true
download = true
}
}

Expand Down
12 changes: 10 additions & 2 deletions tests/edge.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"multiqc/multiqc_data/multiqc_data.json",
"multiqc/multiqc_data/multiqc_rclone_check.txt",
"multiqc/multiqc_data/multiqc_rclone_checksum_md5.txt",
"multiqc/multiqc_data/multiqc_rclone_checksum_sha.txt",
"multiqc/multiqc_data/multiqc_samplesheet.txt",
"multiqc/multiqc_data/multiqc_software_versions.txt",
"multiqc/multiqc_data/multiqc_sources.txt",
Expand All @@ -51,6 +52,8 @@
"rclone/checksum/Illumina_annotation_missing/Illumina_annotation_missing.match.txt",
"rclone/checksum/Illumina_annotation_missing/Illumina_annotation_missing.missing_on_dst.txt",
"rclone/checksum/Illumina_annotation_sha_only",
"rclone/checksum/Illumina_annotation_sha_only/Illumina_annotation_sha_only.combined.txt",
"rclone/checksum/Illumina_annotation_sha_only/Illumina_annotation_sha_only.differ.txt",
"rclone/checksum/Illumina_annotation_sha_only/Illumina_annotation_sha_only.exit_code.txt",
"rclone/copy",
"rclone/copy/Illumina_annotation_incorrect-rclone-copy.log",
Expand All @@ -60,10 +63,11 @@
"multiqc_citations.txt:md5,4c806e63a283ec1b7e78cdae3a923d4f",
"multiqc_rclone_check.txt:md5,4b2a6990836593f69e8e81a82c3daf42",
"multiqc_rclone_checksum_md5.txt:md5,cf92203df21f04ddf8315fc606812e0b",
"multiqc_rclone_checksum_sha.txt:md5,8d38305a4ad03c7ea18aa9827d34a396",
"multiqc_samplesheet.txt:md5,bbfc817ff43c49cde14a2b33f46b5ae5"
]
],
"timestamp": "2026-07-28T21:45:08.268780076",
"timestamp": "2026-07-30T20:44:41.242808343",
"meta": {
"nf-test": "0.9.5",
"nextflow": "26.04.1"
Expand Down Expand Up @@ -95,6 +99,7 @@
"multiqc/multiqc_data/multiqc_data.json",
"multiqc/multiqc_data/multiqc_rclone_check.txt",
"multiqc/multiqc_data/multiqc_rclone_checksum_md5.txt",
"multiqc/multiqc_data/multiqc_rclone_checksum_sha.txt",
"multiqc/multiqc_data/multiqc_samplesheet.txt",
"multiqc/multiqc_data/multiqc_software_versions.txt",
"multiqc/multiqc_data/multiqc_sources.txt",
Expand Down Expand Up @@ -124,6 +129,8 @@
"rclone/checksum/Illumina_annotation_missing/Illumina_annotation_missing.match.txt",
"rclone/checksum/Illumina_annotation_missing/Illumina_annotation_missing.missing_on_dst.txt",
"rclone/checksum/Illumina_annotation_sha_only",
"rclone/checksum/Illumina_annotation_sha_only/Illumina_annotation_sha_only.combined.txt",
"rclone/checksum/Illumina_annotation_sha_only/Illumina_annotation_sha_only.differ.txt",
"rclone/checksum/Illumina_annotation_sha_only/Illumina_annotation_sha_only.exit_code.txt",
"rclone/copy",
"rclone/copy/Illumina_annotation_incorrect-rclone-copy.log",
Expand All @@ -134,10 +141,11 @@
"multiqc_citations.txt:md5,4c806e63a283ec1b7e78cdae3a923d4f",
"multiqc_rclone_check.txt:md5,c8f13c10aa4f0e4b356c5c08a9ae7ee9",
"multiqc_rclone_checksum_md5.txt:md5,cf92203df21f04ddf8315fc606812e0b",
"multiqc_rclone_checksum_sha.txt:md5,8d38305a4ad03c7ea18aa9827d34a396",
"multiqc_samplesheet.txt:md5,bbfc817ff43c49cde14a2b33f46b5ae5"
]
],
"timestamp": "2026-07-22T22:01:06.286788462",
"timestamp": "2026-07-30T20:44:11.000298059",
"meta": {
"nf-test": "0.9.5",
"nextflow": "26.04.1"
Expand Down
5 changes: 3 additions & 2 deletions tests/main_full.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"multiqc/multiqc_data/multiqc_data.json",
"multiqc/multiqc_data/multiqc_rclone_check.txt",
"multiqc/multiqc_data/multiqc_rclone_checksum_md5.txt",
"multiqc/multiqc_data/multiqc_rclone_checksum_sha.txt",
"multiqc/multiqc_data/multiqc_samplesheet.txt",
"multiqc/multiqc_data/multiqc_software_versions.txt",
"multiqc/multiqc_data/multiqc_sources.txt",
Expand All @@ -39,7 +40,6 @@
"rclone/checksum",
"rclone/checksum/demultiplex",
"rclone/checksum/demultiplex/demultiplex.combined.txt",
"rclone/checksum/demultiplex/demultiplex.exit_code.txt",
"rclone/checksum/demultiplex/demultiplex.match.txt",
"rclone/copy",
"rclone/copy/demultiplex-rclone-copy.log"
Expand All @@ -48,10 +48,11 @@
"multiqc_citations.txt:md5,4c806e63a283ec1b7e78cdae3a923d4f",
"multiqc_rclone_check.txt:md5,03a73f087a286ec6580aada2a5db2e7c",
"multiqc_rclone_checksum_md5.txt:md5,d7c7dd71a9ff75955dd0e508d1ad9968",
"multiqc_rclone_checksum_sha.txt:md5,03a73f087a286ec6580aada2a5db2e7c",
"multiqc_samplesheet.txt:md5,00788a52d1a014c12ac4ed554b0b44ca"
]
],
"timestamp": "2026-07-22T22:01:43.699965019",
"timestamp": "2026-07-30T20:46:20.306063412",
"meta": {
"nf-test": "0.9.5",
"nextflow": "26.04.1"
Expand Down
9 changes: 9 additions & 0 deletions workflows/datasync.nf
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,15 @@ workflow DATASYNC {
ch_samplesheet = ch_samplesheet.multiMap {
meta, input_path, output_path, md5, sha ->

if (sha && input_path.contains('://')) {
if (params.download) {
log.warn("The `--download` parameter is enabled. RCLONE_CHECKSUM will download remote files. Make sure this is what you want, as it may incur substantial cloud costs !")
} else {
log.error("A SHA checksum file was provided, but `--download` is not enabled. Rclone cannot verify SHA checksums for remote files without downloading them. Enable `--download` to proceed.")
System.exit(1)
}
}

def source = file(input_path)

def source_uri = source.toUriString()
Expand Down
Loading