mirror of
https://github.com/MillironX/nf-core_modules.git
synced 2024-11-13 05:13:09 +00:00
add module AMPlify (#1498)
* add module AMPlify * Apply suggestions from code review Thanks for the review! Co-authored-by: Moritz E. Beber <midnighter@posteo.net> * removed trailing whitespaces * Apply suggestions from code review Thanks again! Co-authored-by: Moritz E. Beber <midnighter@posteo.net> * Apply suggestions from code review Thank you for the suggestions! Co-authored-by: Sateesh Peri <33637490+sateeshperi@users.noreply.github.com> Co-authored-by: James A. Fellows Yates <jfy133@gmail.com> * Apply suggestions from code review Co-authored-by: Sateesh Peri <33637490+sateeshperi@users.noreply.github.com> * including review suggestions * fix versions.yml * add model_dir input * add model_dir to meta.yml * complete faa pattern in meta.yml * add fa.gz to pattern Co-authored-by: Moritz E. Beber <midnighter@posteo.net> Co-authored-by: Sateesh Peri <33637490+sateeshperi@users.noreply.github.com> Co-authored-by: James A. Fellows Yates <jfy133@gmail.com>
This commit is contained in:
parent
705f8c9ac4
commit
6c45773c0b
6 changed files with 124 additions and 0 deletions
41
modules/amplify/predict/main.nf
Normal file
41
modules/amplify/predict/main.nf
Normal file
|
@ -0,0 +1,41 @@
|
|||
def VERSION = '1.0.3' // Version information not provided by tool
|
||||
|
||||
process AMPLIFY_PREDICT {
|
||||
tag "$meta.id"
|
||||
label 'process_low'
|
||||
|
||||
conda (params.enable_conda ? "bioconda::amplify=1.0.3" : null)
|
||||
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
|
||||
'https://depot.galaxyproject.org/singularity/amplify:1.0.3--py36hdfd78af_0':
|
||||
'quay.io/biocontainers/amplify:1.0.3--py36hdfd78af_0' }"
|
||||
|
||||
input:
|
||||
tuple val(meta), path(faa)
|
||||
path(model_dir)
|
||||
|
||||
output:
|
||||
tuple val(meta), path('*.tsv'), emit: tsv
|
||||
path "versions.yml" , emit: versions
|
||||
|
||||
when:
|
||||
task.ext.when == null || task.ext.when
|
||||
|
||||
script:
|
||||
def args = task.ext.args ?: ''
|
||||
def prefix = task.ext.prefix ?: "${meta.id}"
|
||||
def custom_model_dir = model_dir ? "-md ${model_dir}" : ""
|
||||
"""
|
||||
AMPlify \\
|
||||
$args \\
|
||||
${custom_model_dir} \\
|
||||
-s '${faa}'
|
||||
|
||||
#rename output, because tool includes date and time in name
|
||||
mv *.tsv ${prefix}.tsv
|
||||
|
||||
cat <<-END_VERSIONS > versions.yml
|
||||
"${task.process}":
|
||||
AMPlify: $VERSION
|
||||
END_VERSIONS
|
||||
"""
|
||||
}
|
47
modules/amplify/predict/meta.yml
Normal file
47
modules/amplify/predict/meta.yml
Normal file
|
@ -0,0 +1,47 @@
|
|||
name: "amplify_predict"
|
||||
description: AMPlify is an attentive deep learning model for antimicrobial peptide prediction.
|
||||
keywords:
|
||||
- antimicrobial peptides
|
||||
- AMPs
|
||||
- prediction
|
||||
- model
|
||||
tools:
|
||||
- "amplify":
|
||||
description: "Attentive deep learning model for antimicrobial peptide prediction"
|
||||
homepage: "https://github.com/bcgsc/AMPlify"
|
||||
documentation: "https://github.com/bcgsc/AMPlify"
|
||||
tool_dev_url: "https://github.com/bcgsc/AMPlify"
|
||||
doi: "https://doi.org/10.1186/s12864-022-08310-4"
|
||||
licence: "['GPL v3']"
|
||||
|
||||
input:
|
||||
- meta:
|
||||
type: map
|
||||
description: |
|
||||
Groovy Map containing sample information
|
||||
e.g. [ id:'test', single_end:false ]
|
||||
- faa:
|
||||
type: file
|
||||
description: amino acid sequences fasta
|
||||
pattern: "*.{fa,fa.gz,faa,faa.gz,fasta,fasta.gz}"
|
||||
- model_dir:
|
||||
type: directory
|
||||
description: Directory of where models are stored (optional)
|
||||
|
||||
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: amino acid sequences with prediction (AMP, non-AMP) and probability scores
|
||||
pattern: "*.{tsv}"
|
||||
|
||||
authors:
|
||||
- "@louperelo"
|
|
@ -26,6 +26,10 @@ allelecounter:
|
|||
- modules/allelecounter/**
|
||||
- tests/modules/allelecounter/**
|
||||
|
||||
amplify/predict:
|
||||
- modules/amplify/predict/**
|
||||
- tests/modules/amplify/predict/**
|
||||
|
||||
amps:
|
||||
- modules/amps/**
|
||||
- tests/modules/amps/**
|
||||
|
|
18
tests/modules/amplify/predict/main.nf
Normal file
18
tests/modules/amplify/predict/main.nf
Normal file
|
@ -0,0 +1,18 @@
|
|||
#!/usr/bin/env nextflow
|
||||
|
||||
nextflow.enable.dsl = 2
|
||||
|
||||
include { PRODIGAL } from '../../../modules/prodigal/main.nf' addParams( options: [:] )
|
||||
include { AMPLIFY_PREDICT } from '../../../../modules/amplify/predict/main.nf' addParams( options: [:] )
|
||||
|
||||
workflow amplify_predict {
|
||||
|
||||
input = [
|
||||
[ id:'test', single_end:false ], // meta map
|
||||
file(params.test_data['sarscov2']['illumina']['contigs_fasta'], checkIfExists: true)
|
||||
]
|
||||
model_dir = []
|
||||
|
||||
PRODIGAL ( input, "gff" )
|
||||
AMPLIFY_PREDICT ( PRODIGAL.out.amino_acid_fasta, model_dir)
|
||||
}
|
5
tests/modules/amplify/predict/nextflow.config
Normal file
5
tests/modules/amplify/predict/nextflow.config
Normal file
|
@ -0,0 +1,5 @@
|
|||
process {
|
||||
|
||||
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }
|
||||
|
||||
}
|
9
tests/modules/amplify/predict/test.yml
Normal file
9
tests/modules/amplify/predict/test.yml
Normal file
|
@ -0,0 +1,9 @@
|
|||
- name: amplify predict amplify_predict
|
||||
command: nextflow run tests/modules/amplify/predict -entry amplify_predict -c tests/config/nextflow.config
|
||||
tags:
|
||||
- amplify/predict
|
||||
- amplify
|
||||
files:
|
||||
- path: output/amplify/test.tsv
|
||||
md5sum: 1951084ce1d410028be86754997e5852
|
||||
- path: output/amplify/versions.yml
|
Loading…
Reference in a new issue