-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmain.nf
111 lines (93 loc) · 3.72 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
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
/*
========================================================================================
kaitlinchaung/nomad
========================================================================================
Github : https://github.com/kaitlinchaung/nomad
----------------------------------------------------------------------------------------
*/
nextflow.enable.dsl = 2
/*
========================================================================================
GENOME PARAMETER VALUES
========================================================================================
*/
/*
========================================================================================
VALIDATE & PRINT PARAMETER SUMMARY
========================================================================================
*/
WorkflowMain.initialise(workflow, params, log)
/*
========================================================================================
NAMED WORKFLOW FOR PIPELINE
========================================================================================
*/
include { NOMAD } from './workflows/nomad'
include { ANCHOR_HEATMAPS } from './modules/local/anchor_heatmaps'
//
// WORKFLOW: Run main kaitlinchaung/nomad analysis pipeline
//
workflow RUN_NOMAD {
// If we are only plotting,
if (params.run_anchor_heatmaps){
// Declare file paths
anchors_pvals = file("${params.results_dir}/anchors_pvals.tsv", checkIfExists: true)
anchors_Cjs = file("${params.results_dir}/anchors_Cjs_random_opt.tsv", checkIfExists: true)
genome_annotations_anchors = "${params.results_dir}/genome_annotations/genome_annotations_anchor.tsv"
additional_summary = "${params.results_dir}/additional_summary.tsv"
abundant_stratified_anchors_path = "${params.results_dir}/abundant_stratified_anchors/*txt.gz"
consensus_fractions_path = "${params.results_dir}/consensus_anchors/*fractions.tab"
// Create channels with files
Channel
.fromPath(abundant_stratified_anchors_path)
.set{ abundant_stratified_anchors}
Channel
.fromPath(consensus_fractions_path)
.set{ consensus_fractions }
if (params.use_heatmap_anchor_list) {
heatmap_anchor_list = file(params.heatmap_anchor_list)
} else {
// Set a dummy value if we are not using heatmap anchor list
heatmap_anchor_list = consensus_fractions.first().collectFile(name: 'dummy.txt')
}
/*
// Process to make heatmaps
*/
ANCHOR_HEATMAPS(
params.use_heatmap_anchor_list,
heatmap_anchor_list,
abundant_stratified_anchors.collect(),
consensus_fractions.collect(),
params.dataset,
params.kmer_size,
anchors_pvals,
anchors_Cjs,
params.num_heatmap_anchors,
file(params.input),
additional_summary,
genome_annotations_anchors,
params.results_dir
)
} else {
// Run pipeline
NOMAD ()
}
}
/*
========================================================================================
RUN ALL WORKFLOWS
========================================================================================
*/
//
// WORKFLOW: Execute a single named workflow for the pipeline
// See: https://github.com/nf-core/rnaseq/issues/619
//
workflow {
RUN_NOMAD ()
}
/*
========================================================================================
THE END
========================================================================================
*/