Skip to content

Commit

Permalink
altered abricate coding style
Browse files Browse the repository at this point in the history
  • Loading branch information
mattheww95 committed Oct 23, 2023
1 parent c9fa0de commit 1fd326f
Show file tree
Hide file tree
Showing 9 changed files with 70 additions and 128 deletions.
4 changes: 2 additions & 2 deletions conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -736,9 +736,9 @@ process {

}

withName: ABRICATE_RUN {
withName: ABRICATE {
errorStrategy = 'ignore'

ext.containers = params.abricate
stageInMode = params.stage_in_mode
publishDir = [
[
Expand Down
4 changes: 3 additions & 1 deletion docs/usage/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,11 @@ If as an example if, the `--quast.min_contig_lenth` parameter would be written a
Note: Parameters that are bolded are ones that can be freely changed. Sensible defaults are provided however

### Abricate
Screens contigs for antimicrobial and virulence genes.
Screens contigs for antimicrobial and virulence genes. If you wish to use a different Abricate database you may need to update the container you use.

- abricate
- singularity: Abricate singularity container
- docker: Abricate docker container
- **args**: Can be a string of additional command line arguments to pass to abricate
- report_tag: This field determines the name of the Abricate output in the final summary file. Do no touch this unless doing pipeline development.
- header_p: This field tells the report module that the Abricate output contains headers. Do no touch this unless doing pipeline development.
Expand Down
5 changes: 0 additions & 5 deletions modules.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@
"https://github.com/nf-core/modules.git": {
"modules": {
"nf-core": {
"abricate/run": {
"branch": "master",
"git_sha": "911696ea0b62df80e900ef244d7867d177971f73",
"installed_by": ["modules"]
},
"custom/dumpsoftwareversions": {
"branch": "master",
"git_sha": "c8e35eb2055c099720a75538d1b8adb3fb5a464c",
Expand Down
27 changes: 27 additions & 0 deletions modules/local/abricate.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/// Abricate module


process ABRICATE {
tag "$meta.id"
label 'process_medium'
container "${workflow.containerEngine == 'singularity' || workflow.containerEngine == 'apptainer' ? task.ext.containers.get('singularity') : task.ext.containers.get('docker')}"


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

output:
tuple val(meta), path("*.txt"), emit: report
path "versions.yml", emit: versions

script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
"""
abricate $assembly $args --threads $task.cpus > ${prefix}.txt
cat <<-END_VERSIONS > versions.yml
"${task.process}":
abricate: \$(echo \$(abricate --version 2>&1) | sed 's/^.*abricate //' )
END_VERSIONS
"""
}
34 changes: 0 additions & 34 deletions modules/nf-core/abricate/run/main.nf

This file was deleted.

43 changes: 0 additions & 43 deletions modules/nf-core/abricate/run/meta.yml

This file was deleted.

4 changes: 3 additions & 1 deletion nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,9 @@ params {
max_cpus = 16
max_time = '240.h'

abricate_params {
abricate {
singularity = "https://depot.galaxyproject.org/singularity/abricate%3A1.0.1--ha8f3691_1"
docker = "quay.io/biocontainers/abricate:1.0.1--ha8f3691_1"
args = ""
report_tag = "Abricate"
header_p = true
Expand Down
71 changes: 32 additions & 39 deletions nextflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1414,20 +1414,6 @@
"type": "integer",
"default": 100
},
"abricate_params.args": {
"type": "string",
"hidden": true
},
"abricate_params.report_tag": {
"type": "string",
"default": "Abricate",
"hidden": true
},
"abricate_params.header_p": {
"type": "boolean",
"default": true,
"hidden": true
},
"raw_reads.high_precision": {
"type": "boolean",
"hidden": true
Expand Down Expand Up @@ -1731,26 +1717,6 @@
"default": true,
"hidden": true
},
"shigatyper.docker": {
"type": "string",
"default": "quay.io/biocontainers/shigatyper:2.0.1--pyhdfd78af_0",
"hidden": true
},
"shigatyper.tsv_ext": {
"type": "string",
"default": ".tsv",
"hidden": true
},
"shigatyper.report_tag": {
"type": "string",
"default": "Subtyping",
"hidden": true
},
"shigatyper.header_p": {
"type": "boolean",
"default": true,
"hidden": true
},
"kraken_bin.fasta_ext": {
"type": "string",
"default": "_binned.fasta.gz",
Expand Down Expand Up @@ -2569,11 +2535,6 @@
"default": "https://depot.galaxyproject.org/singularity/shigeifinder:1.3.2--pyhdfd78af_0",
"hidden": true
},
"shigatyper.singularity": {
"type": "string",
"default": "https://depot.galaxyproject.org/singularity/shigatyper%3A2.0.1--pyhdfd78af_0",
"hidden": true
},
"flye_read_type": {
"type": "string",
"default": "hq",
Expand All @@ -2597,6 +2558,38 @@
"type": "string",
"default": "docker://python/python:3.10.4-alpine3.16",
"hidden": true
},
"abricate.singularity": {
"type": "string",
"default": "https://depot.galaxyproject.org/singularity/abricate%3A1.0.1--ha8f3691_1",
"hidden": true
},
"abricate.docker": {
"type": "string",
"default": "quay.io/biocontainers/abricate:1.0.1--ha8f3691_1",
"hidden": true
},
"abricate.args": {
"type": "string",
"hidden": true
},
"abricate.report_tag": {
"type": "string",
"default": "Abricate",
"hidden": true
},
"abricate.header_p": {
"type": "string",
"default": "true",
"hidden": true
},
"shigeifinder.container_version": {
"type": "string",
"default": "1.3.2"
},
"shigeifinder.report_tag": {
"type": "string",
"default": "ShigeifinderSubtyping"
}
}
}
6 changes: 3 additions & 3 deletions subworkflows/local/annotate_genomes.nf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// annotate genomes
include { BAKTA_ANNOTATE } from '../../modules/local/bakta_annotate.nf'
include { ABRICATE_RUN } from "../../modules/nf-core/abricate/run/main.nf"
include { ABRICATE } from "../../modules/local/abricate.nf"
include { MOBSUITE_RECON } from "../../modules/local/mob_recon.nf"
include { STARAMR } from "../../modules/local/staramr.nf"
include { STARAMR_DUMP_DB_VERSIONS } from "../../modules/local/staramr_version.nf"
Expand Down Expand Up @@ -46,11 +46,11 @@ workflow ANNOTATE_GENOMES {
}

if(!params.skip_abricate){
abricated = ABRICATE_RUN(contig_data)
abricated = ABRICATE(contig_data)
abricate_report = abricated.report
versions = versions.mix(abricated.versions)
reports = reports.mix(abricated.report.map{
meta, report -> tuple(meta, params.abricate_params, report);
meta, report -> tuple(meta, params.abricate, report);
})
}

Expand Down

0 comments on commit 1fd326f

Please sign in to comment.