2020-12-17 23:50:24 +00:00
|
|
|
// Import generic module functions
|
2021-09-27 08:41:24 +00:00
|
|
|
include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions'
|
2020-12-17 23:50:24 +00:00
|
|
|
|
|
|
|
params.options = [:]
|
2021-03-15 12:16:43 +00:00
|
|
|
options = initOptions(params.options)
|
2020-12-17 23:50:24 +00:00
|
|
|
|
|
|
|
process RSEM_PREPAREREFERENCE {
|
|
|
|
tag "$fasta"
|
|
|
|
label 'process_high'
|
|
|
|
publishDir "${params.outdir}",
|
|
|
|
mode: params.publish_dir_mode,
|
2021-04-10 19:49:09 +00:00
|
|
|
saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:'index', meta:[:], publish_by_meta:[]) }
|
2020-12-17 23:50:24 +00:00
|
|
|
|
2021-02-16 23:58:23 +00:00
|
|
|
conda (params.enable_conda ? "bioconda::rsem=1.3.3 bioconda::star=2.7.6a" : null)
|
2020-12-17 23:50:24 +00:00
|
|
|
if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) {
|
|
|
|
container "https://depot.galaxyproject.org/singularity/mulled-v2-cf0123ef83b3c38c13e3b0696a3f285d3f20f15b:606b713ec440e799d53a2b51a6e79dbfd28ecf3e-0"
|
|
|
|
} else {
|
|
|
|
container "quay.io/biocontainers/mulled-v2-cf0123ef83b3c38c13e3b0696a3f285d3f20f15b:606b713ec440e799d53a2b51a6e79dbfd28ecf3e-0"
|
|
|
|
}
|
|
|
|
|
|
|
|
input:
|
2021-04-06 12:38:41 +00:00
|
|
|
path fasta, stageAs: "rsem/*"
|
2020-12-17 23:50:24 +00:00
|
|
|
path gtf
|
|
|
|
|
|
|
|
output:
|
2021-04-06 12:38:41 +00:00
|
|
|
path "rsem" , emit: index
|
|
|
|
path "rsem/*transcripts.fa", emit: transcript_fasta
|
2021-10-01 13:04:56 +00:00
|
|
|
path "versions.yml" , emit: versions
|
2020-12-17 23:50:24 +00:00
|
|
|
|
|
|
|
script:
|
|
|
|
def args = options.args.tokenize()
|
|
|
|
if (args.contains('--star')) {
|
|
|
|
args.removeIf { it.contains('--star') }
|
|
|
|
def memory = task.memory ? "--limitGenomeGenerateRAM ${task.memory.toBytes() - 100000000}" : ''
|
|
|
|
"""
|
|
|
|
STAR \\
|
|
|
|
--runMode genomeGenerate \\
|
|
|
|
--genomeDir rsem/ \\
|
|
|
|
--genomeFastaFiles $fasta \\
|
|
|
|
--sjdbGTFfile $gtf \\
|
|
|
|
--runThreadN $task.cpus \\
|
|
|
|
$memory \\
|
|
|
|
$options.args2
|
|
|
|
|
|
|
|
rsem-prepare-reference \\
|
|
|
|
--gtf $gtf \\
|
|
|
|
--num-threads $task.cpus \\
|
|
|
|
${args.join(' ')} \\
|
|
|
|
$fasta \\
|
|
|
|
rsem/genome
|
|
|
|
|
2021-09-27 08:41:24 +00:00
|
|
|
cat <<-END_VERSIONS > versions.yml
|
|
|
|
${getProcessName(task.process)}:
|
|
|
|
${getSoftwareName(task.process)}: \$(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
|
|
|
"""
|
|
|
|
} else {
|
|
|
|
"""
|
|
|
|
rsem-prepare-reference \\
|
|
|
|
--gtf $gtf \\
|
|
|
|
--num-threads $task.cpus \\
|
|
|
|
$options.args \\
|
|
|
|
$fasta \\
|
|
|
|
rsem/genome
|
|
|
|
|
2021-09-27 08:41:24 +00:00
|
|
|
cat <<-END_VERSIONS > versions.yml
|
|
|
|
${getProcessName(task.process)}:
|
|
|
|
${getSoftwareName(task.process)}: \$(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
|
|
|
"""
|
|
|
|
}
|
|
|
|
}
|