Skip to content

Commit 134deb9

Browse files
2nd attempt D:
1 parent 42f6a0f commit 134deb9

13 files changed

Lines changed: 122 additions & 26391 deletions

File tree

modules/local/transcriptclean/main.nf

Lines changed: 46 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -56,31 +56,25 @@ process TRANSCRIPTCLEAN {
5656
tuple val(meta), path(sam), path(fasta), path(vcf), path(splice_junctions), val(params)
5757

5858
output:
59-
tuple val(meta), path("*_TranscriptClean.sam"), emit: sam
60-
tuple val(meta), path("*_TranscriptClean.fasta"), emit: fasta
61-
tuple val(meta), path("*_TranscriptClean.TE.log"), emit: log
62-
tuple val(meta), path("*_TranscriptClean.log"), emit: log
59+
tuple val(meta), path("*.sam"), emit: sam
60+
tuple val(meta), path("*.fasta"), emit: fasta
61+
tuple val(meta), path("*.TE.log"), emit: log
62+
tuple val(meta), path("*.log"), emit: log
6363
path "versions.yml", emit: versions
6464

65-
when:
66-
params.variant_aware || params.splice_junction_correction
67-
6865
script:
6966
args = task.ext.args ?: ''
7067
prefix = task.ext.prefix ?: "${meta.id}"
7168
def variant_flag = params.variant_aware && vcf ? "--variants ${vcf}" : ''
72-
def splice_flag = params.splice_junction_correction && splice_junctions ? "--spliceJns ${splice_junctions}" : ''
73-
def other_params = params.other_params ? params.other_params : ''
69+
def splice_flag = params.sj_correction && splice_junctions ? "--spliceJns ${splice_junctions}" : ''
70+
// def other_params = params.other_params ? params.other_params : ''
7471
// test if it is actually transcriptclean --version
7572
"""
7673
python home/biodocker/TranscriptClean-2.0.2/TranscriptClean.py \\
7774
--SAM ${sam} \\
7875
--genome ${fasta} \\
79-
${variant_flag} \\
80-
${splice_flag} \\
81-
${other_params} \\
82-
--outprefix "${prefix}" \\
8376
$args
77+
--outprefix "${prefix}" \\
8478
8579
cat <<-END_VERSIONS > versions.yml
8680
"${task.process}":
@@ -104,8 +98,43 @@ process TRANSCRIPTCLEAN {
10498
"""
10599
}
106100

107-
// Add process to generate report later :(
101+
process GENERATE_REPORT {
102+
tag "Generate TranscriptClean report"
103+
label 'process_high'
108104

109-
/* process GENERATE_REPORT {
110-
111-
} */
105+
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
106+
'biocontainers/transcriptclean:v2.0.2_cv1':
107+
'biocontainers/transcriptclean:v2.0.2_cv1' }"
108+
109+
input:
110+
tuple val(meta), path(transcriptclean_logs)
111+
112+
output:
113+
tuple val(meta), path("*_report.pdf"), emit: pdf
114+
path "versions.yml", emit: versions
115+
116+
script:
117+
args = task.ext.args ?: ''
118+
prefix = task.ext.prefix ?: "${meta.id}"
119+
"""
120+
Rscript home/biodocker/TranscriptClean-2.0.2/generate_report.R \\
121+
../results/${prefix}
122+
123+
cat <<-END_VERSIONS > versions.yml
124+
"${task.process}":
125+
transcriptclean: \$(echo \$(transcriptclean --version 2>&1) | sed 's/^.*transcriptclean //; s/Using.*\$//' ))
126+
END_VERSIONS
127+
"""
128+
129+
stub:
130+
args = task.ext.args ?: ''
131+
prefix = task.ext.prefix ?: "${meta.id}"
132+
"""
133+
touch "${prefix}"_report.pdf
134+
135+
cat <<-END_VERSIONS > versions.yml
136+
"${task.process}":
137+
transcriptclean: \$(echo \$(transcriptclean --version 2>&1) | sed 's/^.*transcriptclean //; s/Using.*\$//' ))
138+
END_VERSIONS
139+
"""
140+
}

modules/local/transcriptclean/meta.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ input:
5959
type: file
6060
description: (Optional) GTF file for generating splice junction file.
6161
pattern: "*.{vcf}"
62+
- transcriptclean_logs:
63+
type: file
64+
description: Output files from TranscriptClean for report
65+
pattern: "*.{clean.TE.log, clean.log}"
6266

6367
## TODO nf-core: Add a description of all of the variables used as output
6468
output:
@@ -88,11 +92,15 @@ output:
8892
- TE_error_log:
8993
type: file
9094
description: Transcript error log file
91-
pattern: "*.{TE.log}"
95+
pattern: "*.{clean.TE.log}"
9296
- TE_log:
9397
type: file
9498
description: Transcript log file
95-
pattern: "*.{log}"
99+
pattern: "*.{clean.log}"
100+
- report:
101+
type: file
102+
description: PDF TranscriptClean Report from logs
103+
pattern: "*.{_report.pdf}"
96104
- versions:
97105
- "versions.yml":
98106
type: file

0 commit comments

Comments
 (0)