-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add bactopia tool for defense-finder
- Loading branch information
Showing
18 changed files
with
735 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
// 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 : [:], 'defensefinder') | ||
options.btype = options.btype ?: "tools" | ||
conda_tools = "bioconda::defense-finder=1.2.2" | ||
conda_name = conda_tools.replace("=", "-").replace(":", "-").replace(" ", "-") | ||
conda_env = file("${params.condadir}/${conda_name}").exists() ? "${params.condadir}/${conda_name}" : conda_tools | ||
DF_VERSION = "1.2.2" | ||
DF_MODELS_VERSION = "1.2.4" | ||
CASFINDER_VERSION = "3.1.0" | ||
|
||
process DEFENSEFINDER_RUN { | ||
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/defense-finder:1.2.2--pyhdfd78af_1' : | ||
'quay.io/biocontainers/defense-finder:1.2.2--pyhdfd78af_1' }" | ||
|
||
input: | ||
tuple val(meta), path(fasta) | ||
each path(db) | ||
|
||
output: | ||
tuple val(meta), path("*_defense_finder_genes.tsv") , emit: genes_tsv | ||
tuple val(meta), path("*_defense_finder_hmmer.tsv") , emit: hmmer_tsv | ||
tuple val(meta), path("*_defense_finder_systems.tsv"), emit: systems_tsv | ||
tuple val(meta), path("*.prt") , emit: proteins | ||
tuple val(meta), path("*.prt.idx") , emit: proteins_index | ||
tuple val(meta), path("${prefix}.macsydata.tar.gz") , emit: macsydata_raw, optional: true | ||
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", "") | ||
""" | ||
set -x | ||
# Extract database | ||
tar -xf $db | ||
macsydata \\ | ||
install \\ | ||
--target defense-finder/ \\ | ||
models/defense-finder-models-v${DF_MODELS_VERSION}.tar.gz | ||
macsydata \\ | ||
install \\ | ||
--target defense-finder/ \\ | ||
models/CasFinder-${CASFINDER_VERSION}.tar.gz | ||
defense-finder \\ | ||
run \\ | ||
$options.args \\ | ||
--workers $task.cpus \\ | ||
--models-dir defense-finder/ \\ | ||
$fasta | ||
if [ "${params.df_preserveraw}" == "true" ]; then | ||
tar -czf ${prefix}.macsydata.tar.gz defense-finder-tmp/ | ||
rm -rf defense-finder-tmp/ | ||
fi | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
defense-finder: ${DF_VERSION} | ||
defense-finder-models: ${DF_MODELS_VERSION} | ||
casfinder-models: ${CASFINDER_VERSION} | ||
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,58 @@ | ||
name: "plasmidfinder" | ||
description: Identify plasmids in bacterial sequences and assemblies | ||
keywords: | ||
- fasta | ||
- fastq | ||
- plasmid | ||
tools: | ||
- "plasmidfinder": | ||
description: "PlasmidFinder allows identification of plasmids in total or partial sequenced isolates of bacteria." | ||
homepage: "https://cge.cbs.dtu.dk/services/PlasmidFinder/" | ||
documentation: "https://bitbucket.org/genomicepidemiology/plasmidfinder" | ||
tool_dev_url: "https://bitbucket.org/genomicepidemiology/plasmidfinder" | ||
doi: "10.1128/AAC.02412-14" | ||
licence: "['Apache-2.0']" | ||
|
||
input: | ||
- meta: | ||
type: map | ||
description: | | ||
Groovy Map containing sample information | ||
e.g. [ id:'test', single_end:false ] | ||
- seqs: | ||
type: file | ||
description: Input FASTA or FASTQ formatted genome sequences | ||
pattern: "*.{fastq.gz,fq.gz,fastq.gz,fna.gz,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" | ||
- json: | ||
type: file | ||
description: The results from analysis in JSON format | ||
pattern: "*.json" | ||
- txt: | ||
type: file | ||
description: The summary of results from analysis | ||
pattern: "*.txt" | ||
- tsv: | ||
type: file | ||
description: The results from analysis in TSV format | ||
pattern: "*.tsv" | ||
- genome_seq: | ||
type: file | ||
description: FASTA of sequences in the input with a hit | ||
pattern: "*-hit_in_genome_seq.fsa" | ||
- plasmid_seq: | ||
type: file | ||
description: FASTA of plasmid sequences with a hit against the input | ||
pattern: "*-plasmid_seqs.fsa" | ||
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,11 @@ | ||
/* | ||
This file includes default parameter values. | ||
*/ | ||
|
||
params { | ||
// defense-finder | ||
df_preserveraw = false | ||
df_nocutga = false | ||
df_coverage = 0.4 | ||
df_dbtype = "ordered_replicon" | ||
} |
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,52 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema", | ||
"$id": "https://raw.githubusercontent.com/bactopia/bactopia/master/modules/nf-core/defensefinder/run/params.json", | ||
"title": "defense-finder Module", | ||
"description": "A module to identify anti-phage systems in assemblies", | ||
"type": "object", | ||
"definitions": { | ||
"defensefinder_parameters": { | ||
"title": "defense-finder Parameters", | ||
"type": "object", | ||
"description": "", | ||
"default": "", | ||
"fa_icon": "fas fa-exclamation-circle", | ||
"properties": { | ||
"df_coverage": { | ||
"type": "number", | ||
"description": "Minimal percentage of coverage for each profiles", | ||
"default": 0.4, | ||
"fa_icon": "fas fa-file-alt" | ||
}, | ||
"df_dbtype": { | ||
"type": "string", | ||
"description": "The macsyfinder --db-type option", | ||
"default": "ordered_replicon", | ||
"fa_icon": "fas fa-italic", | ||
"enum": [ | ||
"ordered_replicon", | ||
"gembase", | ||
"unordered" | ||
] | ||
}, | ||
"df_preserveraw": { | ||
"type": "boolean", | ||
"description": "Preserve raw MacsyFinder outputs alongside Defense Finder results inside the output directory", | ||
"fa_icon": "fas fa-fast-forward", | ||
"hidden": true | ||
}, | ||
"df_nocutga": { | ||
"type": "boolean", | ||
"description": "Advanced! Run macsyfinder in no-cut-ga mode. The validity of the genes and systems found is not guaranteed!", | ||
"fa_icon": "fas fa-fast-forward", | ||
"hidden": true | ||
} | ||
} | ||
} | ||
}, | ||
"allOf": [ | ||
{ | ||
"$ref": "#/definitions/defensefinder_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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// 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 : [:], 'defensefinder_update') | ||
conda_tools = "bioconda::defense-finder=1.2.2" | ||
conda_name = conda_tools.replace("=", "-").replace(":", "-").replace(" ", "-") | ||
conda_env = file("${params.condadir}/${conda_name}").exists() ? "${params.condadir}/${conda_name}" : conda_tools | ||
DF_VERSION = "1.2.2" | ||
DF_MODELS_VERSION = "1.2.4" | ||
CASFINDER_VERSION = "3.1.0" | ||
|
||
process DEFENSEFINDER_UPDATE { | ||
tag "update" | ||
label 'process_low' | ||
storeDir params.datasets_cache | ||
publishDir params.datasets_cache | ||
|
||
conda (params.enable_conda ? conda_env : null) | ||
container "${ workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container ? | ||
'https://depot.galaxyproject.org/singularity/defense-finder:1.2.2--pyhdfd78af_0' : | ||
'quay.io/biocontainers/defense-finder:1.2.2--pyhdfd78af_0' }" | ||
|
||
output: | ||
path "defense-finder-models-${DF_MODELS_VERSION}.tar", emit: db | ||
|
||
script: | ||
prefix = "defense-finder" | ||
""" | ||
mkdir models | ||
wget \\ | ||
-O models/defense-finder-models-v${DF_MODELS_VERSION}.tar.gz \\ | ||
https://github.com/mdmparis/defense-finder-models/archive/refs/tags/${DF_MODELS_VERSION}.tar.gz | ||
wget \\ | ||
-O models/CasFinder-${CASFINDER_VERSION}.tar.gz \\ | ||
https://github.com/macsy-models/CasFinder/archive/refs/tags/${CASFINDER_VERSION}.tar.gz | ||
tar -cvf defense-finder-models-${DF_MODELS_VERSION}.tar models/ | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
defense-finder: ${DF_VERSION} | ||
defense-finder-models: ${DF_MODELS_VERSION} | ||
casfinder-models: ${CASFINDER_VERSION} | ||
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,58 @@ | ||
name: "plasmidfinder" | ||
description: Identify plasmids in bacterial sequences and assemblies | ||
keywords: | ||
- fasta | ||
- fastq | ||
- plasmid | ||
tools: | ||
- "plasmidfinder": | ||
description: "PlasmidFinder allows identification of plasmids in total or partial sequenced isolates of bacteria." | ||
homepage: "https://cge.cbs.dtu.dk/services/PlasmidFinder/" | ||
documentation: "https://bitbucket.org/genomicepidemiology/plasmidfinder" | ||
tool_dev_url: "https://bitbucket.org/genomicepidemiology/plasmidfinder" | ||
doi: "10.1128/AAC.02412-14" | ||
licence: "['Apache-2.0']" | ||
|
||
input: | ||
- meta: | ||
type: map | ||
description: | | ||
Groovy Map containing sample information | ||
e.g. [ id:'test', single_end:false ] | ||
- seqs: | ||
type: file | ||
description: Input FASTA or FASTQ formatted genome sequences | ||
pattern: "*.{fastq.gz,fq.gz,fastq.gz,fna.gz,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" | ||
- json: | ||
type: file | ||
description: The results from analysis in JSON format | ||
pattern: "*.json" | ||
- txt: | ||
type: file | ||
description: The summary of results from analysis | ||
pattern: "*.txt" | ||
- tsv: | ||
type: file | ||
description: The results from analysis in TSV format | ||
pattern: "*.tsv" | ||
- genome_seq: | ||
type: file | ||
description: FASTA of sequences in the input with a hit | ||
pattern: "*-hit_in_genome_seq.fsa" | ||
- plasmid_seq: | ||
type: file | ||
description: FASTA of plasmid sequences with a hit against the input | ||
pattern: "*-plasmid_seqs.fsa" | ||
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,7 @@ | ||
/* | ||
This file includes default parameter values. | ||
*/ | ||
|
||
params { | ||
// defense-finder update has no parameters | ||
} |
Oops, something went wrong.