-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.nf
144 lines (121 loc) · 4.18 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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
#!/usr/bin/env nextflow
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
nf-core/tbAnalyzer
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Github : https://github.com/nf-core/tbAnalyzer
Website: https://nf-co.re/tbAnalyzer
Slack : https://nfcore.slack.com/channels/tbAnalyzer
----------------------------------------------------------------------------------------
*/
nextflow.enable.dsl = 2
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
IMPORT FUNCTIONS / MODULES / SUBWORKFLOWS / WORKFLOWS
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
// Main workflows
include { tbAnalyzer } from './workflows/tbanalyzer'
include { testPrep } from './workflows/testprep'
// Subworkflows
include { CREATE_INPUT_CHANNEL } from './subworkflows/local/create_input_channel'
include { PIPELINE_INITIALISATION } from './subworkflows/local/utils_tbAnalyzer_pipeline'
include { PIPELINE_COMPLETION } from './subworkflows/local/utils_tbAnalyzer_pipeline'
include { getGenomeAttribute } from './subworkflows/local/utils_tbAnalyzer_pipeline'
// Modules
include { PREPSRR } from './modules/local/srr'
include { BASESPACE } from './modules/local/basespace'
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
GENOME PARAMETER VALUES
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
// TODO nf-core: Remove this line if you don't need a FASTA file
// This is an example of how to use getGenomeAttribute() to fetch parameters
// from igenomes.config using `--genome`
// params.fasta = getGenomeAttribute('fasta')
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Workflows
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
// WORKFLOW: PREPARE TEST DATA
workflow OhioTestPrep {
// set test samplesheet
samplesheet = file(params.input)
if(params.isTest==false) {exit 1, "YEP"}
main:
// read input
CREATE_INPUT_CHANNEL(
samplesheet
)
// Download test data
BASESPACE(CREATE_INPUT_CHANNEL.out.reads)
ch_reads = BASESPACE.out.reads
// RUN ANALYZER
tbAnalyzer (
ch_reads
)
}
// WORKFLOW: PREPARE TEST DATA
workflow OhioSRRPrep {
// set test samplesheet
samplesheet = file(params.input)
if(params.isTest==false) {exit 1, "YEP"}
main:
// read input
CREATE_INPUT_CHANNEL(
samplesheet
)
// Download test data
PREPSRR(CREATE_INPUT_CHANNEL.out.reads)
ch_reads = PREPSRR.out.reads
// RUN ANALYZER
tbAnalyzer (
ch_reads
)
}
//
// WORKFLOW: Run main analysis pipeline depending on type of input
//
workflow OhioTBAnalyzer {
if (params.input) { ch_input = file(params.input) } else { exit 1, 'For -entry NFCORE_OhioTBGenomics: Input samplesheet not specified!' }
samplesheet = file(params.input)
main:
// // Initialize
// PIPELINE_INITIALISATION (
// params.version,
// params.help,
// params.validate_params,
// params.monochrome_logs,
// args,
// params.outdir,
// params.input
// )
// read input
CREATE_INPUT_CHANNEL(
samplesheet
)
ch_reads=CREATE_INPUT_CHANNEL.out.reads
// Download test data
BASESPACE(CREATE_INPUT_CHANNEL.out.reads)
ch_reads = BASESPACE.out.reads
// RUN ANALYZER
tbAnalyzer (
ch_reads
)
// PIPELINE_COMPLETION (
// params.email,
// params.email_on_fail,
// params.plaintext_email,
// params.outdir,
// params.monochrome_logs,
// params.hook_url,
// tbAnalyzer.out.multiqc_report
// )
}
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
THE END
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/