-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathmain.nf
executable file
·113 lines (85 loc) · 3.97 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
112
113
#!/usr/bin/env nextflow
nextflow.enable.dsl = 2
def helpMessage() {
log.info"""
================================================================
crispr-mageck-nf
================================================================
Statistical analysis of multiplexed CRISPR-Cas9 / shRNA screens
using MAGeCK.
Usage:
nextflow run zuberlab/crispr-mageck-nf
Options:
--contrasts Tab-delimited text file specifying the contrasts
to be analyzed. (default: 'contrasts.txt')
The following columns are required:
- name: name of contrasts
- control: control samples (comma separated)
- treatment: treatment samples (comma separated)
- norm_method: normalization method
- fdr_method: multiple testing adjustment method
- lfc_method: method to combine guides / hairpins
- cnv_correction: cellline name
- filter : column to do count filtering on (default if empty: control)
--counts Tab-delimited text file containing the raw counts.
(default: 'counts_mageck.txt')
This file must conform to the input requirements of
MAGeCK 0.5.9 (http://mageck.sourceforge.net)
--cnv Tab-delimited text file containing the estimated
copy number per gene. Must be the same as in
'cnv_correction' in 'contrast' file. (default: 'cnv.txt')
--min_count Integer specifying the minimal control count to
consider the guide for further analysis. Guides with
lower counts in any control sample will be removed
prior to normalization for the given contrast.
(default: 50)
--estimate_min_count_from_samples: boolean indicating if min required counts for filtering
should be estimated from the samples (> 5% of the mean count)
--min_rra_window Float between 0 and 1 specifying the mininal fraction
of guides to consider for the RRA rank algorithm.
This overrides the dynamically determined threshold
and will use the same value for both negative and
positive selection. A value of 0 uses the dynamic
thresholding. (default: 0)
--outputDir Directory name to save results to. (Defaults to
'03_stats')
--control_sgRNAs: txt file that contains sgRNA-ids to be used by mageck for normalization
and for generating the null distribution of RRA
Profiles:
standard local execution
singularity local execution with singularity
cbe IMPIMBA2 cluster execution with singularity
Docker:
zuberlab/crispr-nf:0.5.9
Author:
Florian Andersch ([email protected])
""".stripIndent()
}
params.help = false
if (params.help) {
helpMessage()
exit 0
}
// Import modules
include { MAGECK } from './modules/mageck'
include { POSTPROCESS } from './modules/postprocess'
contrastsMageck = Channel
.fromPath(params.contrasts)
.splitCsv(sep: '\t', header: true)
countsMageck = Channel.fromPath(params.counts)
cnvMageck = Channel.fromPath(params.cnv)
ctrlsgRNAs = Channel.fromPath(params.control_sgRNAs)
workflow {
// Combine input channels
ch_mageck = contrastsMageck
.combine(countsMageck)
.combine(cnvMageck)
.combine(ctrlsgRNAs)
// Run MAGeCK
MAGECK(ch_mageck)
// Postprocess results
POSTPROCESS(MAGECK.out.results)
}
workflow.onComplete {
println ( workflow.success ? "COMPLETED!" : "FAILED" )
}