forked from nf-core/modules
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add new module for conifer (nf-core#3763)
* add new module for conifer * fixing CI * fix test * Update main.nf --------- Co-authored-by: Robert A. Petit III <[email protected]>
- Loading branch information
Showing
6 changed files
with
123 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
process CONIFER { | ||
tag "$meta.id" | ||
label 'process_single' | ||
|
||
conda "bioconda::conifer=1.0.2" | ||
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? | ||
'https://depot.galaxyproject.org/singularity/conifer%3A1.0.2--he4a0461_0': | ||
'biocontainers/conifer:1.0.2--he4a0461_0' }" | ||
|
||
input: | ||
tuple val(meta), path(kraken_result) | ||
path kraken_taxon_db | ||
|
||
output: | ||
tuple val(meta), path("*.score"), emit: score | ||
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}" | ||
""" | ||
conifer \\ | ||
$args \\ | ||
--input $kraken_result \\ | ||
--db $kraken_taxon_db > ${prefix}.score | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
conifer: \$(echo \$(conifer --version 2>&1) | sed 's/^.*Conifer //') | ||
END_VERSIONS | ||
""" | ||
|
||
stub: | ||
def args = task.ext.args ?: '' | ||
def prefix = task.ext.prefix ?: "${meta.id}" | ||
""" | ||
touch ${prefix}.score | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
conifer: \$(echo \$(conifer --version 2>&1) | sed 's/^.*Conifer //') | ||
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,46 @@ | ||
name: conifer | ||
description: Calculate confidence scores from Kraken2 output | ||
keywords: | ||
- classify | ||
- metagenomics | ||
- kraken2 | ||
- confidence | ||
tools: | ||
- conifer: | ||
description: "Calculate confidence scores from Kraken2 output" | ||
homepage: "https://github.com/Ivarz/Conifer" | ||
documentation: "https://github.com/Ivarz/Conifer" | ||
tool_dev_url: "https://github.com/Ivarz/Conifer" | ||
licence: ["BSD / BSD-2-Clause"] | ||
input: | ||
- meta: | ||
type: map | ||
description: | | ||
Groovy Map containing sample information | ||
e.g. [ id:'test', single_end:false ] | ||
- kraken_result: | ||
type: file | ||
description: | | ||
Raw Kraken2 standard output file | ||
- kraken_taxon_db: | ||
type: file | ||
description: Kraken2 taxo.k2d database file | ||
|
||
output: | ||
- meta: | ||
type: map | ||
description: | | ||
Groovy Map containing sample information | ||
e.g. [ id:'test', single_end:false ] | ||
- score: | ||
type: file | ||
description: | | ||
Conifer report file containing confidence scores of Kraken2 classified reads. | ||
pattern: "*.score" | ||
- versions: | ||
type: file | ||
description: File containing software versions | ||
pattern: "versions.yml" | ||
authors: | ||
- "@icaromsc" | ||
- "@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
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,15 @@ | ||
#!/usr/bin/env nextflow | ||
|
||
nextflow.enable.dsl = 2 | ||
|
||
include { CONIFER } from '../../../../modules/nf-core/conifer/main.nf' | ||
|
||
workflow test_conifer { | ||
|
||
input = [ | ||
[ id:'test', single_end:false ], // meta map | ||
file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) | ||
] | ||
|
||
CONIFER ( input, [] ) | ||
} |
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,5 @@ | ||
process { | ||
|
||
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } | ||
|
||
} |
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,6 @@ | ||
- name: conifer test_conifer | ||
command: nextflow run ./tests/modules/nf-core/conifer -entry test_conifer -c ./tests/config/nextflow.config -stub-run | ||
tags: | ||
- conifer | ||
files: | ||
- path: output/conifer/test.score |