From 8d30e816175e1d447f02542a170e80a2700ffab5 Mon Sep 17 00:00:00 2001 From: Harshil Patel Date: Wed, 25 May 2022 10:46:31 +0100 Subject: [PATCH 1/2] Bump pipeline version to 3.9dev --- CHANGELOG.md | 4 ++++ nextflow.config | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9e015b84f..11977a3a3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unpublished Version / DEV] + +### Enhancements & fixes + ## [[3.8](https://github.com/nf-core/rnaseq/releases/tag/3.8)] - 2022-05-25 ### :warning: Major enhancements diff --git a/nextflow.config b/nextflow.config index 9c9951e64..3b076e8d8 100644 --- a/nextflow.config +++ b/nextflow.config @@ -229,7 +229,7 @@ manifest { description = 'RNA sequencing analysis pipeline for gene/isoform quantification and extensive quality control.' mainScript = 'main.nf' nextflowVersion = '!>=21.10.3' - version = '3.8' + version = '3.9dev' } // Load modules.config for DSL2 module specific options From 17577df4e96bcd6252a8760382a2b1eaa890388f Mon Sep 17 00:00:00 2001 From: Harshil Patel Date: Fri, 27 May 2022 12:56:30 +0100 Subject: [PATCH 2/2] Fix #834 --- CHANGELOG.md | 4 +- conf/modules.config | 4 +- modules.json | 6 ++ modules/local/star_align_igenomes.nf | 73 +++++++++++++++++ modules/local/star_genomegenerate_igenomes.nf | 68 ++++++++++++++++ .../modules/star/align/main.nf} | 16 +--- modules/nf-core/modules/star/align/meta.yml | 81 +++++++++++++++++++ .../modules/star/genomegenerate/main.nf} | 16 +--- .../modules/star/genomegenerate/meta.yml | 37 +++++++++ nextflow.config | 2 +- subworkflows/local/align_star.nf | 56 ++++++++++--- subworkflows/local/prepare_genome.nf | 18 +++-- 12 files changed, 331 insertions(+), 50 deletions(-) create mode 100644 modules/local/star_align_igenomes.nf create mode 100644 modules/local/star_genomegenerate_igenomes.nf rename modules/{local/star_align.nf => nf-core/modules/star/align/main.nf} (79%) create mode 100644 modules/nf-core/modules/star/align/meta.yml rename modules/{local/star_genomegenerate.nf => nf-core/modules/star/genomegenerate/main.nf} (74%) create mode 100644 modules/nf-core/modules/star/genomegenerate/meta.yml diff --git a/CHANGELOG.md b/CHANGELOG.md index 11977a3a3..dc779bbcc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,9 +3,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Unpublished Version / DEV] +## [[3.8.1](https://github.com/nf-core/rnaseq/releases/tag/3.8.1)] - 2022-05-27 -### Enhancements & fixes +- [[#834](https://github.com/nf-core/rnaseq/issues/834)] - `nf-core download` fails with version 3.8 of the pipeline ## [[3.8](https://github.com/nf-core/rnaseq/releases/tag/3.8)] - 2022-05-25 diff --git a/conf/modules.config b/conf/modules.config index 09d1de0f6..64a15f897 100644 --- a/conf/modules.config +++ b/conf/modules.config @@ -58,7 +58,7 @@ process { ext.args2 = '--no-same-owner' } - withName: 'UNTAR_.*|STAR_GENOMEGENERATE|HISAT2_BUILD' { + withName: 'UNTAR_.*|STAR_GENOMEGENERATE|STAR_GENOMEGENERATE_IGENOMES|HISAT2_BUILD' { publishDir = [ path: { "${params.outdir}/genome/index" }, mode: params.publish_dir_mode, @@ -495,7 +495,7 @@ if (!params.skip_alignment) { if (!params.skip_alignment && params.aligner == 'star_salmon') { process { - withName: '.*:ALIGN_STAR:STAR_ALIGN' { + withName: '.*:ALIGN_STAR:STAR_ALIGN|.*:ALIGN_STAR:STAR_ALIGN_IGENOMES' { ext.args = [ '--quantMode TranscriptomeSAM', '--twopassMode Basic', diff --git a/modules.json b/modules.json index b45c1e26a..b0030fe3d 100644 --- a/modules.json +++ b/modules.json @@ -96,6 +96,12 @@ "sortmerna": { "git_sha": "e20e57f90b6787ac9a010a980cf6ea98bd990046" }, + "star/align": { + "git_sha": "fb6c7bca3d55c19a793372513395e3a567bdd7ba" + }, + "star/genomegenerate": { + "git_sha": "fb6c7bca3d55c19a793372513395e3a567bdd7ba" + }, "stringtie/stringtie": { "git_sha": "6d88f2da8cc5d586456e801b535cc4213e0fa2f7" }, diff --git a/modules/local/star_align_igenomes.nf b/modules/local/star_align_igenomes.nf new file mode 100644 index 000000000..acf05ae2c --- /dev/null +++ b/modules/local/star_align_igenomes.nf @@ -0,0 +1,73 @@ +process STAR_ALIGN_IGENOMES { + tag "$meta.id" + label 'process_high' + + conda (params.enable_conda ? "bioconda::star=2.6.1d bioconda::samtools=1.10 conda-forge::gawk=5.1.0" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/mulled-v2-1fa26d1ce03c295fe2fdcf85831a92fbcbd7e8c2:59cdd445419f14abac76b31dd0d71217994cbcc9-0' : + 'quay.io/biocontainers/mulled-v2-1fa26d1ce03c295fe2fdcf85831a92fbcbd7e8c2:59cdd445419f14abac76b31dd0d71217994cbcc9-0' }" + + input: + tuple val(meta), path(reads) + path index + path gtf + val star_ignore_sjdbgtf + val seq_platform + val seq_center + + output: + tuple val(meta), path('*d.out.bam') , emit: bam + tuple val(meta), path('*Log.final.out') , emit: log_final + tuple val(meta), path('*Log.out') , emit: log_out + tuple val(meta), path('*Log.progress.out'), emit: log_progress + path "versions.yml" , emit: versions + + tuple val(meta), path('*sortedByCoord.out.bam') , optional:true, emit: bam_sorted + tuple val(meta), path('*toTranscriptome.out.bam'), optional:true, emit: bam_transcript + tuple val(meta), path('*Aligned.unsort.out.bam') , optional:true, emit: bam_unsorted + tuple val(meta), path('*fastq.gz') , optional:true, emit: fastq + tuple val(meta), path('*.tab') , optional:true, emit: tab + tuple val(meta), path('*.out.junction') , optional:true, emit: junction + tuple val(meta), path('*.out.sam') , optional:true, emit: sam + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def ignore_gtf = star_ignore_sjdbgtf ? '' : "--sjdbGTFfile $gtf" + def seq_platform = seq_platform ? "'PL:$seq_platform'" : "" + def seq_center = seq_center ? "--outSAMattrRGline ID:$prefix 'CN:$seq_center' 'SM:$prefix' $seq_platform " : "--outSAMattrRGline ID:$prefix 'SM:$prefix' $seq_platform " + def out_sam_type = (args.contains('--outSAMtype')) ? '' : '--outSAMtype BAM Unsorted' + def mv_unsorted_bam = (args.contains('--outSAMtype BAM Unsorted SortedByCoordinate')) ? "mv ${prefix}.Aligned.out.bam ${prefix}.Aligned.unsort.out.bam" : '' + """ + STAR \\ + --genomeDir $index \\ + --readFilesIn $reads \\ + --runThreadN $task.cpus \\ + --outFileNamePrefix $prefix. \\ + $out_sam_type \\ + $ignore_gtf \\ + $seq_center \\ + $args + + $mv_unsorted_bam + + if [ -f ${prefix}.Unmapped.out.mate1 ]; then + mv ${prefix}.Unmapped.out.mate1 ${prefix}.unmapped_1.fastq + gzip ${prefix}.unmapped_1.fastq + fi + if [ -f ${prefix}.Unmapped.out.mate2 ]; then + mv ${prefix}.Unmapped.out.mate2 ${prefix}.unmapped_2.fastq + gzip ${prefix}.unmapped_2.fastq + fi + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + star: \$(STAR --version | sed -e "s/STAR_//g") + samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') + gawk: \$(echo \$(gawk --version 2>&1) | sed 's/^.*GNU Awk //; s/, .*\$//') + END_VERSIONS + """ +} diff --git a/modules/local/star_genomegenerate_igenomes.nf b/modules/local/star_genomegenerate_igenomes.nf new file mode 100644 index 000000000..5f1ef50a8 --- /dev/null +++ b/modules/local/star_genomegenerate_igenomes.nf @@ -0,0 +1,68 @@ +process STAR_GENOMEGENERATE_IGENOMES { + tag "$fasta" + label 'process_high' + + conda (params.enable_conda ? "bioconda::star=2.6.1d bioconda::samtools=1.10 conda-forge::gawk=5.1.0" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/mulled-v2-1fa26d1ce03c295fe2fdcf85831a92fbcbd7e8c2:59cdd445419f14abac76b31dd0d71217994cbcc9-0' : + 'quay.io/biocontainers/mulled-v2-1fa26d1ce03c295fe2fdcf85831a92fbcbd7e8c2:59cdd445419f14abac76b31dd0d71217994cbcc9-0' }" + + input: + path fasta + path gtf + + output: + path "star" , emit: index + path "versions.yml", emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + def args_list = args.tokenize() + def memory = task.memory ? "--limitGenomeGenerateRAM ${task.memory.toBytes() - 100000000}" : '' + if (args_list.contains('--genomeSAindexNbases')) { + """ + mkdir star + STAR \\ + --runMode genomeGenerate \\ + --genomeDir star/ \\ + --genomeFastaFiles $fasta \\ + --sjdbGTFfile $gtf \\ + --runThreadN $task.cpus \\ + $memory \\ + $args + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + star: \$(STAR --version | sed -e "s/STAR_//g") + samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') + gawk: \$(echo \$(gawk --version 2>&1) | sed 's/^.*GNU Awk //; s/, .*\$//') + END_VERSIONS + """ + } else { + """ + samtools faidx $fasta + NUM_BASES=`gawk '{sum = sum + \$2}END{if ((log(sum)/log(2))/2 - 1 > 14) {printf "%.0f", 14} else {printf "%.0f", (log(sum)/log(2))/2 - 1}}' ${fasta}.fai` + + mkdir star + STAR \\ + --runMode genomeGenerate \\ + --genomeDir star/ \\ + --genomeFastaFiles $fasta \\ + --sjdbGTFfile $gtf \\ + --runThreadN $task.cpus \\ + --genomeSAindexNbases \$NUM_BASES \\ + $memory \\ + $args + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + star: \$(STAR --version | sed -e "s/STAR_//g") + samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') + gawk: \$(echo \$(gawk --version 2>&1) | sed 's/^.*GNU Awk //; s/, .*\$//') + END_VERSIONS + """ + } +} diff --git a/modules/local/star_align.nf b/modules/nf-core/modules/star/align/main.nf similarity index 79% rename from modules/local/star_align.nf rename to modules/nf-core/modules/star/align/main.nf index 356d17200..e5aa36f56 100644 --- a/modules/local/star_align.nf +++ b/modules/nf-core/modules/star/align/main.nf @@ -2,10 +2,10 @@ process STAR_ALIGN { tag "$meta.id" label 'process_high' - conda (params.enable_conda ? conda_str : null) + conda (params.enable_conda ? "bioconda::star=2.7.10a bioconda::samtools=1.15.1 conda-forge::gawk=5.1.0" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - "https://depot.galaxyproject.org/singularity/${container_id}" : - "quay.io/biocontainers/${container_id}" }" + 'https://depot.galaxyproject.org/singularity/mulled-v2-1fa26d1ce03c295fe2fdcf85831a92fbcbd7e8c2:afaaa4c6f5b308b4b6aa2dd8e99e1466b2a6b0cd-0' : + 'quay.io/biocontainers/mulled-v2-1fa26d1ce03c295fe2fdcf85831a92fbcbd7e8c2:afaaa4c6f5b308b4b6aa2dd8e99e1466b2a6b0cd-0' }" input: tuple val(meta), path(reads) @@ -14,7 +14,6 @@ process STAR_ALIGN { val star_ignore_sjdbgtf val seq_platform val seq_center - val is_aws_igenome output: tuple val(meta), path('*d.out.bam') , emit: bam @@ -37,15 +36,6 @@ process STAR_ALIGN { script: def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" - - // Note: 2.7X indices incompatible with AWS iGenomes so use older STAR version - conda_str = "bioconda::star=2.7.10a bioconda::samtools=1.15.1 conda-forge::gawk=5.1.0" - container_id = 'mulled-v2-1fa26d1ce03c295fe2fdcf85831a92fbcbd7e8c2:afaaa4c6f5b308b4b6aa2dd8e99e1466b2a6b0cd-0' - if (is_aws_igenome) { - conda_str = "bioconda::star=2.6.1d bioconda::samtools=1.10 conda-forge::gawk=5.1.0" - container_id = 'mulled-v2-1fa26d1ce03c295fe2fdcf85831a92fbcbd7e8c2:59cdd445419f14abac76b31dd0d71217994cbcc9-0' - } - def ignore_gtf = star_ignore_sjdbgtf ? '' : "--sjdbGTFfile $gtf" def seq_platform = seq_platform ? "'PL:$seq_platform'" : "" def seq_center = seq_center ? "--outSAMattrRGline ID:$prefix 'CN:$seq_center' 'SM:$prefix' $seq_platform " : "--outSAMattrRGline ID:$prefix 'SM:$prefix' $seq_platform " diff --git a/modules/nf-core/modules/star/align/meta.yml b/modules/nf-core/modules/star/align/meta.yml new file mode 100644 index 000000000..7ee10f1cc --- /dev/null +++ b/modules/nf-core/modules/star/align/meta.yml @@ -0,0 +1,81 @@ +name: star_align +description: Align reads to a reference genome using STAR +keywords: + - align + - fasta + - genome + - reference +tools: + - star: + description: | + STAR is a software package for mapping DNA sequences against + a large reference genome, such as the human genome. + homepage: https://github.com/alexdobin/STAR + manual: https://github.com/alexdobin/STAR/blob/master/doc/STARmanual.pdf + doi: 10.1093/bioinformatics/bts635 + licence: ["MIT"] +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - reads: + type: file + description: | + List of input FastQ files of size 1 and 2 for single-end and paired-end data, + respectively. + - index: + type: directory + description: STAR genome index + pattern: "star" +output: + - bam: + type: file + description: Output BAM file containing read alignments + pattern: "*.{bam}" + - log_final: + type: file + description: STAR final log file + pattern: "*Log.final.out" + - log_out: + type: file + description: STAR lot out file + pattern: "*Log.out" + - log_progress: + type: file + description: STAR log progress file + pattern: "*Log.progress.out" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + - bam_sorted: + type: file + description: Sorted BAM file of read alignments (optional) + pattern: "*sortedByCoord.out.bam" + - bam_transcript: + type: file + description: Output BAM file of transcriptome alignment (optional) + pattern: "*toTranscriptome.out.bam" + - bam_unsorted: + type: file + description: Unsorted BAM file of read alignments (optional) + pattern: "*Aligned.unsort.out.bam" + - fastq: + type: file + description: Unmapped FastQ files (optional) + pattern: "*fastq.gz" + - tab: + type: file + description: STAR output tab file(s) (optional) + pattern: "*.tab" + - junction: + type: file + description: STAR chimeric junction output file (optional) + pattern: "*.out.junction" + +authors: + - "@kevinmenden" + - "@drpatelh" + - "@praveenraj2018" diff --git a/modules/local/star_genomegenerate.nf b/modules/nf-core/modules/star/genomegenerate/main.nf similarity index 74% rename from modules/local/star_genomegenerate.nf rename to modules/nf-core/modules/star/genomegenerate/main.nf index e59a55dc5..3c298016f 100644 --- a/modules/local/star_genomegenerate.nf +++ b/modules/nf-core/modules/star/genomegenerate/main.nf @@ -2,15 +2,14 @@ process STAR_GENOMEGENERATE { tag "$fasta" label 'process_high' - conda (params.enable_conda ? conda_str : null) + conda (params.enable_conda ? "bioconda::star=2.7.10a bioconda::samtools=1.15.1 conda-forge::gawk=5.1.0" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - "https://depot.galaxyproject.org/singularity/${container_id}" : - "quay.io/biocontainers/${container_id}" }" + 'https://depot.galaxyproject.org/singularity/mulled-v2-1fa26d1ce03c295fe2fdcf85831a92fbcbd7e8c2:afaaa4c6f5b308b4b6aa2dd8e99e1466b2a6b0cd-0' : + 'quay.io/biocontainers/mulled-v2-1fa26d1ce03c295fe2fdcf85831a92fbcbd7e8c2:afaaa4c6f5b308b4b6aa2dd8e99e1466b2a6b0cd-0' }" input: path fasta path gtf - val is_aws_igenome output: path "star" , emit: index @@ -22,15 +21,6 @@ process STAR_GENOMEGENERATE { script: def args = task.ext.args ?: '' def args_list = args.tokenize() - - // Note: 2.7X indices incompatible with AWS iGenomes so use older STAR version - conda_str = "bioconda::star=2.7.10a bioconda::samtools=1.15.1 conda-forge::gawk=5.1.0" - container_id = 'mulled-v2-1fa26d1ce03c295fe2fdcf85831a92fbcbd7e8c2:afaaa4c6f5b308b4b6aa2dd8e99e1466b2a6b0cd-0' - if (is_aws_igenome) { - conda_str = "bioconda::star=2.6.1d bioconda::samtools=1.10 conda-forge::gawk=5.1.0" - container_id = 'mulled-v2-1fa26d1ce03c295fe2fdcf85831a92fbcbd7e8c2:59cdd445419f14abac76b31dd0d71217994cbcc9-0' - } - def memory = task.memory ? "--limitGenomeGenerateRAM ${task.memory.toBytes() - 100000000}" : '' if (args_list.contains('--genomeSAindexNbases')) { """ diff --git a/modules/nf-core/modules/star/genomegenerate/meta.yml b/modules/nf-core/modules/star/genomegenerate/meta.yml new file mode 100644 index 000000000..8181157a1 --- /dev/null +++ b/modules/nf-core/modules/star/genomegenerate/meta.yml @@ -0,0 +1,37 @@ +name: star_genomegenerate +description: Create index for STAR +keywords: + - index + - fasta + - genome + - reference +tools: + - star: + description: | + STAR is a software package for mapping DNA sequences against + a large reference genome, such as the human genome. + homepage: https://github.com/alexdobin/STAR + manual: https://github.com/alexdobin/STAR/blob/master/doc/STARmanual.pdf + doi: 10.1093/bioinformatics/bts635 + licence: ["MIT"] +input: + - fasta: + type: file + description: Fasta file of the reference genome + - gtf: + type: file + description: GTF file of the reference genome + +output: + - index: + type: directory + description: Folder containing the star index files + pattern: "star" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + +authors: + - "@kevinmenden" + - "@drpatelh" diff --git a/nextflow.config b/nextflow.config index 3b076e8d8..5a681fedd 100644 --- a/nextflow.config +++ b/nextflow.config @@ -229,7 +229,7 @@ manifest { description = 'RNA sequencing analysis pipeline for gene/isoform quantification and extensive quality control.' mainScript = 'main.nf' nextflowVersion = '!>=21.10.3' - version = '3.9dev' + version = '3.8.1' } // Load modules.config for DSL2 module specific options diff --git a/subworkflows/local/align_star.nf b/subworkflows/local/align_star.nf index 684df7a4d..f4fd57e1e 100644 --- a/subworkflows/local/align_star.nf +++ b/subworkflows/local/align_star.nf @@ -2,8 +2,9 @@ // Alignment with STAR // -include { STAR_ALIGN } from '../../modules/local/star_align' -include { BAM_SORT_SAMTOOLS } from '../nf-core/bam_sort_samtools' +include { STAR_ALIGN } from '../../modules/nf-core/modules/star/align/main' +include { STAR_ALIGN_IGENOMES } from '../../modules/local/star_align_igenomes' +include { BAM_SORT_SAMTOOLS } from '../nf-core/bam_sort_samtools' workflow ALIGN_STAR { take: @@ -22,24 +23,53 @@ workflow ALIGN_STAR { // // Map reads with STAR // - STAR_ALIGN ( reads, index, gtf, star_ignore_sjdbgtf, seq_platform, seq_center, is_aws_igenome ) - ch_versions = ch_versions.mix(STAR_ALIGN.out.versions.first()) + ch_orig_bam = Channel.empty() + ch_log_final = Channel.empty() + ch_log_out = Channel.empty() + ch_log_progress = Channel.empty() + ch_bam_sorted = Channel.empty() + ch_bam_transcript = Channel.empty() + ch_fastq = Channel.empty() + ch_tab = Channel.empty() + if (is_aws_igenome) { + STAR_ALIGN_IGENOMES ( reads, index, gtf, star_ignore_sjdbgtf, seq_platform, seq_center ) + ch_orig_bam = STAR_ALIGN_IGENOMES.out.bam + ch_log_final = STAR_ALIGN_IGENOMES.out.log_final + ch_log_out = STAR_ALIGN_IGENOMES.out.log_out + ch_log_progress = STAR_ALIGN_IGENOMES.out.log_progress + ch_bam_sorted = STAR_ALIGN_IGENOMES.out.bam_sorted + ch_bam_transcript = STAR_ALIGN_IGENOMES.out.bam_transcript + ch_fastq = STAR_ALIGN_IGENOMES.out.fastq + ch_tab = STAR_ALIGN_IGENOMES.out.tab + ch_versions = ch_versions.mix(STAR_ALIGN_IGENOMES.out.versions.first()) + } else { + STAR_ALIGN ( reads, index, gtf, star_ignore_sjdbgtf, seq_platform, seq_center ) + ch_orig_bam = STAR_ALIGN.out.bam + ch_log_final = STAR_ALIGN.out.log_final + ch_log_out = STAR_ALIGN.out.log_out + ch_log_progress = STAR_ALIGN.out.log_progress + ch_bam_sorted = STAR_ALIGN.out.bam_sorted + ch_bam_transcript = STAR_ALIGN.out.bam_transcript + ch_fastq = STAR_ALIGN.out.fastq + ch_tab = STAR_ALIGN.out.tab + ch_versions = ch_versions.mix(STAR_ALIGN.out.versions.first()) + } // // Sort, index BAM file and run samtools stats, flagstat and idxstats // - BAM_SORT_SAMTOOLS ( STAR_ALIGN.out.bam ) + BAM_SORT_SAMTOOLS ( ch_orig_bam ) ch_versions = ch_versions.mix(BAM_SORT_SAMTOOLS.out.versions) emit: - orig_bam = STAR_ALIGN.out.bam // channel: [ val(meta), bam ] - log_final = STAR_ALIGN.out.log_final // channel: [ val(meta), log_final ] - log_out = STAR_ALIGN.out.log_out // channel: [ val(meta), log_out ] - log_progress = STAR_ALIGN.out.log_progress // channel: [ val(meta), log_progress ] - bam_sorted = STAR_ALIGN.out.bam_sorted // channel: [ val(meta), bam_sorted ] - bam_transcript = STAR_ALIGN.out.bam_transcript // channel: [ val(meta), bam_transcript ] - fastq = STAR_ALIGN.out.fastq // channel: [ val(meta), fastq ] - tab = STAR_ALIGN.out.tab // channel: [ val(meta), tab ] + orig_bam = ch_orig_bam // channel: [ val(meta), bam ] + log_final = ch_log_final // channel: [ val(meta), log_final ] + log_out = ch_log_out // channel: [ val(meta), log_out ] + log_progress = ch_log_progress // channel: [ val(meta), log_progress ] + bam_sorted = ch_bam_sorted // channel: [ val(meta), bam_sorted ] + bam_transcript = ch_bam_transcript // channel: [ val(meta), bam_transcript ] + fastq = ch_fastq // channel: [ val(meta), fastq ] + tab = ch_tab // channel: [ val(meta), tab ] bam = BAM_SORT_SAMTOOLS.out.bam // channel: [ val(meta), [ bam ] ] bai = BAM_SORT_SAMTOOLS.out.bai // channel: [ val(meta), [ bai ] ] diff --git a/subworkflows/local/prepare_genome.nf b/subworkflows/local/prepare_genome.nf index 60f7062b3..97d12577a 100644 --- a/subworkflows/local/prepare_genome.nf +++ b/subworkflows/local/prepare_genome.nf @@ -18,16 +18,17 @@ include { UNTAR as UNTAR_SALMON_INDEX } from '../../modules/nf-core/module include { CUSTOM_GETCHROMSIZES } from '../../modules/nf-core/modules/custom/getchromsizes/main' include { GFFREAD } from '../../modules/nf-core/modules/gffread/main' include { BBMAP_BBSPLIT } from '../../modules/nf-core/modules/bbmap/bbsplit/main' +include { STAR_GENOMEGENERATE } from '../../modules/nf-core/modules/star/genomegenerate/main' include { HISAT2_EXTRACTSPLICESITES } from '../../modules/nf-core/modules/hisat2/extractsplicesites/main' include { HISAT2_BUILD } from '../../modules/nf-core/modules/hisat2/build/main' include { SALMON_INDEX } from '../../modules/nf-core/modules/salmon/index/main' include { RSEM_PREPAREREFERENCE as RSEM_PREPAREREFERENCE_GENOME } from '../../modules/nf-core/modules/rsem/preparereference/main' include { RSEM_PREPAREREFERENCE as MAKE_TRANSCRIPTS_FASTA } from '../../modules/nf-core/modules/rsem/preparereference/main' -include { GTF2BED } from '../../modules/local/gtf2bed' -include { CAT_ADDITIONAL_FASTA } from '../../modules/local/cat_additional_fasta' -include { GTF_GENE_FILTER } from '../../modules/local/gtf_gene_filter' -include { STAR_GENOMEGENERATE } from '../../modules/local/star_genomegenerate' +include { GTF2BED } from '../../modules/local/gtf2bed' +include { CAT_ADDITIONAL_FASTA } from '../../modules/local/cat_additional_fasta' +include { GTF_GENE_FILTER } from '../../modules/local/gtf_gene_filter' +include { STAR_GENOMEGENERATE_IGENOMES } from '../../modules/local/star_genomegenerate_igenomes' workflow PREPARE_GENOME { take: @@ -166,8 +167,13 @@ workflow PREPARE_GENOME { ch_star_index = file(params.star_index) } } else { - ch_star_index = STAR_GENOMEGENERATE ( ch_fasta, ch_gtf, is_aws_igenome ).index - ch_versions = ch_versions.mix(STAR_GENOMEGENERATE.out.versions) + if (is_aws_igenome) { + ch_star_index = STAR_GENOMEGENERATE_IGENOMES ( ch_fasta, ch_gtf ).index + ch_versions = ch_versions.mix(STAR_GENOMEGENERATE_IGENOMES.out.versions) + } else { + ch_star_index = STAR_GENOMEGENERATE ( ch_fasta, ch_gtf ).index + ch_versions = ch_versions.mix(STAR_GENOMEGENERATE.out.versions) + } } }