-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.nf
More file actions
82 lines (63 loc) · 2.51 KB
/
main.nf
File metadata and controls
82 lines (63 loc) · 2.51 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/usr/bin/env nextflow
nextflow.enable.dsl = 2
/*
Import modules and workflows
*/
include { guppyplex } from './modules/guppyplex.nf'
include { artic } from './modules/artic.nf'
include { coverage } from './modules/coverage.nf'
include { proovframe } from './modules/proovframe.nf'
include { concatenate_consensus } from './modules/concatenate_consensus.nf'
include { alignment } from './modules/align_corr_consensus_with_ref.nf'
include { nextclade } from './modules/nextclade.nf'
include { pangolin } from './modules/pangolin.nf'
workflow {
def color_purple = '\u001B[35m'
def color_green = '\u001B[32m'
def color_red = '\u001B[31m'
def color_reset = '\u001B[0m'
log.info """
${color_purple}
SARS-CoV-2 Surveilance [v1.0.1]${color_reset}
"""
// Create channel from sample sheet
if (params.metadata == null) {
error "Please provide a samplesheet XLSX file with --samplesheet (i.e. path to samplesheet-artic.csv)"
}
// Check if RunID is provided
if (params.runID == null ) {
error "Please provide a RunID using --runID (numeric value)"
}
// Check if minionID is provided
if (params.dataDir == null) {
error "Please provide full path to directory containing ONT results using --dataDir"
}
// Create the data channel from the metadata
samples_ch = Channel
.fromPath(params.metadata)
.splitCsv(header: true)
/// Run Artic workflows
guppyplex( samples_ch )
artic( guppyplex.out.guppyplex_out )
/// Run proofframe to correct frameshifts
proovframe( artic.out.artic_consensus )
proovframe.out.proovframe_out
.map { sampleID, fasta, tsv -> fasta } // Extract only the FASTA files
.collectFile(name: 'concatenated_consensus.fasta', newLine: true)
.set { corr_consensus }
/// Align consensus genomes with reference
alignment( corr_consensus )
nextclade( corr_consensus )
pangolin( corr_consensus )
/// Calculate coverage and plot coverage mapping
coverage( artic.out.artic_coverage )
/// Concatenate the outputs
coverage.out.coverage_res
.collectFile(
name: 'coverage_mean.csv',
keepHeader: true,
skip: 1,
storeDir: "${params.outDir}"
)
///
}