nf-core_modules/software/stringtie/main.nf

56 lines
1.8 KiB
Text
Raw Normal View History

2020-12-17 23:50:24 +00:00
// Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:]
options = initOptions(params.options)
2020-12-17 23:50:24 +00:00
process STRINGTIE {
tag "$meta.id"
label 'process_medium'
publishDir "${params.outdir}",
mode: params.publish_dir_mode,
saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
2021-02-16 23:58:23 +00:00
conda (params.enable_conda ? "bioconda::stringtie=2.1.4" : null)
2020-12-17 23:50:24 +00:00
if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) {
container "https://depot.galaxyproject.org/singularity/stringtie:2.1.4--h7e0af3c_0"
} else {
container "quay.io/biocontainers/stringtie:2.1.4--h7e0af3c_0"
}
input:
tuple val(meta), path(bam)
path gtf
output:
tuple val(meta), path("*.coverage.gtf") , emit: coverage_gtf
tuple val(meta), path("*.transcripts.gtf"), emit: transcript_gtf
2021-02-09 23:09:22 +00:00
tuple val(meta), path("*.abundance.txt") , emit: abundance
2020-12-17 23:50:24 +00:00
tuple val(meta), path("*.ballgown") , emit: ballgown
path "*.version.txt" , emit: version
script:
def software = getSoftwareName(task.process)
def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
def strandedness = ''
if (meta.strandedness == 'forward') {
strandedness = '--fr'
} else if (meta.strandedness == 'reverse') {
strandedness = '--rf'
}
"""
stringtie \\
$bam \\
$strandedness \\
-G $gtf \\
-o ${prefix}.transcripts.gtf \\
2021-02-09 23:09:22 +00:00
-A ${prefix}.gene.abundance.txt \\
2020-12-17 23:50:24 +00:00
-C ${prefix}.coverage.gtf \\
-b ${prefix}.ballgown \\
$options.args
stringtie --version > ${software}.version.txt
"""
}