mirror of
https://github.com/MillironX/nf-core_modules.git
synced 2024-11-10 20:23:10 +00:00
add module for rgi (#1321)
* add module for rgi * fix extension * fix test yaml * Update main.nf * Update main.nf
This commit is contained in:
parent
cab399507b
commit
8055c5d1c3
6 changed files with 120 additions and 0 deletions
37
modules/rgi/main/main.nf
Normal file
37
modules/rgi/main/main.nf
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
process RGI_MAIN {
|
||||||
|
tag "$meta.id"
|
||||||
|
label 'process_medium'
|
||||||
|
|
||||||
|
conda (params.enable_conda ? "bioconda::rgi=5.2.1" : null)
|
||||||
|
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
|
||||||
|
'https://depot.galaxyproject.org/singularity/rgi:5.2.1--pyha8f3691_2':
|
||||||
|
'quay.io/biocontainers/rgi:5.2.1--pyha8f3691_2' }"
|
||||||
|
|
||||||
|
input:
|
||||||
|
tuple val(meta), path(fasta)
|
||||||
|
|
||||||
|
output:
|
||||||
|
tuple val(meta), path("*.json"), emit: json
|
||||||
|
tuple val(meta), path("*.txt") , 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}"
|
||||||
|
"""
|
||||||
|
rgi \\
|
||||||
|
main \\
|
||||||
|
$args \\
|
||||||
|
--num_threads $task.cpus \\
|
||||||
|
--output_file $prefix \\
|
||||||
|
--input_sequence $fasta
|
||||||
|
|
||||||
|
cat <<-END_VERSIONS > versions.yml
|
||||||
|
"${task.process}":
|
||||||
|
rgi: \$(rgi main --version)
|
||||||
|
END_VERSIONS
|
||||||
|
"""
|
||||||
|
}
|
47
modules/rgi/main/meta.yml
Normal file
47
modules/rgi/main/meta.yml
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
name: rgi_main
|
||||||
|
description: Predict antibiotic resistance from protein or nucleotide data
|
||||||
|
keywords:
|
||||||
|
- bacteria
|
||||||
|
- fasta
|
||||||
|
- antibiotic resistance
|
||||||
|
tools:
|
||||||
|
- rgi:
|
||||||
|
description: This tool provides a preliminary annotation of your DNA sequence(s) based upon the data available in The Comprehensive Antibiotic Resistance Database (CARD). Hits to genes tagged with Antibiotic Resistance ontology terms will be highlighted. As CARD expands to include more pathogens, genomes, plasmids, and ontology terms this tool will grow increasingly powerful in providing first-pass detection of antibiotic resistance associated genes. See license at CARD website
|
||||||
|
homepage: https://card.mcmaster.ca
|
||||||
|
documentation: https://github.com/arpcard/rgi
|
||||||
|
tool_dev_url: https://github.com/arpcard/rgi
|
||||||
|
doi: "10.1093/nar/gkz935"
|
||||||
|
licence: ['https://card.mcmaster.ca/about']
|
||||||
|
|
||||||
|
input:
|
||||||
|
- meta:
|
||||||
|
type: map
|
||||||
|
description: |
|
||||||
|
Groovy Map containing sample information
|
||||||
|
e.g. [ id:'test', single_end:false ]
|
||||||
|
- fasta:
|
||||||
|
type: file
|
||||||
|
description: Nucleotide or protein sequences in FASTA format
|
||||||
|
pattern: "*.{fasta,fasta.gz,fa,fa.gz,fna,fna.gz,faa,faa.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"
|
||||||
|
- json:
|
||||||
|
type: file
|
||||||
|
description: JSON formatted file with RGI results
|
||||||
|
pattern: "*.{json}"
|
||||||
|
- tsv:
|
||||||
|
type: file
|
||||||
|
description: Tab-delimited file with RGI results
|
||||||
|
pattern: "*.{txt}"
|
||||||
|
|
||||||
|
authors:
|
||||||
|
- "@rpetit3"
|
|
@ -1261,6 +1261,10 @@ raxmlng:
|
||||||
- modules/raxmlng/**
|
- modules/raxmlng/**
|
||||||
- tests/modules/raxmlng/**
|
- tests/modules/raxmlng/**
|
||||||
|
|
||||||
|
rgi/main:
|
||||||
|
- modules/rgi/main/**
|
||||||
|
- tests/modules/rgi/main/**
|
||||||
|
|
||||||
rmarkdownnotebook:
|
rmarkdownnotebook:
|
||||||
- modules/rmarkdownnotebook/**
|
- modules/rmarkdownnotebook/**
|
||||||
- tests/modules/rmarkdownnotebook/**
|
- tests/modules/rmarkdownnotebook/**
|
||||||
|
|
15
tests/modules/rgi/main/main.nf
Normal file
15
tests/modules/rgi/main/main.nf
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
#!/usr/bin/env nextflow
|
||||||
|
|
||||||
|
nextflow.enable.dsl = 2
|
||||||
|
|
||||||
|
include { RGI_MAIN } from '../../../../modules/rgi/main/main.nf'
|
||||||
|
|
||||||
|
workflow test_rgi_main {
|
||||||
|
|
||||||
|
input = [
|
||||||
|
[ id:'test', single_end:false ], // meta map
|
||||||
|
file(params.test_data['haemophilus_influenzae']['genome']['genome_fna_gz'], checkIfExists: true)
|
||||||
|
]
|
||||||
|
|
||||||
|
RGI_MAIN ( input )
|
||||||
|
}
|
5
tests/modules/rgi/main/nextflow.config
Normal file
5
tests/modules/rgi/main/nextflow.config
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
process {
|
||||||
|
|
||||||
|
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }
|
||||||
|
|
||||||
|
}
|
12
tests/modules/rgi/main/test.yml
Normal file
12
tests/modules/rgi/main/test.yml
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
- name: rgi main
|
||||||
|
command: nextflow run ./tests/modules/rgi/main -entry test_rgi_main -c ./tests/config/nextflow.config -c ./tests/modules/rgi/main/nextflow.config
|
||||||
|
tags:
|
||||||
|
- rgi
|
||||||
|
- rgi/main
|
||||||
|
files:
|
||||||
|
- path: output/rgi/test.json
|
||||||
|
contains: ["NZ_LS483480", "orf_end", "perc_identity", "Pulvomycin"]
|
||||||
|
- path: output/rgi/test.txt
|
||||||
|
contains: ["NZ_LS483480", "ORF_ID", "Model_type", "Pulvomycin"]
|
||||||
|
- path: output/rgi/versions.yml
|
||||||
|
md5sum: 614a45d9d59680d4e743498773cf830a
|
Loading…
Reference in a new issue