-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.nf
117 lines (98 loc) · 4.55 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
#!/usr/bin/env nextflow
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
folkehelseinstituttet/viralseq
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Github : https://github.com/folkehelseinstituttet/viralseq
----------------------------------------------------------------------------------------
*/
nextflow.enable.dsl = 2
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
GENOME PARAMETER VALUES
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
def primer_set = ''
def primer_set_version = 0
if (params.platform == 'nanopore') {
primer_set = params.primer_set
primer_set_version = params.primer_set_version
params.artic_scheme = WorkflowMain.getGenomeAttribute(params, 'scheme', log, primer_set, primer_set_version)
}
params.fasta = WorkflowMain.getGenomeAttribute(params, 'fasta' , log, primer_set, primer_set_version)
params.gff = WorkflowMain.getGenomeAttribute(params, 'gff' , log, primer_set, primer_set_version)
params.bowtie2_index = WorkflowMain.getGenomeAttribute(params, 'bowtie2' , log, primer_set, primer_set_version)
params.primer_bed = WorkflowMain.getGenomeAttribute(params, 'primer_bed', log, primer_set, primer_set_version)
params.nextclade_dataset = WorkflowMain.getGenomeAttribute(params, 'nextclade_dataset' , log, primer_set, primer_set_version)
params.nextclade_dataset_name = WorkflowMain.getGenomeAttribute(params, 'nextclade_dataset_name' , log, primer_set, primer_set_version)
params.nextclade_dataset_reference = WorkflowMain.getGenomeAttribute(params, 'nextclade_dataset_reference', log, primer_set, primer_set_version)
params.nextclade_dataset_tag = WorkflowMain.getGenomeAttribute(params, 'nextclade_dataset_tag' , log, primer_set, primer_set_version)
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
VALIDATE & PRINT PARAMETER SUMMARY
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
include { validateParameters; paramsHelp } from 'plugin/nf-validation'
// Print help message if needed
if (params.help) {
def logo = NfcoreTemplate.logo(workflow, params.monochrome_logs)
def citation = '\n' + WorkflowMain.citation(workflow) + '\n'
def String command = "nextflow run ${workflow.manifest.name} --input samplesheet.csv --genome GRCh37 -profile docker"
log.info logo + paramsHelp(command) + citation + NfcoreTemplate.dashedLine(params.monochrome_logs)
System.exit(0)
}
// Validate input parameters
if (params.validate_params) {
validateParameters()
}
WorkflowMain.initialise(workflow, params, log)
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
NAMED WORKFLOW FOR PIPELINE
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
if (params.platform == 'illumina' & params.agens == 'HCV') {
include { HCV_ILLUMINA } from './workflows/hcv_illumina'
} else if (params.platform == 'illumina' & params.agens == 'ROV') {
include { ROV_ILLUMINA } from './workflows/rov_illumina'
} else if (params.platform == 'nanopore' & params.agens == 'HBV') {
include { HBV_NANOPORE } from './workflows/hbv_nanopore'
}
//
// WORKFLOW: Run main folkehelseinstituttet/viralseq analysis pipeline
//
workflow VIRALSEQ {
//
// WORKFLOW: HCV genome assembly and analysis from Illumina capture data
//
if (params.platform == 'illumina' & params.agens == 'HCV') {
HCV_ILLUMINA ()
//
// WORKFLOW: ROV genome assembly and analysis from Illumina data
//
} else if (params.platform == 'illumina' & params.agens == 'ROV') {
ROV_ILLUMINA ()
//
// WORKFLOW: HBV genome assembly and analysis from Gunther PCR and Nanopore data
//
} else if (params.platform == 'nanopore' & params.agens == 'HBV') {
HBV_NANOPORE ()
}
}
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
RUN ALL WORKFLOWS
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
//
// WORKFLOW: Execute a single named workflow for the pipeline
// See: https://github.com/nf-core/rnaseq/issues/619
//
workflow {
VIRALSEQ ()
}
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
THE END
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/