-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprocess_illumina.nf
54 lines (39 loc) · 1.96 KB
/
process_illumina.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
#!/usr/bin/env nextflow
nextflow.enable.dsl=2
//============================================================================//
// Set up modules
//============================================================================//
include { trim_galore } from './bin/modules/trim_galore'
include { reverse_complement_read1 } from './bin/modules/reverse_complement_read1'
include { label_illumina_reads } from './bin/modules/label_illumina_reads'
// Modules with different param settings
include { bed_to_span as bed_to_span_ILLUMINA } from './bin/modules/bed_to_span' \
addParams(bed_to_span_junc_reads_only: params.bed_to_span_junc_reads_only_ILLUMINA)
include { bed_to_span as bed_to_span_NANOPORE } from './bin/modules/bed_to_span' \
addParams(bed_to_span_junc_reads_only: params.bed_to_span_junc_reads_only_NANOPORE)
// Note: Add addParams(param_name: 'desired value') to end of include line to
// specify a param value for that module. OTHERWISE, each param is taken
// from the value in this script automatically (or presumably the config).
// E.g. by default it does similar behavior as params(params)
// EXAMPLE: include { slide_bed as slide_bed_illumina } from './bin/modules/slide_bed' \
// addParams(slide_bed_only_keep_wraparound: params.ILLUMINA_slide_bed_only_keep_wraparound)
// NOTE - use .view{"$it"} to inspect a chanel.. this will print out the tuples.
//============================================================================//
// Define main workflow
//============================================================================//
workflow {
main:
// Parse csv input
Channel
.fromPath(params.index)
.splitCsv(header:true)
.map{ row-> tuple(row.sample_name, file(row.read1), file(row.read2)) }
.set { input_ch }
// Trim with trim_galore
trim_galore(input_ch)
// Rev comp read1
trim_galore.out.reads |\
reverse_complement_read1
// Label read1 and read2 with _1 and _2
label_illumina_reads(reverse_complement_read1.out.reads)
}