diff --git a/modules/nf-core/hisat2/build/main.nf b/modules/nf-core/hisat2/build/main.nf index 5ad36a548d2..90f8efcc63f 100644 --- a/modules/nf-core/hisat2/build/main.nf +++ b/modules/nf-core/hisat2/build/main.nf @@ -37,9 +37,9 @@ process HISAT2_BUILD { def hisat2_build_memory = params.hisat2_build_memory ? (params.hisat2_build_memory as nextflow.util.MemoryUnit).toGiga() : 0 if (avail_mem >= hisat2_build_memory) { log.info "[HISAT2 index build] At least ${hisat2_build_memory} GB available, so using splice sites and exons to build HISAT2 index" - extract_exons = "hisat2_extract_exons.py $gtf > ${gtf.baseName}.exons.txt" - ss = "--ss $splicesites" - exon = "--exon ${gtf.baseName}.exons.txt" + extract_exons = gtf ? "hisat2_extract_exons.py $gtf > ${gtf.baseName}.exons.txt" : "" + ss = splicesites ? "--ss $splicesites" : "" + exon = gtf ? "--exon ${gtf.baseName}.exons.txt" : "" } else { log.info "[HISAT2 index build] Less than ${hisat2_build_memory} GB available, so NOT using splice sites and exons to build HISAT2 index." log.info "[HISAT2 index build] Use --hisat2_build_memory [small number] to skip this check." diff --git a/tests/modules/nf-core/hisat2/build_test/main.nf b/tests/modules/nf-core/hisat2/build_test/main.nf index 6f4eb6809f3..3a8192776f7 100644 --- a/tests/modules/nf-core/hisat2/build_test/main.nf +++ b/tests/modules/nf-core/hisat2/build_test/main.nf @@ -15,3 +15,24 @@ workflow test_hisat2_build { HISAT2_EXTRACTSPLICESITES ( gtf ) HISAT2_BUILD ( fasta, gtf, HISAT2_EXTRACTSPLICESITES.out.txt ) } + +workflow test_hisat2_build_fasta_only { + fasta = [ [id:'genome'], + file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + ] + gtf = [ [id:'genome'], + file(params.test_data['sarscov2']['genome']['genome_gtf'], checkIfExists: true) + ] + HISAT2_BUILD ( fasta, [[:],[]], [[:],[]] ) +} + +workflow test_hisat2_build_fasta_ss_only { + fasta = [ [id:'genome'], + file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + ] + gtf = [ [id:'genome'], + file(params.test_data['sarscov2']['genome']['genome_gtf'], checkIfExists: true) + ] + HISAT2_EXTRACTSPLICESITES ( gtf ) + HISAT2_BUILD ( fasta, [[:],[]], HISAT2_EXTRACTSPLICESITES.out.txt ) +} \ No newline at end of file diff --git a/tests/modules/nf-core/hisat2/build_test/test.yml b/tests/modules/nf-core/hisat2/build_test/test.yml index ba6702aeead..69a3961dc02 100644 --- a/tests/modules/nf-core/hisat2/build_test/test.yml +++ b/tests/modules/nf-core/hisat2/build_test/test.yml @@ -1,23 +1,71 @@ - name: hisat2 build test_hisat2_build - command: nextflow run ./tests/modules/nf-core/hisat2/build_test -entry test_hisat2_build -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/hisat2/build/nextflow.config + command: nextflow run ./tests/modules/nf-core/hisat2/build -entry test_hisat2_build -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/hisat2/build/nextflow.config tags: - - hisat2 - hisat2/build + - hisat2 files: - - path: output/hisat2/genome.splice_sites.txt + - path: output/hisat2/hisat2/genome.1.ht2 + md5sum: 057cfa8a22b97ee9cff4c8d342498803 + - path: output/hisat2/hisat2/genome.2.ht2 + md5sum: 47b153cd1319abc88dda532462651fcf + - path: output/hisat2/hisat2/genome.3.ht2 + md5sum: 4ed93abba181d8dfab2e303e33114777 + - path: output/hisat2/hisat2/genome.4.ht2 + md5sum: c25be5f8b0378abf7a58c8a880b87626 - path: output/hisat2/hisat2/genome.5.ht2 md5sum: 91198831aaba993acac1734138c5f173 + - path: output/hisat2/hisat2/genome.6.ht2 + md5sum: 265e1284ce85686516fae5d35540994a - path: output/hisat2/hisat2/genome.7.ht2 md5sum: 9013eccd91ad614d7893c739275a394f + - path: output/hisat2/hisat2/genome.8.ht2 + md5sum: 33cdeccccebe80329f1fdbee7f5874cb + - path: output/hisat2/versions.yml + +- name: hisat2 build test_hisat2_build_fasta_only + command: nextflow run ./tests/modules/nf-core/hisat2/build -entry test_hisat2_build_fasta_only -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/hisat2/build/nextflow.config + tags: + - hisat2/build + - hisat2 + files: - path: output/hisat2/hisat2/genome.1.ht2 - md5sum: 057cfa8a22b97ee9cff4c8d342498803 + md5sum: 98284d11e09faba5be6caeacceae7b3c - path: output/hisat2/hisat2/genome.2.ht2 md5sum: 47b153cd1319abc88dda532462651fcf - - path: output/hisat2/hisat2/genome.6.ht2 - md5sum: 265e1284ce85686516fae5d35540994a - path: output/hisat2/hisat2/genome.3.ht2 md5sum: 4ed93abba181d8dfab2e303e33114777 + - path: output/hisat2/hisat2/genome.4.ht2 + md5sum: c25be5f8b0378abf7a58c8a880b87626 + - path: output/hisat2/hisat2/genome.5.ht2 + md5sum: 4db21638bce5ab535147c14a8c5ed27b + - path: output/hisat2/hisat2/genome.6.ht2 + md5sum: 265e1284ce85686516fae5d35540994a + - path: output/hisat2/hisat2/genome.7.ht2 + md5sum: 9013eccd91ad614d7893c739275a394f - path: output/hisat2/hisat2/genome.8.ht2 md5sum: 33cdeccccebe80329f1fdbee7f5874cb + - path: output/hisat2/versions.yml + +- name: hisat2 build test_hisat2_build_fasta_ss_only + command: nextflow run ./tests/modules/nf-core/hisat2/build -entry test_hisat2_build_fasta_ss_only -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/hisat2/build/nextflow.config + tags: + - hisat2/build + - hisat2 + files: + - path: output/hisat2/hisat2/genome.1.ht2 + md5sum: 057cfa8a22b97ee9cff4c8d342498803 + - path: output/hisat2/hisat2/genome.2.ht2 + md5sum: 47b153cd1319abc88dda532462651fcf + - path: output/hisat2/hisat2/genome.3.ht2 + md5sum: 4ed93abba181d8dfab2e303e33114777 - path: output/hisat2/hisat2/genome.4.ht2 md5sum: c25be5f8b0378abf7a58c8a880b87626 + - path: output/hisat2/hisat2/genome.5.ht2 + md5sum: 91198831aaba993acac1734138c5f173 + - path: output/hisat2/hisat2/genome.6.ht2 + md5sum: 265e1284ce85686516fae5d35540994a + - path: output/hisat2/hisat2/genome.7.ht2 + md5sum: 9013eccd91ad614d7893c739275a394f + - path: output/hisat2/hisat2/genome.8.ht2 + md5sum: 33cdeccccebe80329f1fdbee7f5874cb + - path: output/hisat2/versions.yml