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

add module for pasty #2003

Merged
merged 6 commits into from
Sep 7, 2022
Merged
Show file tree
Hide file tree
Changes from 4 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
36 changes: 36 additions & 0 deletions modules/pasty/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
process PASTY {
tag "$meta.id"
label 'process_low'

conda (params.enable_conda ? "bioconda::pasty=1.0.0" : null)
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/pasty:1.0.0--hdfd78af_0':
'quay.io/biocontainers/pasty:1.0.0--hdfd78af_0' }"

input:
tuple val(meta), path(fasta)

output:
tuple val(meta), path("${prefix}.tsv") , emit: tsv
tuple val(meta), path("${prefix}.blastn.tsv") , emit: blast
tuple val(meta), path("${prefix}.details.tsv"), emit: details
path "versions.yml" , emit: versions

when:
task.ext.when == null || task.ext.when

script:
def args = task.ext.args ?: ''
prefix = task.ext.prefix ?: "${meta.id}"
"""
pasty \\
$args \\
--prefix $prefix \\
--assembly $fasta
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can't use any additional threads? In that case, would it be suitable to switch to process_single ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch!


cat <<-END_VERSIONS > versions.yml
"${task.process}":
pasty: \$(echo \$(pasty --version 2>&1) | sed 's/^.*pasty, version //;' )
END_VERSIONS
"""
}
52 changes: 52 additions & 0 deletions modules/pasty/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: "pasty"
description: Serogroup Pseudomonas aeruginosa assemblies
keywords:
- bacteria
- serogroup
- fasta
- assembly
tools:
- "pasty":
description: "A tool for in silico serogrouping of Pseudomonas aeruginosa isolates"
homepage: "https://github.com/rpetit3/pasty"
documentation: "https://github.com/rpetit3/pasty"
tool_dev_url: "https://github.com/rpetit3/pasty"
doi: ""
licence: "['Apache-2.0']"

input:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- fasta:
type: file
description: An assembly in FASTA format
pattern: "*.{fasta,fasta.gz,fna,fna.gz,fa,fa.gz}"

output:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- versions:
type: file
description: File containing software versions
pattern: "versions.yml"
- tsv:
type: file
description: A tab-delimited file with the predicted serogroup
pattern: "*.tsv"
- blast:
type: file
description: A tab-delimited file of all blast hits
pattern: "*.blastn.tsv"
- details:
type: file
description: A tab-delimited file with details for each serogroup
pattern: "*.details.tsv"

authors:
- "@rpetit3"
4 changes: 4 additions & 0 deletions tests/config/pytest_modules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1695,6 +1695,10 @@ paraclu:
- modules/paraclu/**
- tests/modules/paraclu/**

pasty:
- modules/pasty/**
- tests/modules/pasty/**

pbbam/pbmerge:
- modules/pbbam/pbmerge/**
- tests/modules/pbbam/pbmerge/**
Expand Down
13 changes: 13 additions & 0 deletions tests/modules/pasty/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env nextflow

nextflow.enable.dsl = 2

include { PASTY } from '../../../modules/pasty/main.nf'

workflow test_pasty {

input = [ [ id:'test', single_end:false ], // meta map
file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) ]

PASTY ( input )
}
5 changes: 5 additions & 0 deletions tests/modules/pasty/nextflow.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
process {

publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }

}
11 changes: 11 additions & 0 deletions tests/modules/pasty/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
- name: pasty test_pasty
command: nextflow run ./tests/modules/pasty -entry test_pasty -c ./tests/config/nextflow.config -c ./tests/modules/pasty/nextflow.config
tags:
- pasty
files:
- path: output/pasty/test.blastn.tsv
md5sum: 45de2825f0bb3cc8fe9f2b7c419f66f2
- path: output/pasty/test.details.tsv
md5sum: d6822beea048a27af839087dfc14a536
- path: output/pasty/test.tsv
md5sum: edbae35d3edc17283ea73f7f3eb22087