Skip to content

Commit 24f4c36

Browse files
committed
Update workflow inputs/outputs based on 25.04
Signed-off-by: Ben Sherman <[email protected]>
1 parent 0b52c81 commit 24f4c36

File tree

3 files changed

+34
-42
lines changed

3 files changed

+34
-42
lines changed

main.nf

Lines changed: 24 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -34,37 +34,21 @@ include { Sample } from './workflows/sra'
3434
params {
3535

3636
// TODO: declare as Set<SraId> and construct SraId with isSraId()
37-
input: Set<String> {
38-
description 'Set of SRA/ENA/GEO/DDBJ identifiers to download their associated metadata and FastQ files'
39-
}
37+
// Set of SRA/ENA/GEO/DDBJ identifiers to download their associated metadata and FastQ files
38+
input: Set<String>
4039

4140
// TODO: declare as EnaMetadataFields and construct with sraCheckENAMetadataFields()
42-
ena_metadata_fields: String {
43-
description "Comma-separated list of ENA metadata fields to fetch before downloading data."
44-
help "The default list of fields used by the pipeline can be found at the top of the [`bin/sra_ids_to_runinfo.py`](https://github.com/nf-core/fetchngs/blob/master/bin/sra_ids_to_runinfo.py) script within the pipeline repo. This pipeline requires a minimal set of fields to download FastQ files i.e. `'run_accession,experiment_accession,library_layout,fastq_ftp,fastq_md5'`. Full list of accepted metadata fields can be obtained from the [ENA API](https://www.ebi.ac.uk/ena/portal/api/returnFields?dataPortal=ena&format=tsv&result=read_run)."
45-
icon 'fas fa-columns'
46-
defaultValue ''
47-
}
48-
49-
download_method: DownloadMethod {
50-
description "Method to download FastQ files. Available options are 'aspera', 'ftp' or 'sratools'. Default is 'ftp'."
51-
help 'FTP and Aspera CLI download FastQ files directly from the ENA FTP whereas sratools uses sra-tools to download *.sra files and convert to FastQ.'
52-
icon 'fas fa-download'
53-
defaultValue 'ftp'
54-
}
41+
// Comma-separated list of ENA metadata fields to fetch before downloading data.
42+
ena_metadata_fields: String = ''
5543

56-
skip_fastq_download: boolean {
57-
description "Only download metadata for public data database ids and don't download the FastQ files."
58-
icon 'fas fa-fast-forward'
59-
}
44+
// Method to download FastQ files. Available options are 'aspera', 'ftp' or 'sratools'. Default is 'ftp'.
45+
download_method: DownloadMethod = 'ftp'
6046

61-
dbgap_key: Path? {
62-
description 'dbGaP repository key.'
63-
help 'Path to a JWT cart file used to access protected dbGAP data on SRA using the sra-toolkit. Users with granted access to controlled data can download the JWT cart file for the study from the SRA Run Selector upon logging in. The JWT file can only be used on cloud platforms and is valid for 1 hour upon creation.'
64-
icon 'fas fa-address-card'
65-
}
47+
// Only download metadata for public data database ids and don't download the FastQ files.
48+
skip_fastq_download: boolean = false
6649

67-
// TODO: ...
50+
// dbGaP repository key.
51+
dbgap_key: Path? = null
6852

6953
}
7054

@@ -92,7 +76,7 @@ workflow {
9276
//
9377
// WORKFLOW: Run primary workflows for the pipeline
9478
//
95-
samples = SRA (
79+
sra = SRA (
9680
Channel.fromList(params.input),
9781
SraParams(
9882
params.ena_metadata_fields,
@@ -120,8 +104,9 @@ workflow {
120104
)
121105

122106
publish:
123-
samples >> 'samples'
124-
versions >> 'versions'
107+
samples = sra.samples
108+
metadata = sra.metadata
109+
versions = versions
125110
}
126111

127112
/*
@@ -131,22 +116,23 @@ workflow {
131116
*/
132117

133118
output {
134-
samples: Sample {
135-
path { _sample ->
136-
def dirs = [
137-
'fastq': 'fastq',
138-
'md5': 'fastq/md5'
139-
]
140-
return { file -> "${dirs[file.ext]}/${file.baseName}" }
119+
samples: Channel<Sample> {
120+
path { sample ->
121+
sample.fastq_1 >> 'fastq/'
122+
sample.fastq_2 >> 'fastq/'
123+
sample.md5_1 >> 'fastq/md5/'
124+
sample.md5_2 >> 'fastq/md5/'
141125
}
142126
index {
143127
path 'samplesheet/samplesheet.json'
144-
sort { sample -> sample.id }
145128
}
146129
}
147130

131+
metadata {
132+
path 'metadata'
133+
}
134+
148135
versions: Map<String,Map<String,String>> {
149-
path '.'
150136
index {
151137
path 'nf_core_fetchngs_software_mqc_versions.yml'
152138
}

nextflow_schema.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,12 @@
193193
{
194194
"$ref": "#/definitions/input_options"
195195
},
196+
{
197+
"$ref": "#/definitions/institutional_config_options"
198+
},
199+
{
200+
"$ref": "#/definitions/max_job_request_options"
201+
},
196202
{
197203
"$ref": "#/definitions/generic_options"
198204
}

workflows/sra/main.nf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,13 @@ workflow SRA {
8989
new Sample(meta.id, out.fastq_1, out.fastq_2, out.md5_1, out.md5_2)
9090
} // Channel<Sample>
9191

92-
emit:
93-
ftp_samples
92+
samples = ftp_samples
9493
.mix(sratools_samples)
9594
.mix(aspera_samples)
9695

97-
publish:
98-
runinfo_ftp >> 'metadata'
96+
emit:
97+
samples = samples
98+
metadata = runinfo_ftp
9999
}
100100

101101
/*

0 commit comments

Comments
 (0)