@@ -9,6 +9,7 @@ vim: syntax=groovy
9
9
Documentation: https://github.com/cellgeni/rnaseq
10
10
This pipeline was forked from https://github.com/nf-core/rnaseq
11
11
Post-fork development at Wellcome Sanger Institute:
12
+
12
13
Stijn van Dongen <[email protected] >
13
14
Vladimir Kiselev @wikiselev <[email protected] >
14
15
Original development by SciLifeLabs
@@ -285,14 +286,15 @@ process get_fastq_files_single {
285
286
output :
286
287
set val(samplename), file(" ${ samplename} .fastq.gz" ) optional true into ch_fastqs_dirse
287
288
file(' numreads.txt' ) optional true into ch_numreads_fastq_se
288
- shell :
289
+ script :
289
290
'''
290
- name=! {params.fastqdir}/! {samplename}! {params.se_suffix}
291
+ name=$ {params.fastqdir}/$ {samplename}$ {params.se_suffix}
291
292
if [[ ! -e $name ]]; then
292
293
echo "Fastq file $name not found"
293
294
false
294
295
else
295
- ln -s $name !{samplename}.fastq.gz
296
+ ln -s $name ${samplename}.fastq.gz
297
+ # Need single quotes to allow reads calculation to work
296
298
echo $(( $(zcat $fname | wc -l) / 4)) > numreads.txt
297
299
fi
298
300
'''
@@ -313,13 +315,14 @@ process get_fastq_files_from_bam {
313
315
set val(samplename), file(" ${ samplename} _?.fastq.gz" ) optional true into ch_bams_dirpe
314
316
file(' numreads.txt' ) optional true into ch_numreads_bam
315
317
316
- shell :
318
+ script :
317
319
'''
318
- bam="! {params.bamdir}/! {samplename}.bam"
319
- f1="! {samplename}_1.fastq.gz"
320
- f2="! {samplename}_2.fastq.gz"
320
+ bam="$ {params.bamdir}/$ {samplename}.bam"
321
+ f1="$ {samplename}_1.fastq.gz"
322
+ f2="$ {samplename}_2.fastq.gz"
321
323
if [[ -e $bam ]]; then
322
324
samtools fastq -N -F 0x900 -@ !{task.cpus} -1 $f1 -2 $f2 $bam
325
+ # Need single quotes to allow reads calculation to work
323
326
echo $(( $(zcat $f1 | wc -l) / 2)) > numreads.txt
324
327
else
325
328
echo "File $bam not found"
@@ -342,22 +345,23 @@ process get_fastq_files {
342
345
set val(samplename), file(" ${ samplename} _?.fastq.gz" ) optional true into ch_fastqs_dirpe
343
346
file(' numreads.txt' ) optional true into ch_numreads_fastq
344
347
file(' *.lostcause.txt' ) optional true into ch_lostcause_fastq
345
- shell :
348
+ script :
346
349
'''
347
- list=( $(ls !{params.fastqdir}/!{samplename}!{params.pe_suffix_pattern}) )
350
+ # Need single quotes to allow list generation to work
351
+ list=( $(ls ${params.fastqdir}/${samplename}${params.pe_suffix_pattern}) )
348
352
if [[ 2 == ${#list[@]} ]]; then
349
353
f1=${list[0]}
350
354
f2=${list[1]}
351
355
numreads=$(( $(zcat $f1 | wc -l) / 4))
352
356
echo $numreads > numreads.txt
353
- if (( numreads < ! {params.min_reads} )); then
354
- echo -e "! {samplename}\\ tfastqdir\\ tlowreads" > ! {samplename}.lostcause.txt
357
+ if (( numreads < $ {params.min_reads} )); then
358
+ echo -e "$ {samplename}\\ tfastqdir\\ tlowreads" > $ {samplename}.lostcause.txt
355
359
else
356
- ln -s $f1 ! {samplename}_1.fastq.gz
357
- ln -s $f2 ! {samplename}_2.fastq.gz
360
+ ln -s $f1 $ {samplename}_1.fastq.gz
361
+ ln -s $f2 $ {samplename}_2.fastq.gz
358
362
fi
359
363
else
360
- echo -e "! {samplename}\\ tfastqdir\\ tnotpaired" > ! {samplename}.lostcause.txt
364
+ echo -e "$ {samplename}\\ tfastqdir\\ tnotpaired" > $ {samplename}.lostcause.txt
361
365
fi
362
366
'''
363
367
}
@@ -543,7 +547,8 @@ process tracer_assemble {
543
547
fragoptions = " --fragment_length ${ params.tracer_fraglength} --fragment_sd ${ params.tracer_fragsd} "
544
548
ending = params. singleend ? " --single_end $fragoptions " : " "
545
549
'''
546
- export IGDATA=${params.IGDATA}
550
+ # Need shell rather than script and single quotes to allow reads_stem iteration to work
551
+ export IGDATA=!{params.IGDATA}
547
552
# ? output created in out_asm/out-${samplename}
548
553
for f in !{reads_stem}; do
549
554
zcat $f!{params.se_suffix} > $f
@@ -565,13 +570,13 @@ process tracer_summarise {
565
570
output :
566
571
file(' in_asm/filtered_TCRABDG_summary' )
567
572
568
- shell :
573
+ script :
569
574
spec = params. tracer_genometag
570
- '''
575
+ """
571
576
# all the output directories of the form out-{samplename} are subdirectories of in_asm.
572
- tracer summarise --loci A B D G -p ! {task.cpus} -s ! {spec} -c /tracer/docker_helper_files/docker_tracer.conf in_asm
577
+ tracer summarise --loci A B D G -p $ { task.cpus} -s $ { spec} -c /tracer/docker_helper_files/docker_tracer.conf in_asm
573
578
echo done
574
- '''
579
+ """
575
580
}
576
581
577
582
@@ -1001,17 +1006,17 @@ process merge_featureCounts {
1001
1006
output :
1002
1007
file ' *-fc-genecounts.txt'
1003
1008
1004
- shell :
1009
+ script :
1005
1010
suffix= [' star' :' .star.gene.fc.txt' , ' hisat2' :' .hisat2.gene.fc.txt' ]
1006
1011
aligner = metafile. baseName // not strictly necessary
1007
1012
outputname = " ${ params.runtag} -${ aligner} -fc-genecounts.txt"
1008
1013
thesuffix = suffix[aligner] ?: ' .txt'
1009
- '''
1010
- python3 ! {workflow.projectDir}/bin/merge_featurecounts.py \\
1011
- --rm-suffix ! {thesuffix} \\
1014
+ """
1015
+ python3 $ { workflow.projectDir} /bin/merge_featurecounts.py \\
1016
+ --rm-suffix $ { thesuffix} \\
1012
1017
-c 1 --skip-comments --header \\
1013
- -o ! {outputname} -I ! {metafile}
1014
- '''
1018
+ -o $ { outputname} -I $ { metafile}
1019
+ """
1015
1020
}
1016
1021
1017
1022
process merge_salmoncounts {
0 commit comments