Newer
Older
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
/*
* htseq :
* Imputs : sorted bams files
* Imputs : gtf
* Output : counts files
*/
/* quality trimming */
params.bam = "$baseDir/data/bam/*.bam"
params.gtf = "$baseDir/data/annotation/*.gtf"
log.info "bam files : ${params.bam}"
log.info "gtf files : ${params.gtf}"
Channel
.fromPath( params.bam )
.ifEmpty { error "Cannot find any fastq files matching: ${params.bam}" }
.set { bam_files }
Channel
.fromPath( params.gtf )
.ifEmpty { error "Cannot find any gtf file matching: ${params.gtf}" }
.set { gtf_file }
process counting {
tag "$bam.baseName"
publishDir "results/quantification/", mode: 'copy'
input:
file bam from bam_files
file gtf from gtf_file
output:
file "*.count" into count_files
script:
"""
htseq-count -r pos --mode=intersection-nonempty -a 10 -s no -t exon -i gene_id \
--format=bam ${bam} ${gtf} > ${bam.baseName}.count
"""
}