-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.nf
62 lines (50 loc) · 1.7 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
59
60
61
62
#!/usr/bin/env nextflow
include { addDefaultParamValues; validateParameters; pathCheck } from './lib/groovy/utils.gvy'
// pre-process parameters (defaults and validations)
addDefaultParamValues(params, "${workflow.projectDir}/params.default.yml")
validateParameters(params, "${workflow.projectDir}/conf/parameter_config.yml")
params.run_suffix = params.run_id != null ? "_${params.run_id}" : ''
// load subworkflows after modifying parameters
include { Assembly } from './subworkflows/assembly.nf'
include { GetStatistics } from './subworkflows/statistics.nf'
include { LineageAssesment } from './subworkflows/lineages.nf'
include { GenerateSummaries } from './subworkflows/summaries.nf'
include { GetSoftwareVersions } from './subworkflows/versions.nf'
// transforms parameters in channels and variables
channel
.fromPath(params.sample_data)
.splitCsv(header: true)
.map { row -> [row.sample, pathCheck(row.fastq_file)] }
.set { samples }
sequencing_summary = params.sequencing_summary != null
? pathCheck(params.sequencing_summary)
: file('NOFILE_SEQSUMM')
fast5_dir = params.fast5_directory != null
? pathCheck(params.sequencing_summary)
: file('NOFILE_FAST5')
epicov_template = pathCheck(params.gisaid_template)
samples_file = pathCheck(params.sample_data)
multiqc_config = pathCheck(params.multiqc_config)
workflow {
Assembly(
samples,
fast5_dir,
sequencing_summary
)
GetStatistics(
Assembly.out.bam,
multiqc_config
)
LineageAssesment(
Assembly.out.consensus,
)
GenerateSummaries(
samples_file,
Assembly.out.consensus,
Assembly.out.vcf,
GetStatistics.out.coverage,
LineageAssesment.out.lineages,
epicov_template
)
GetSoftwareVersions()
}