-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathmain.nf
More file actions
111 lines (91 loc) · 3.59 KB
/
main.nf
File metadata and controls
111 lines (91 loc) · 3.59 KB
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#!/usr/bin/env nextflow
nextflow.enable.dsl = 2
VERSION = "0.0.1" // Do not edit, controlled by bumpversion.
// Modules to include.
include {
wf__differential_expression;
} from "./modules/differential_expression.nf"
// Set default parameters.
params.output_dir = "nf-differential_condition"
params.help = false
params.anndata_cell_label = [value: 'cluster']
// Default parameters for differential expression
params.differential_expression = [
run_process: false
]
// Define the help messsage.
def help_message() {
log.info """
============================================================================
single cell differential condition ~ v${VERSION}
============================================================================
Runs basic single cell preprocessing
Usage:
nextflow run main.nf -profile <local|lsf> -params-file params.yaml [options]
Mandatory arguments:
--file_anndata Anndata file with cell type labels.
Optional arguments:
--output_dir Directory name to save results to. (Defaults to
'${params.output_dir}')
-params-file YAML file containing analysis parameters. See
example in example_runtime_setup/params.yml.
Profiles:
lsf lsf cluster execution
""".stripIndent()
}
// Boot message - either help message or the parameters supplied.
if (params.help){
help_message()
exit 0
} else {
log.info """
============================================================================
single cell differential expression ~ v${VERSION}
============================================================================
file_anndata : ${params.file_anndata}
output_dir (output folder) : ${params.output_dir}
""".stripIndent()
}
// Initalize Channels.
// anndata = Channel
// .fromPath(params.file_anndata)
// Run the workflow.
workflow {
main:
// Run differential expression analysis
if (params.differential_expression.run_process) {
wf__differential_expression(
params.output_dir,
params.file_anndata,
params.anndata_cell_label.value,
params.experiment_key_column.value,
params.differential_expression.models,
params.differential_expression.de_merge_config,
params.differential_expression.de_plot_config,
params.differential_expression.goenrich_config,
params.differential_expression.gsea_config
)
}
// NOTE: One could do publishing in the workflow like so, however
// that will not allow one to build the directory structure
// depending on the input data call. Therefore, we use publishDir
// within a process.
// publish:
// merge_samples.out.anndata to: "${params.output_dir}",
// mode: "copy",
// overwrite: "true"
}
workflow.onComplete {
// executed after workflow finishes
// ------------------------------------------------------------------------
log.info """\n
----------------------------------------------------------------------------
pipeline execution summary
----------------------------------------------------------------------------
Completed : ${workflow.complete}
Duration : ${workflow.duration}
Success : ${workflow.success}
Work directory : ${workflow.workDir}
Exit status : ${workflow.exitStatus}
""".stripIndent()
}