Skip to content
Closed
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
2 changes: 1 addition & 1 deletion modules/nf-core/paraphase/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ dependencies:
# renovate: datasource=conda depName=bioconda/minimap2
- bioconda::minimap2=2.30
# renovate: datasource=conda depName=bioconda/paraphase
- bioconda::paraphase=3.5.0
- bioconda::paraphase=3.4.0
# renovate: datasource=conda depName=bioconda/samtools
- bioconda::samtools=1.23
43 changes: 26 additions & 17 deletions modules/nf-core/paraphase/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ process PARAPHASE {

conda "${moduleDir}/environment.yml"

container "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container
? 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/d2/d2f7e7ef6dd6def56bef5252c28a65f279d5fcef09a832510d0de1d6dab09194/data'
: 'community.wave.seqera.io/library/minimap2_paraphase_samtools:2c52f03fe994efa6'}"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/7b/7bad1fc17553609844471ecfebff87f9797c0cf0c374c7c7662af23943edd365/data':
'community.wave.seqera.io/library/minimap2_paraphase_samtools:5cc32e174d09f608' }"

input:
tuple val(meta), path(bam), path(bai)
Expand All @@ -19,9 +19,9 @@ process PARAPHASE {
tuple val(meta), path("*.paraphase.bam.bai"), emit: bai
tuple val(meta), path("${prefix}_paraphase_vcfs/*.vcf.gz"), emit: vcf, optional: true
tuple val(meta), path("${prefix}_paraphase_vcfs/*.vcf.gz.{csi,tbi}"), emit: vcf_index, optional: true
tuple val("${task.process}"), val('minimap2'), eval("minimap2 --version"), topic: versions, emit: versions_minimap2
tuple val("${task.process}"), val('paraphase'), eval("paraphase --version"), topic: versions, emit: versions_paraphase
tuple val("${task.process}"), val('samtools'), eval("samtools version | sed '1!d;s/.* //'"), topic: versions, emit: versions_samtools
tuple val("${task.process}"), val('minimap2'), eval('minimap2 --version') , emit: versions_minimap2 , topic: versions
tuple val("${task.process}"), val('paraphase'), eval('paraphase --version') , emit: versions_paraphase , topic: versions
tuple val("${task.process}"), val('samtools'), eval('samtools --version | sed \'1!d;s/.* //\'') , emit: versions_samtools , topic: versions

when:
task.ext.when == null || task.ext.when
Expand All @@ -42,17 +42,26 @@ process PARAPHASE {
${config_file} \\
--out .

for vcf in ${prefix}_paraphase_vcfs/*.vcf;
do
bgzip \\
${args2} \\
--threads ${task.cpus} \\
\$vcf;
tabix \\
${args3} \\
--threads ${task.cpus} \\
\$vcf.gz;
done
if compgen -G "${prefix}_paraphase_vcfs/*.vcf" > /dev/null; then
for vcf in ${prefix}_paraphase_vcfs/*.vcf;
do
bgzip \\
$args2 \\
--threads $task.cpus \\
\$vcf;
tabix \\
$args3 \\
--threads $task.cpus \\
\$vcf.gz;
done
fi

cat <<-END_VERSIONS > versions.yml
"${task.process}":
minimap2: \$(minimap2 --version 2>&1)
paraphase: \$(paraphase --version)
samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//')
END_VERSIONS
"""

stub:
Expand Down
4 changes: 2 additions & 2 deletions modules/nf-core/paraphase/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ output:
- samtools:
type: string
description: The name of the tool
- samtools version | sed '1!d;s/.* //':
- samtools --version | sed '1!d;s/.* //':
type: eval
description: The expression to obtain the version of the tool
topics:
Expand Down Expand Up @@ -165,7 +165,7 @@ topics:
- samtools:
type: string
description: The name of the tool
- samtools version | sed '1!d;s/.* //':
- samtools --version | sed '1!d;s/.* //':
type: eval
description: The expression to obtain the version of the tool
authors:
Expand Down
39 changes: 38 additions & 1 deletion modules/nf-core/paraphase/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,44 @@ nextflow_process {
bam(process.out.bam.get(0).get(1)).getReadsMD5(),
file(process.out.bai.get(0).get(1)).name,
file(process.out.vcf_index.get(0).get(1)).name,
process.out.findAll { key, val -> key.startsWith("versions")}
process.out.findAll { key, val -> key.startsWith('versions') }
).match()
}
)
}
}

test("homo_sapiens - [ bam, bai ], no_vcf") {

config "./nextflow.no_vcf.config"

when {
process {
"""
input[0] = [
[ id:'test', single_end:true ], // meta map
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/bam/test.sorted.bam', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/bam/test.sorted.bam.bai', checkIfExists: true),
]
input[1] = TABIX_BGZIP.out.output
input[2] = [
[ id:'test_config' ],
file(params.modules_testdata_base_path + 'generic/config/paraphase_config.yaml', checkIfExists: true),
]
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert process.out.vcf?.isEmpty() },
{ assert process.out.vcf_index?.isEmpty() },
{ assert snapshot(
file(process.out.json.get(0).get(1)),
process.out.bam.get(0).get(1).isEmpty(),
file(process.out.bai.get(0).get(1)).name,
process.out.findAll { key, val -> key.startsWith("versions") }
).match()
}
)
Expand Down
Loading
Loading