-
Notifications
You must be signed in to change notification settings - Fork 0
/
annotate_reads.nf
53 lines (47 loc) · 1.46 KB
/
annotate_reads.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
#!/usr/bin/env nextflow
// vim: syntax=groovy expandtab
/****************************************
* Annotate raw reads using TIGRFAM
* Copyright (c) Authors 2017
* Authors:
* Fredrik Boulund <[email protected]>
* Luisa Hugerth <[email protected]>
****************************************/
Channel
.fromFilePairs(params.input_reads)
.ifEmpty{ exit 1, "Found no input read pairs, did you specify --input_reads? I got: '${params.input_reads}'"}
.into {input_reads_tigrfam;
input_reads_pfam}
/****************************************
* TIGRFAMs
****************************************/
process hmmsearch_tigrfam {
tag {pair_id}
publishDir "${params.outdir}/hmmsearch_tigrfam", mode: 'move'
input:
set pair_id, file(reads) from input_reads_tigrfam
output:
file "${pair_id}.tbl.txt"
file "${pair_id}.hmmsearch.stdout"
file "${pair_id}.tigrfam_counts.tsv"
script:
"""
translate6frames.sh \
in=${reads[0]} \
in2=${reads[1]} \
out=${pair_id}_6translated.fa \
&& \
hmmsearch \
--cpu ${task.cpus} \
--seed 1337 \
--tblout ${pair_id}.tbl.txt \
${params.tigrfams_lib} \
${pair_id}_6translated.fa \
> ${pair_id}.hmmsearch.stdout \
&& \
count_tigrfam_annotations.py \
--tbl ${pair_id}.tbl.txt \
--cutoffs ${params.tigrfam_cutoffs} \
--output ${pair_id}.tigrfam_counts.tsv
"""
}