-
Notifications
You must be signed in to change notification settings - Fork 20
/
main.nf
executable file
·105 lines (82 loc) · 2.44 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
#!/usr/bin/env nextflow
params.ValidPairs = "none"
params.Interval = "none2"
params.Matrix = "none3"
params.Bed = "none4"
params.CircularGenome = 0
params.PeakFile = "none5"
params.ChrSizeFile = "none6"
params.IntType = 3
params.BINSIZE = 5000
params.LowDistThr = 20000
params.UppDistThr = 2000000
params.UseP2PBackgrnd = 0
params.BiasType = 1
params.MergeInt = 1
params.QVALUE = 0.01
params.PREFIX = "FitHiChIP"
params.OverWrite = 1
vp = file(params.ValidPairs)
interval = file(params.Interval)
matrix = file(params.Matrix)
bed = file(params.Bed)
HIC = file(params.HIC)
COOL = file(params.COOL)
peakfile = file(params.PeakFile)
chrsize = file(params.ChrSizeFile)
process prepare_config {
output:
file nf_conf into config
script:
cstr = "OutDir=./fhcout/\nHiCProBasedir=/HiC-Pro-3.1.0/\n"
if (vp.exists())
cstr = cstr + "ValidPairs=${vp}\n"
if (interval.exists())
cstr = cstr + "Interval=${interval}\n"
if (matrix.exists())
cstr = cstr + "Matrix=${matrix}\n"
if (bed.exists())
cstr = cstr + "Bed=${bed}\n"
if (HIC.exists())
cstr = cstr + "HIC=${HIC}\n"
if (COOL.exists())
cstr = cstr + "COOL=${COOL}\n"
if (peakfile.exists())
cstr = cstr + "PeakFile=${peakfile}\n"
if (chrsize.exists())
cstr = cstr + "ChrSizeFile=${chrsize}\n"
else
cstr = cstr + "ChrSizeFile=/FitHiChIP/TestData/chrom_hg19.sizes\n"
cstr = cstr + "CircularGenome=${params.CircularGenome}\n"
cstr = cstr + "IntType=${params.IntType}\n"
cstr = cstr + "BINSIZE=${params.BINSIZE}\n"
cstr = cstr + "LowDistThr=${params.LowDistThr}\n"
cstr = cstr + "UppDistThr=${params.UppDistThr}\n"
cstr = cstr + "UseP2PBackgrnd=${params.UseP2PBackgrnd}\n"
cstr = cstr + "BiasType=${params.BiasType}\n"
cstr = cstr + "MergeInt=${params.MergeInt}\n"
cstr = cstr + "QVALUE=${params.QVALUE}\n"
cstr = cstr + "PREFIX=${params.PREFIX}\n"
cstr = cstr + "OverWrite=${params.OverWrite}\n"
"""
echo "$cstr" >> nf_conf
"""
}
process main {
input:
file conf from config
file vpf from vp
file intf from interval
file mf from matrix
file bedf from bed
file peakfilef from peakfile
file chrsizef from chrsize
output:
file "./fhcout/**/*" into outFiles
stdout result
script:
"""
bash /FitHiChIP/FitHiChIP_HiCPro.sh -C $conf
"""
}
result.println { it.trim() }