This repository has been archived by the owner on Mar 29, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
main.nf
86 lines (71 loc) · 2.33 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
#!/usr/bin/env nextflow
/*
vim: syntax=groovy
-*- mode: groovy;-*-
========================================================================================
Example Pipeline
========================================================================================
Example pipeline. Started December 2016.
@Authors
Rickard Hammarén <rickard.hammaren@scilifelab.se>
----------------------------------------------------------------------------------------
Basic command:
$ nextflow main.nf
Pipeline variables can be configured with the following command line options:
--genome [GRCh37 | GRCm38]
--index [path to STAR index]
--gtf [path to GTF file]
--files [path to input files]
----------------------------------------------------------------------------------------
*/
/*
* SET UP CONFIGURATION VARIABLES
*/
// Pipeline version
version = 0.1
// Reference genome index
params.genome = false
params.gtf = params.genomes[ params.genome ].gtf
params.bowtie2 = params.genomes[ params.genome ].bowtie2
params.name = "miRNA-Seq Best practice"
// Input files
params.input = "data/*.fastq.gz"
// Output path
params.out = "$PWD"
// R library locations
params.rlocation = "$HOME/R/nxtflow_libs/"
nxtflow_libs=file(params.rlocation)
log.info "===================================="
log.info " Example Pipeline v${version}"
log.info "===================================="
log.info "Reads : ${params.input}"
log.info "Genome : ${params.genome}"
log.info "Index : ${params.bowtie2}"
log.info "Annotation : ${params.gtf}"
log.info "Current home : $HOME"
log.info "Current user : $USER"
log.info "Current path : $PWD"
log.info "R libraries : ${params.rlocation}"
log.info "Script dir : $baseDir"
log.info "Working dir : $workDir"
log.info "Output dir : ${params.out}"
log.info "===================================="
/*
* Create a channel for input read files
*/
Channel
.fromFilePairs( params.reads, size: -1 )
.ifEmpty { exit 1, "Cannot find any reads matching: ${params.reads}" }
.into { read_files_fastqc; read_files_trimming }
process fastqc {
tag "$name"
publishDir "${params.outdir}/fastqc", mode: 'copy'
input:
set val(name), file(reads) from read_files_fastqc
output:
file "*_fastqc.{zip,html}" into fastqc_results
script:
"""
fastqc -q $reads
"""
}