@@ -25,9 +25,9 @@ if (params.help) {
2525 log. info ' Options:'
2626 log. info ' --help Show this message and exit.'
2727 log. info ' --file File containing the paths to the alignment files. The format of the file will be:'
28- log. info ' url'
29- log. info ' path/to/file.bam'
30- log. info ' The header is necessary.'
28+ log. info ' url'
29+ log. info ' path/to/file.bam'
30+ log. info ' The header is necessary.'
3131 log. info ' --genome File with genome as required by BEDTools.'
3232 log. info ' --window Number of bases for each of the BEDTools generated windows.'
3333 log. info ' --outprefix Prefix for output file.'
@@ -38,58 +38,58 @@ if (params.help) {
3838log. info ' Starting the analysis.....'
3939
4040process make_windows {
41- /*
42- Process to create genomic windows of a certain width (in bases)
43- */
41+ /*
42+ Process to create genomic windows of a certain width (in bases)
43+ */
4444
45- memory ' 500 MB'
46- executor ' lsf'
47- cpus 1
45+ memory ' 500 MB'
46+ executor ' lsf'
47+ cpus 1
4848
49- output:
50- stdout ivals_ch
49+ output:
50+ stdout ivals_ch
5151
52- """
53- /nfs/production/reseq-info/work/bin/bedtools-2.25.0/bin/ bedtools makewindows -g ${ params.genome} -w ${ params.window} |awk -F'\t ' '{print \$ 1":"\$ 2"-"\$ 3}' -
54- """
52+ """
53+ bedtools makewindows -g ${ params.genome} -w ${ params.window} |awk -F'\t ' '{print \$ 1":"\$ 2"-"\$ 3}' -
54+ """
5555}
5656
5757ivals_ch. splitText(). map{it -> it. trim()}. set{monoival_ch}
5858
5959process get_cov {
6060 /*
61- Process to run SAMTools depth on params.pos_file and get a
61+ Process to run SAMTools depth on params.pos_file and get a
6262 pos file that will be used later
63- */
63+ */
6464 tag " Depth for ival: $ival "
6565
6666 memory { 20. GB * task. attempt }
6767 executor ' lsf'
68- queue " ${ params.queue} "
69- cpus 1
68+ queue " ${ params.queue} "
69+ cpus 1
7070 maxForks 1000
7171
7272 errorStrategy ' retry'
73- maxRetries 5
73+ maxRetries 5
7474
7575 input:
76- val ival from monoival_ch
76+ val ival from monoival_ch
7777
7878 output:
79- file(" *.cov.gz" ) into cov_chunks
79+ file(" *.cov.gz" ) into cov_chunks
8080
8181 exec:
8282 def match = (ival =~ / (chr.*):(\d +)-(\d +)/ )
8383 match. matches()
8484 def chrom = match. group(1 )
8585 def start = match. group(2 )
8686 def toadd= 10 - start. length()
87- def nstart= ' 0' * toadd+ start
87+ def nstart= ' 0' * toadd+ start
8888
8989 script:
9090 """
91- samtools depth -a -d 0 -r ${ ival} -f ${ params.file} |bgzip -c > ${ chrom} .${ nstart} .cov.gz
92- """
91+ samtools depth -a -d 0 -r ${ ival} -f ${ params.file} |bgzip -c > ${ chrom} .${ nstart} .cov.gz
92+ """
9393}
9494
9595sorted_covchunks = cov_chunks. collect(). sort { a,b ->
@@ -103,15 +103,15 @@ process merge_chunks {
103103 */
104104
105105 memory ' 500 MB'
106- executor ' lsf'
107- queue " ${ params.queue} "
108- cpus 1
106+ executor ' lsf'
107+ queue " ${ params.queue} "
108+ cpus 1
109109
110110 input:
111- file(cov_f) from sorted_covchunks
111+ file(cov_f) from sorted_covchunks
112112
113113 output:
114- file(" merged.cov.gz" ) into merged_file
114+ file(" merged.cov.gz" ) into merged_file
115115
116116 script:
117117 """
@@ -127,15 +127,15 @@ process aggregate_depth {
127127 publishDir " results" , mode: ' copy' , overwrite: true
128128
129129 memory ' 500 MB'
130- executor ' lsf'
131- queue " ${ params.queue} "
132- cpus 1
130+ executor ' lsf'
131+ queue " ${ params.queue} "
132+ cpus 1
133133
134134 input:
135135 file(merged_file) from merged_file
136136
137137 output:
138- file(" out.cov.gz" ) into agg_file
138+ file(" out.cov.gz" ) into agg_file
139139
140140 """
141141 sum_covs.py --ifile ${ merged_file} --prefix out
0 commit comments