generated from JackCurragh/Nextflow-Template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.nf
executable file
·53 lines (39 loc) · 1.74 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
#!/usr/bin/env nextflow
/// Specify to use Nextflow DSL version 2
nextflow.enable.dsl=2
/// Import modules and subworkflows
include { fetch_data } from './subworkflows/local/fetch_data.nf'
include { preprocessing } from './subworkflows/local/preprocessing.nf'
// Log the parameters
log.info """\
=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
|| RiboSeqOrg Data Processing Pipeline
=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
|| Parameters
=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
|| Sample Sheet : ${params.sample_sheet}
|| workDir : ${workflow.workDir}
|| study_dir : ${params.study_dir}
=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
"""
// Help Message to prompt users to specify required parameters
def help() {
log.info"""
Usage: nextflow run main.nf --input <path_to_fastq_dir>
Required Arguments:
--input Path to directory containing fastq files.
Optional Arguments:
--outDir Path to output directory.
""".stripIndent()
}
workflow {
samples_ch = Channel
.fromPath(params.sample_sheet)
.splitCsv(header: true, sep: '\t')
.map { row -> tuple("${row.BioProject}", "${row.Run}")}
fetch_data_ch = fetch_data(samples_ch)
collapsed_fastq_ch = preprocessing(fetch_data_ch.fastq_ch, samples_ch)
}
workflow.onComplete {
log.info "Pipeline completed at: ${new Date().format('dd-MM-yyyy HH:mm:ss')}"
}