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

Mitohifi channel input #4254

Merged
merged 6 commits into from
Nov 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions modules/nf-core/mitohifi/mitohifi/environment.yml

This file was deleted.

9 changes: 4 additions & 5 deletions modules/nf-core/mitohifi/mitohifi/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ process MITOHIFI_MITOHIFI {
tuple val(meta), path(input)
path ref_fa
path ref_gb
val input_mode
val mito_code

output:
Expand Down Expand Up @@ -41,13 +42,11 @@ process MITOHIFI_MITOHIFI {
}

def args = task.ext.args ?: ''
def args2 = task.ext.args2 ?: ''
if (! ["-c", "-r"].contains(args2)) {
error "-r for reads or -c for contigs must be specified"
if (! ["c", "r"].contains(input_mode)) {
error "r for reads or c for contigs must be specified"
}
def script_input = "${args2} ${input}"
"""
mitohifi.py ${script_input} \\
mitohifi.py -${input_mode} ${input} \\
-f ${ref_fa} \\
-g ${ref_gb} \\
-o ${mito_code} \\
Expand Down
4 changes: 4 additions & 0 deletions modules/nf-core/mitohifi/mitohifi/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ input:
type: file
description: Reference annotation
pattern: "*.{gb}"
- input_mode:
muffato marked this conversation as resolved.
Show resolved Hide resolved
type: string
description: Specifies type of input - reads or contigs
pattern: "{r,c}"
- code:
type: integer
description: Mitochndrial code for annotation
Expand Down
6 changes: 4 additions & 2 deletions tests/modules/nf-core/mitohifi/mitohifi/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ workflow test_mitohifi_mitohifi_contigs {
data_contigs = Channel.of([[id:"ilDeiPorc1"],file(params.test_data['deilephila_porcellus']['mito']['contigs'], checkIfExists: true)])
ref_gb = file(params.test_data['deilephila_porcellus']['mito']['ref_gb'], checkIfExists: true)
ref_fa = file(params.test_data['deilephila_porcellus']['mito']['ref_fa'], checkIfExists: true)
input_mode = Channel.of('c')
code = 5
MITOHIFI_MITOHIFI_CONTIGS ( data_contigs, ref_fa, ref_gb, code )
MITOHIFI_MITOHIFI_CONTIGS ( data_contigs, ref_fa, ref_gb, input_mode, code )
}


Expand All @@ -24,6 +25,7 @@ workflow test_mitohifi_mitohifi_reads {
data_reads = Channel.of([[id:"ilDeiPorc1"],file(params.test_data['deilephila_porcellus']['mito']['hifi_reads'], checkIfExists: true)])
ref_gb = file(params.test_data['deilephila_porcellus']['mito']['ref_gb'], checkIfExists: true)
ref_fa = file(params.test_data['deilephila_porcellus']['mito']['ref_fa'], checkIfExists: true)
input_mode = Channel.of('r')
code = 5
MITOHIFI_MITOHIFI_READS ( data_reads, ref_fa, ref_gb, code )
MITOHIFI_MITOHIFI_READS ( data_reads, ref_fa, ref_gb, input_mode, code )
}
8 changes: 1 addition & 7 deletions tests/modules/nf-core/mitohifi/mitohifi/nextflow.config
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
process {
withName: MITOHIFI_MITOHIFI_CONTIGS {
ext.args2 = '-c'
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }
}

withName: MITOHIFI_MITOHIFI_READS {
ext.args2 = '-r'
withName: MITOHIFI_MITOHIFI {
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }
}
}
Expand Down