-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.nf
37 lines (29 loc) · 1.11 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
#!/usr/bin/env nextflow
nextflow.preview.topic = true
include { validateParameters ; samplesheetToList } from 'plugin/nf-schema'
include { BasecallingAndDemux } from './subworkflows/basecalling_demux.nf'
include { QualityCheck } from './subworkflows/quality_check.nf'
include { GenerateReports } from './subworkflows/reports.nf'
// validate and prepare input channels
workflow {
validateParameters()
data_dir = file(params.data_dir, type: 'dir', checkIfExists: true)
multiqc_config = file("${workflow.projectDir}/tool_conf/multiqc_config.yaml", checkIfExists: true)
if (params.sample_data) {
samples = channel
.fromList(samplesheetToList(params.sample_data, "assets/samples_data_schema.json"))
.map { row -> [[id: row[1], barcode: row[0]]] }
}
else {
samples = channel.empty()
}
BasecallingAndDemux(samples, data_dir)
QualityCheck(BasecallingAndDemux.out.sequences)
GenerateReports(
QualityCheck.out.software_reports,
BasecallingAndDemux.out.sequencing_summary,
samples.map { row -> row[0].barcode }.collect().ifEmpty { [] },
data_dir,
multiqc_config,
)
}