2020-12-17 23:50:24 +00:00
|
|
|
process RSEM_CALCULATEEXPRESSION {
|
|
|
|
tag "$meta.id"
|
|
|
|
label 'process_high'
|
|
|
|
|
2022-04-27 18:21:26 +00:00
|
|
|
conda (params.enable_conda ? "bioconda::rsem=1.3.3 bioconda::star=2.7.10a" : null)
|
2021-11-26 07:58:40 +00:00
|
|
|
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
|
2022-04-27 18:21:26 +00:00
|
|
|
'https://depot.galaxyproject.org/singularity/mulled-v2-cf0123ef83b3c38c13e3b0696a3f285d3f20f15b:64aad4a4e144878400649e71f42105311be7ed87-0' :
|
|
|
|
'quay.io/biocontainers/mulled-v2-cf0123ef83b3c38c13e3b0696a3f285d3f20f15b:64aad4a4e144878400649e71f42105311be7ed87-0' }"
|
2020-12-17 23:50:24 +00:00
|
|
|
|
|
|
|
input:
|
|
|
|
tuple val(meta), path(reads)
|
|
|
|
path index
|
|
|
|
|
|
|
|
output:
|
|
|
|
tuple val(meta), path("*.genes.results") , emit: counts_gene
|
|
|
|
tuple val(meta), path("*.isoforms.results"), emit: counts_transcript
|
|
|
|
tuple val(meta), path("*.stat") , emit: stat
|
|
|
|
tuple val(meta), path("*.log") , emit: logs
|
2021-10-01 13:04:56 +00:00
|
|
|
path "versions.yml" , emit: versions
|
2020-12-17 23:50:24 +00:00
|
|
|
|
|
|
|
tuple val(meta), path("*.STAR.genome.bam") , optional:true, emit: bam_star
|
|
|
|
tuple val(meta), path("${prefix}.genome.bam") , optional:true, emit: bam_genome
|
|
|
|
tuple val(meta), path("${prefix}.transcript.bam"), optional:true, emit: bam_transcript
|
|
|
|
|
2022-02-04 08:53:32 +00:00
|
|
|
when:
|
|
|
|
task.ext.when == null || task.ext.when
|
|
|
|
|
2020-12-17 23:50:24 +00:00
|
|
|
script:
|
2021-12-07 14:00:43 +00:00
|
|
|
def args = task.ext.args ?: ''
|
|
|
|
prefix = task.ext.prefix ?: "${meta.id}"
|
2020-12-17 23:50:24 +00:00
|
|
|
|
|
|
|
def strandedness = ''
|
|
|
|
if (meta.strandedness == 'forward') {
|
|
|
|
strandedness = '--strandedness forward'
|
|
|
|
} else if (meta.strandedness == 'reverse') {
|
|
|
|
strandedness = '--strandedness reverse'
|
|
|
|
}
|
|
|
|
def paired_end = meta.single_end ? "" : "--paired-end"
|
|
|
|
"""
|
|
|
|
INDEX=`find -L ./ -name "*.grp" | sed 's/.grp//'`
|
|
|
|
rsem-calculate-expression \\
|
|
|
|
--num-threads $task.cpus \\
|
|
|
|
--temporary-folder ./tmp/ \\
|
|
|
|
$strandedness \\
|
|
|
|
$paired_end \\
|
2021-11-26 07:58:40 +00:00
|
|
|
$args \\
|
2020-12-17 23:50:24 +00:00
|
|
|
$reads \\
|
|
|
|
\$INDEX \\
|
|
|
|
$prefix
|
|
|
|
|
2021-09-27 08:41:24 +00:00
|
|
|
cat <<-END_VERSIONS > versions.yml
|
2021-11-26 07:58:40 +00:00
|
|
|
"${task.process}":
|
|
|
|
rsem: \$(rsem-calculate-expression --version | sed -e "s/Current version: RSEM v//g")
|
2021-09-28 13:37:47 +00:00
|
|
|
star: \$(STAR --version | sed -e "s/STAR_//g")
|
2021-09-27 08:41:24 +00:00
|
|
|
END_VERSIONS
|
2020-12-17 23:50:24 +00:00
|
|
|
"""
|
|
|
|
}
|