-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.nf
58 lines (41 loc) · 1.25 KB
/
main.nf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/usr/bin/env nextflow
process IRIDA_LINKER {
publishDir "${params.outdir}", mode: 'copy', enabled: params.merge ? false : true
container 'community.wave.seqera.io/library/python_requests:fcde07da6fa98799'
conda 'conda-forge::python=3.10 conda-forge::requests'
tag "ProjectID: ${project_id}"
input:
val(project_id)
output:
path "*_samples.csv", emit: csv
script:
"""
iridaLinker.py \
--project ${project_id} \
--email ${params.email} \
--output .
"""
}
process MERGE_SAMPLE_SHEET {
publishDir "${params.outdir}", mode: 'copy', enabled: params.merge ? true : false
tag {"Merging sample sheet"}
container 'community.wave.seqera.io/library/csvtk:22cb155b42ced0de'
conda 'bioconda::csvtk=0.31.0'
cpus 1
input:
path csv_files
output:
path("sample_sheet.csv"), emit: csv
script:
"""
csvtk concat ${csv_files} > sample_sheet.csv
"""
}
def projectList = params.project.toString().contains(',') ? params.project.tokenize(',') : [params.project]
workflow {
ch_input = Channel.of(projectList).flatten()
IRIDA_LINKER(ch_input)
if (params.merge) {
MERGE_SAMPLE_SHEET(IRIDA_LINKER.out.csv.collect())
}
}