-
Notifications
You must be signed in to change notification settings - Fork 1
/
aggr.nf
60 lines (46 loc) · 1.44 KB
/
aggr.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
#!/usr/bin/env nextflow
// Enable DSL 2 syntax
nextflow.enable.dsl = 2
// Define the process used to run cellranger aggr
process cellranger_aggr {
// 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:
// Stage one or more folders with all of the inputs
path "*"
output:
// Capture any created files as outputs
path "*"
script:
// Run the code defined in templates/aggr.sh
template "aggr.sh"
}
workflow {
log.info"""
Parameters:
input: ${params.input}
output: ${params.output}
aggr_name: ${params.aggr_name}
cellranger_version: ${params.cellranger_version}
"""
// Check that the user specified the input parameter
if("${params.input}" == "false"){
error "Parameter 'input' must be specified"
}
// Check that the user specified the output parameter
if("${params.output}" == "false"){
error "Parameter 'output' must be specified"
}
// Point to the input directory (or directories)
Channel
.fromPath(
"${params.input}".split(",").toList(),
checkIfExists: true,
type: "dir"
)
.set { input_ch }
// Analyze each sample independently
cellranger_aggr(input_ch)
}