Skip to content

Commit

Permalink
Hisat2-build: index construction w/ truly optional inputs (#3649)
Browse files Browse the repository at this point in the history
* index construction mode dependent on optional inputs rather than memory availability

* added tests for new functionality

* updated tests to use appropriate test data

* cleaned up test.yml to only contain BUILD outputs

* removed unnecessary extract ss call

* added : to empty metamaps. Reverted to sarscov2 test files

---------

Co-authored-by: James A. Fellows Yates <jfy133@gmail.com>
  • Loading branch information
JackCurragh and jfy133 authored Jul 20, 2023
1 parent a174ece commit f2f4883
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 9 deletions.
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

0 comments on commit f2f4883

Please sign in to comment.