diff --git a/modules/bowtie2/align/main.nf b/modules/bowtie2/align/main.nf index 20b08f72..e68dbf24 100644 --- a/modules/bowtie2/align/main.nf +++ b/modules/bowtie2/align/main.nf @@ -26,6 +26,8 @@ process BOWTIE2_ALIGN { def unaligned = save_unaligned ? "--un-gz ${prefix}.unmapped.fastq.gz" : '' """ INDEX=`find -L ./ -name "*.rev.1.bt2" | sed 's/.rev.1.bt2//'` + [ -z "\$INDEX" ] && INDEX=`find -L ./ -name "*.rev.1.bt2l" | sed 's/.rev.1.bt2l//'` + [ -z "\$INDEX" ] && echo "BT2 index files not found" 1>&2 && exit 1 bowtie2 \\ -x \$INDEX \\ -U $reads \\ @@ -46,6 +48,8 @@ process BOWTIE2_ALIGN { def unaligned = save_unaligned ? "--un-conc-gz ${prefix}.unmapped.fastq.gz" : '' """ INDEX=`find -L ./ -name "*.rev.1.bt2" | sed 's/.rev.1.bt2//'` + [ -z "\$INDEX" ] && INDEX=`find -L ./ -name "*.rev.1.bt2l" | sed 's/.rev.1.bt2l//'` + [ -z "\$INDEX" ] && echo "BT2 index files not found" 1>&2 && exit 1 bowtie2 \\ -x \$INDEX \\ -1 ${reads[0]} \\ diff --git a/tests/modules/bowtie2/align/main.nf b/tests/modules/bowtie2/align/main.nf index 2d3945e5..f91394ff 100644 --- a/tests/modules/bowtie2/align/main.nf +++ b/tests/modules/bowtie2/align/main.nf @@ -32,4 +32,4 @@ workflow test_bowtie2_align_paired_end { BOWTIE2_BUILD ( fasta ) BOWTIE2_ALIGN ( input, BOWTIE2_BUILD.out.index, save_unaligned ) -} +} \ No newline at end of file diff --git a/tests/modules/bowtie2/align/nextflow.config b/tests/modules/bowtie2/align/nextflow.config index 8730f1c4..b4640de7 100644 --- a/tests/modules/bowtie2/align/nextflow.config +++ b/tests/modules/bowtie2/align/nextflow.config @@ -1,5 +1,16 @@ +params { + force_large_index = false +} + process { publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } - +} + +if (params.force_large_index) { + process { + withName: BOWTIE2_BUILD { + ext.args = '--large-index' + } + } } diff --git a/tests/modules/bowtie2/align/test.yml b/tests/modules/bowtie2/align/test.yml index 95d48b88..11e4c4e5 100644 --- a/tests/modules/bowtie2/align/test.yml +++ b/tests/modules/bowtie2/align/test.yml @@ -39,3 +39,46 @@ md5sum: 52be6950579598a990570fbcf5372184 - path: ./output/bowtie2/bowtie2/genome.rev.2.bt2 md5sum: e3b4ef343dea4dd571642010a7d09597 + +- name: bowtie2 align single-end large-index + command: nextflow run ./tests/modules/bowtie2/align -entry test_bowtie2_align_single_end -c ./tests/config/nextflow.config -c ./tests/modules/bowtie2/align/nextflow.config --force_large_index + tags: + tags: + - bowtie2 + - bowtie2/align + files: + - path: ./output/bowtie2/test.bam + - path: ./output/bowtie2/test.bowtie2.log + - path: ./output/bowtie2/bowtie2/genome.3.bt2 + md5sum: 8952b3e0b1ce9a7a5916f2e147180853 + - path: ./output/bowtie2/bowtie2/genome.2.bt2 + md5sum: 22c284084784a0720989595e0c9461fd + - path: ./output/bowtie2/bowtie2/genome.1.bt2 + md5sum: 07d811cd4e350d56267183d2ac7023a5 + - path: ./output/bowtie2/bowtie2/genome.4.bt2 + md5sum: c25be5f8b0378abf7a58c8a880b87626 + - path: ./output/bowtie2/bowtie2/genome.rev.1.bt2 + md5sum: fda48e35925fb24d1c0785f021981e25 + - path: ./output/bowtie2/bowtie2/genome.rev.2.bt2 + md5sum: 802c26d32b970e1b105032b7ce7348b4 + +- name: bowtie2 align paired-end large-index + command: nextflow run ./tests/modules/bowtie2/align -entry test_bowtie2_align_paired_end -c ./tests/config/nextflow.config -c ./tests/modules/bowtie2/align/nextflow.config --force_large_index + tags: + - bowtie2 + - bowtie2/align + files: + - path: ./output/bowtie2/test.bam + - path: ./output/bowtie2/test.bowtie2.log + - path: ./output/bowtie2/bowtie2/genome.3.bt2l + md5sum: 8952b3e0b1ce9a7a5916f2e147180853 + - path: ./output/bowtie2/bowtie2/genome.2.bt2l + md5sum: 22c284084784a0720989595e0c9461fd + - path: ./output/bowtie2/bowtie2/genome.1.bt2l + md5sum: 07d811cd4e350d56267183d2ac7023a5 + - path: ./output/bowtie2/bowtie2/genome.4.bt2l + md5sum: c25be5f8b0378abf7a58c8a880b87626 + - path: ./output/bowtie2/bowtie2/genome.rev.1.bt2l + md5sum: fda48e35925fb24d1c0785f021981e25 + - path: ./output/bowtie2/bowtie2/genome.rev.2.bt2l + md5sum: 802c26d32b970e1b105032b7ce7348b4