forked from seqeralabs/gatk4-germline-snps-indels
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.nf
More file actions
65 lines (48 loc) · 2.33 KB
/
Copy pathmain.nf
File metadata and controls
65 lines (48 loc) · 2.33 KB
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
63
64
nextflow.enable.dsl = 2
//================================================================================
// Derive file names and location from the params.yaml
//================================================================================
fastq_files_list = file(params.input_fofn)
//================================================================================
// Include sub-workflows and (soft) override workflow-level parameters
//================================================================================
include { FORMAT_CONVERSION } from "./workflows/format_conversion/format_conversion.nf"
include { PREPROCESSING_MAPPING } from "./workflows/preprocessing_mapping/preprocessing_mapping.nf"
include { QUALITY_RECALIBRATION } from "./workflows/quality_recalibration/quality_recalibration.nf"
include { VARIANT_DISCOVERY } from "./workflows/variant_discovery/variant_discovery.nf"
//================================================================================
// Prepare channels
//================================================================================
// Convert input manifest to a channel.
fastq_params_ch = channel.fromPath(fastq_files_list)
.splitText(keepHeader: false)
.map { line ->
cols = line.tokenize('\t')
[
file(cols[2]), // fastq_1
file(cols[3]), // fastq_2
cols[6], // run_date
cols[1], // sample_name
cols[4], // library_name
cols[7], // platform_name
cols[5], // platform_name
cols[0], // readgroup_name
cols[8] // sequencing_center
]
}
//================================================================================
// Main workflow
//================================================================================
workflow {
FORMAT_CONVERSION({ fastq_params_ch })
PREPROCESSING_MAPPING(FORMAT_CONVERSION.out)
QUALITY_RECALIBRATION(PREPROCESSING_MAPPING.out)
VARIANT_DISCOVERY(QUALITY_RECALIBRATION.out)
VARIANT_DISCOVERY.out
.map {
sampleId, vcfFile -> "${sampleId}\ts3://${vcfFile}"
}
.collectFile(
name: 'merged_vcfs.tsv', newLine: true, storeDir: "${params.outdir}"
)
}