-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
505 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
// Import generic module functions | ||
include { get_resources; initOptions; saveFiles } from '../../../lib/nf/functions' | ||
RESOURCES = get_resources(workflow.profile, params.max_memory, params.max_cpus) | ||
options = initOptions(params.containsKey("options") ? params.options : [:], 'btyper3') | ||
options.btype = options.btype ?: "tools" | ||
conda_tools = "bioconda::btyper3=3.4.0" | ||
conda_name = conda_tools.replace("=", "-").replace(":", "-").replace(" ", "-") | ||
conda_env = file("${params.condadir}/${conda_name}").exists() ? "${params.condadir}/${conda_name}" : conda_tools | ||
|
||
process BTYPER3 { | ||
tag "$meta.id" | ||
label 'process_low' | ||
|
||
conda (params.enable_conda ? conda_env : null) | ||
container "${ workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container ? | ||
'https://depot.galaxyproject.org/singularity/btyper3:3.4.0--pyhdfd78af_0' : | ||
'quay.io/biocontainers/btyper3:3.4.0--pyhdfd78af_0' }" | ||
|
||
input: | ||
tuple val(meta), path(fasta) | ||
|
||
output: | ||
tuple val(meta), path("results/*_final_results.txt"), emit: tsv | ||
tuple val(meta), path("results/*") , emit: results | ||
path "*.{log,err}" , emit: logs, optional: true | ||
path ".command.*" , emit: nf_logs | ||
path "versions.yml", emit: versions | ||
|
||
script: | ||
prefix = options.suffix ? "${options.suffix}" : "${meta.id}" | ||
def is_compressed = fasta.getName().endsWith(".gz") ? true : false | ||
def fasta_name = fasta.getName().replace(".gz", "") | ||
""" | ||
# Btyper3 does not accept compressed files | ||
if [ "$is_compressed" == "true" ]; then | ||
gzip -c -d $fasta > $fasta_name | ||
fi | ||
btyper3 \\ | ||
$options.args \\ | ||
--output ./ \\ | ||
--input ${fasta_name} | ||
mv btyper3_final_results/ results/ | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
btyper3: \$(echo \$(btyper3 --version 2>&1) | sed 's/^.*btyper3 //;' )) | ||
END_VERSIONS | ||
""" | ||
|
||
stub: | ||
def args = task.ext.args ?: '' | ||
def prefix = task.ext.prefix ?: "${meta.id}" | ||
""" | ||
mkdir results | ||
touch results/${prefix}_final_results.txt | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
btyper3: \$(echo \$(btyper3 --version 2>&1) | sed 's/^.*btyper3 //;' )) | ||
END_VERSIONS | ||
""" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
--- | ||
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/yaml-schema.json | ||
name: "btyper3" | ||
description: Taxonomic classification of Bacillus cereus group isolates from assemblies | ||
keywords: | ||
- bacteria | ||
- classify | ||
- fasta | ||
tools: | ||
- "btyper3": | ||
description: "In silico taxonomic classification of Bacillus cereus group isolates using assembled genomes" | ||
homepage: "https://github.com/lmc297/BTyper3" | ||
documentation: "https://github.com/lmc297/BTyper3" | ||
tool_dev_url: "https://github.com/lmc297/BTyper3" | ||
doi: "10.3389/fmicb.2020.580691" | ||
licence: "['GPL v3']" | ||
|
||
input: | ||
- meta: | ||
type: map | ||
description: | | ||
Groovy Map containing sample information | ||
e.g. `[ id:'test', single_end:false ]` | ||
- fasta: | ||
type: file | ||
description: A genome assembly in FASTA format. | ||
pattern: "*.{fasta|fasta.gz|fa|fa.gz|fna|fna.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: Tab-delimited file of Btyper3 results | ||
pattern: "*_final_results.txt" | ||
- results: | ||
type: file | ||
description: A directory of results from Btyper3 run | ||
pattern: "results/*" | ||
|
||
authors: | ||
- "@rpetit3" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/* | ||
This file includes default parameter values. | ||
*/ | ||
|
||
params { | ||
// BTyper3 | ||
bt_virulence_identity = 70 | ||
bt_virulence_coverage = 80 | ||
bt_identity = 50 | ||
bt_coverage = 70 | ||
bt_overlap = 70 | ||
bt_opts = "" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema", | ||
"$id": "https://raw.githubusercontent.com/bactopia/bactopia/master/modules/nf-core/btyper3/params.json", | ||
"title": "BTyper3 Module", | ||
"description": "A module for taxonomic classification of Bacillus cereus group isolates.", | ||
"type": "object", | ||
"definitions": { | ||
"btyper3_parameters": { | ||
"title": "BTyper3 Parameters", | ||
"type": "object", | ||
"description": "", | ||
"default": "", | ||
"fa_icon": "fas fa-exclamation-circle", | ||
"properties": { | ||
"bt_virulence_identity": { | ||
"type": "integer", | ||
"default": 70, | ||
"description": "Minimum percent amino acid/nucleotide identity threshold for a virulence gene to be considered present", | ||
"fa_icon": "fas fa-expand-arrows-alt" | ||
}, | ||
"bt_virulence_coverage": { | ||
"type": "integer", | ||
"default": 80, | ||
"description": "Minimum percent coverage threshold for a virulence gene to be considered present", | ||
"fa_icon": "fas fa-expand-arrows-alt", | ||
"hidden": true | ||
}, | ||
"bt_identity": { | ||
"type": "integer", | ||
"default": 50, | ||
"description": "Minimum percent amino acid identity threshold for a Bt toxin gene to be considered present", | ||
"fa_icon": "fas fa-expand-arrows-alt" | ||
}, | ||
"bt_coverage": { | ||
"type": "integer", | ||
"default": 70, | ||
"description": "Minimum percent coverage threshold for a Bt toxin gene to be considered present", | ||
"fa_icon": "fas fa-expand-arrows-alt", | ||
"hidden": true | ||
}, | ||
"bt_overlap": { | ||
"type": "integer", | ||
"default": 70, | ||
"description": "Specify maximum proportion of overlap for overlapping Bt toxin genes to be considered separate genes", | ||
"fa_icon": "fas fa-expand-arrows-alt", | ||
"hidden": true | ||
}, | ||
"bt_opts": { | ||
"type": "string", | ||
"default": "", | ||
"description": "Additional options to pass to BTyper3", | ||
"fa_icon": "fas fa-expand-arrows-alt" | ||
} | ||
} | ||
} | ||
}, | ||
"allOf": [ | ||
{ | ||
"$ref": "#/definitions/btyper3_parameters" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.