-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.nf
26 lines (23 loc) · 898 Bytes
/
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
process align_reads_to_contigs {
tag "$name"
label 'process_high'
label 'process_ignore'
publishDir "${params.outdir}/alignment/${name}", mode: 'copy'
input:
tuple val(name), path(contigs), path(reads)
output:
tuple val(name), file("*.sorted.bam")
script:
outfile = name+".sorted.bam"
if (!params.single_end) {
"""
bowtie2-build --threads ${task.cpus} $contigs $name
bowtie2 -x $name -1 ${reads[0]} -2 ${reads[1]} --very-sensitive -N 1 --threads ${task.cpus} | samtools view -S -b -F 4 - | samtools sort - > $outfile
"""
} else {
"""
bowtie2-build --threads ${task.cpus} $contigs $name
bowtie2 -x $name -U $reads --very-sensitive -N 1 --threads ${task.cpus} | samtools view -S -b -F 4 - | samtools sort - > $outfile
"""
}
}