Skip to content

Commit

Permalink
update hifiasm module to support --ul with ONT reads (#7336)
Browse files Browse the repository at this point in the history
* update hifiasm module to support --ul with ONT reads

* update meta.yml with new inputs

* update test

* renamed reads to reads_hifi

* use correct variable

* long_reads and ul_reads as inputs

* long_reads and ul_reads as inputs

---------

Co-authored-by: Matthias Hörtenhuber <[email protected]>
  • Loading branch information
nschan and mashehu authored Jan 20, 2025
1 parent 25ddc0b commit ea86101
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 14 deletions.
13 changes: 9 additions & 4 deletions modules/nf-core/hifiasm/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ process HIFIASM {
'biocontainers/hifiasm:0.24.0--h5ca1c30_0' }"

input:
tuple val(meta) , path(reads)
tuple val(meta) , path(long_reads) , path(ul_reads)
tuple val(meta1), path(paternal_kmer_dump), path(maternal_kmer_dump)
tuple val(meta2), path(hic_read1) , path(hic_read2)

Expand All @@ -32,6 +32,8 @@ process HIFIASM {
script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def ultralong = ul_reads ? "--ul ${ul_reads}" : ""

if ((paternal_kmer_dump) && (maternal_kmer_dump) && (hic_read1) && (hic_read2)) {
error "Hifiasm Trio-binning and Hi-C integrated should not be used at the same time"
} else if ((paternal_kmer_dump) && !(maternal_kmer_dump)) {
Expand All @@ -46,7 +48,8 @@ process HIFIASM {
-t $task.cpus \\
-1 $paternal_kmer_dump \\
-2 $maternal_kmer_dump \\
$reads \\
$ultralong \\
$long_reads \\
2> >( tee ${prefix}.stderr.log >&2 )
Expand All @@ -67,7 +70,8 @@ process HIFIASM {
-t $task.cpus \\
--h1 $hic_read1 \\
--h2 $hic_read2 \\
$reads \\
$ultralong \\
$long_reads \\
2> >( tee ${prefix}.stderr.log >&2 )
Expand All @@ -82,7 +86,8 @@ process HIFIASM {
$args \\
-o ${prefix}.asm \\
-t $task.cpus \\
$reads \\
$ultralong \\
$long_reads \\
2> >( tee ${prefix}.stderr.log >&2 )
cat <<-END_VERSIONS > versions.yml
Expand Down
8 changes: 5 additions & 3 deletions modules/nf-core/hifiasm/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@ input:
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- reads:
- long_reads:
type: file
description: FASTQ file with PacBio HiFi reads
pattern: "*.{fastq}"
description: Long reads PacBio HiFi reads or ONT reads (requires ext.arg '--ont').
- ul_reads:
type: file
description: ONT long reads to use with --ul.
- - meta1:
type: map
description: |
Expand Down
21 changes: 14 additions & 7 deletions modules/nf-core/hifiasm/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ nextflow_process {
"""
input[0] = [
[ id : 'test'],
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/fastq/test_hifi.fastq.gz', checkIfExists: true)
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/fastq/test_hifi.fastq.gz', checkIfExists: true),
[]
]
input[1] = [
[],
Expand Down Expand Up @@ -55,7 +56,8 @@ nextflow_process {
"""
input[0] = [
[ id : 'test'],
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/fastq/test_hifi.fastq.gz', checkIfExists: true)
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/fastq/test_hifi.fastq.gz', checkIfExists: true),
[]
]
input[1] = [
[ id : 'test' ],
Expand Down Expand Up @@ -94,7 +96,8 @@ nextflow_process {
"""
input[0] = [
[ id : 'test'],
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/fastq/test_hifi.fastq.gz', checkIfExists: true)
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/fastq/test_hifi.fastq.gz', checkIfExists: true),
[]
]
input[1] = [
[ id : 'test' ],
Expand Down Expand Up @@ -132,7 +135,8 @@ nextflow_process {
"""
input[0] = [
[ id : 'test'],
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/fastq/test_hifi.fastq.gz', checkIfExists: true)
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/fastq/test_hifi.fastq.gz', checkIfExists: true),
[]
]
input[1] = [
[ id : 'test' ],
Expand All @@ -158,7 +162,8 @@ nextflow_process {
"""
input[0] = [
[ id : 'test'],
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/fastq/test_hifi.fastq.gz', checkIfExists: true)
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/fastq/test_hifi.fastq.gz', checkIfExists: true),
[]
]
input[1] = [
[ id : 'test'],
Expand All @@ -180,7 +185,8 @@ nextflow_process {
"""
input[0] = [
[ id : 'test'],
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/fastq/test_hifi.fastq.gz', checkIfExists: true)
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/fastq/test_hifi.fastq.gz', checkIfExists: true),
[]
]
input[1] = []
input[2] = [
Expand All @@ -204,7 +210,8 @@ nextflow_process {
"""
input[0] = [
[ id : 'test'],
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/fastq/test_hifi.fastq.gz', checkIfExists: true)
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/fastq/test_hifi.fastq.gz', checkIfExists: true),
[]
]
input[1] = [
[],
Expand Down

0 comments on commit ea86101

Please sign in to comment.