forked from nf-core/pacvar
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.nf
More file actions
139 lines (123 loc) · 5.07 KB
/
main.nf
File metadata and controls
139 lines (123 loc) · 5.07 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
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
#!/usr/bin/env nextflow
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
nf-core/pacvar
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Github : https://github.com/nf-core/pacvar
Website: https://nf-co.re/pacvar
Slack : https://nfcore.slack.com/channels/pacvar
----------------------------------------------------------------------------------------
*/
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
IMPORT FUNCTIONS / MODULES / SUBWORKFLOWS / WORKFLOWS
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
include { PACVAR } from './workflows/pacvar/'
include { PIPELINE_INITIALISATION } from './subworkflows/local/utils_nfcore_pacvar_pipeline'
include { PIPELINE_COMPLETION } from './subworkflows/local/utils_nfcore_pacvar_pipeline'
include { getGenomeAttribute } from './subworkflows/local/utils_nfcore_pacvar_pipeline'
params.fasta = getGenomeAttribute('fasta')
params.fasta_fai = getGenomeAttribute('fasta_fai')
params.dbsnp = getGenomeAttribute('dbsnp')
params.dbsnp_tbi = getGenomeAttribute('dbsnp_tbi')
params.dict = getGenomeAttribute('dict')
//
// WORKFLOW: Run main analysis pipeline depending on type of input
//
workflow NFCORE_PACVAR {
take:
samplesheet // channel: samplesheet read in from --input
fasta // channel: [mandatory] fasta
fasta_fai // channel: [mandatory] fasta_fai
dict // channel: [mandatory] dict
dbsnp // channel: [mandatory] dbsnp
dbsnp_tbi // channel: [mandatory] dbsnp_tbi
intervals // channel: [mandatory] intervals
repeat_id // channel: [mandatory] id
karyotype // channel: [mandatory] karyotype
expected_cn // channel: [mandatory] expected_cn
cnv_excluded_regions // channel: [mandatory] cnv_excluded_regions
main:
//
// WORKFLOW: Run pipeline
//
PACVAR (
samplesheet,
fasta,
fasta_fai,
dict,
dbsnp,
dbsnp_tbi,
intervals,
repeat_id,
karyotype,
expected_cn,
cnv_excluded_regions
)
emit:
multiqc_report = PACVAR.out.multiqc_report // channel: /path/to/multiqc_report.html
}
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
RUN MAIN WORKFLOW
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
workflow {
main:
// Initialize genomic attibutes with associated meta data maps as channels
fasta = params.fasta ? Channel.fromPath(params.fasta).map{ it -> [ [id:it.baseName], it ] }.collect() : Channel.empty()
fasta_fai = params.fasta_fai ? Channel.fromPath(params.fasta_fai).map{ it -> [ [id:it.baseName], it ] }.collect() : Channel.empty()
dict = params.dict ? Channel.fromPath(params.dict).map{ it -> [ [id:it.baseName], it ] }.collect() : Channel.empty()
dbsnp = params.dbsnp ? Channel.fromPath(params.dbsnp).collect() : Channel.value([])
dbsnp_tbi = params.dbsnp_tbi ? Channel.fromPath(params.dbsnp_tbi).collect() : Channel.value([])
intervals = params.intervals ? Channel.fromPath(params.intervals).map{ it -> [ [id:it.baseName], it ] }.collect() : Channel.value([[],[]])
repeat_id = params.repeat_id ? Channel.fromPath(params.repeat_id).map{ it -> [ [id:it.baseName], it.baseName ] }.collect() : Channel.value([])
karyotype = params.karyotype ? Channel.fromPath(params.karyotype).map{ it -> [ [id:it.baseName], it.baseName ] }.collect() : Channel.value([])
expected_cn = params.expected_cn ? Channel.fromPath(params.expected_cn).collect() : Channel.value([])
cnv_excluded_regions = params.cnv_excluded_regions ? Channel.fromPath(params.cnv_excluded_regions).collect() : Channel.value([])
//
// SUBWORKFLOW: Run initialisation tasks
//
PIPELINE_INITIALISATION (
params.version,
params.validate_params,
params.monochrome_logs,
args,
params.outdir,
params.input
)
//
// WORKFLOW: Run main workflow
//
NFCORE_PACVAR (
PIPELINE_INITIALISATION.out.samplesheet,
fasta,
fasta_fai,
dict,
dbsnp,
dbsnp_tbi,
intervals,
repeat_id,
karyotype,
expected_cn,
cnv_excluded_regions
)
//
// SUBWORKFLOW: Run completion tasks
//
PIPELINE_COMPLETION (
params.email,
params.email_on_fail,
params.plaintext_email,
params.outdir,
params.monochrome_logs,
params.hook_url,
NFCORE_PACVAR.out.multiqc_report
)
}
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
THE END
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/