-
Notifications
You must be signed in to change notification settings - Fork 1
/
mkfastq.nf
72 lines (58 loc) · 1.85 KB
/
mkfastq.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
#!/usr/bin/env nextflow
// Enable DSL 2 syntax
nextflow.enable.dsl = 2
// Define a process which takes two inputs
process mkfastq {
// Load the appropriate dependencies
label "cellranger"
// Copy all output files to the folder specified by the user with --output
publishDir "${params.output}", mode: 'copy', overwrite: true
input:
// BCL run folder
path bcl_run_folder
// Samplesheet
path samplesheet
output:
// Capture any created files as outputs
path "*"
script:
// Run the code defined in templates/mkfastq.sh
template "mkfastq.sh"
}
workflow {
// Check that --software is either cellranger or cellranger-arc
if("${params.software}" != "cellranger"){
if("${params.software}" != "cellranger-arc"){
error "Parameter software must be 'cellranger' or 'cellranger-arc'"
}
}
// Check that input_type is either samplesheet or csv
if("${params.input_type}" != "samplesheet"){
if("${params.input_type}" != "csv"){
error "Parameter input_type must be 'samplesheet' or 'csv'"
}
}
// Check that the user specified the output parameter
if("${params.output}" == "false"){
error "Parameter 'output' must be specified"
}
// Check that the user specified the bcl_run_folder parameter
if("${params.bcl_run_folder}" == "false"){
error "Parameter 'bcl_run_folder' must be specified"
}
// Check that the user specified the samplesheet parameter
if("${params.samplesheet}" == "false"){
error "Parameter 'samplesheet' must be specified"
}
mkfastq(
Channel.fromPath(
"${params.bcl_run_folder}",
type: 'dir',
checkIfExists: true
),
Channel.fromPath(
"${params.samplesheet}",
checkIfExists: true
)
)
}