Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hisat2-build: index construction w/ truly optional inputs #3649

Merged
merged 8 commits into from
Jul 20, 2023
6 changes: 3 additions & 3 deletions modules/nf-core/hisat2/build/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down
21 changes: 21 additions & 0 deletions tests/modules/nf-core/hisat2/build_test/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
}
60 changes: 54 additions & 6 deletions tests/modules/nf-core/hisat2/build_test/test.yml
Original file line number Diff line number Diff line change
@@ -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
Loading