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.
added new module lofraq/viterbi; solves new module: lofreq/viterbi nf…
…-core#5158 (nf-core#5197) * added new module lofraq/viterbi; solves new module: lofreq/viterbi nf-core#5158 * added new module lofraq/viterbi; solves new module: lofreq/viterbi nf-core#5158 * removed yml schema comments * added samtools as conda dependency; chnaged container build version to py310h47ef89e_10; updated test snapshot
- Loading branch information
1 parent
a27d67c
commit 12929d6
Showing
6 changed files
with
250 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,8 @@ | ||
name: "lofreq_viterbi" | ||
channels: | ||
- conda-forge | ||
- bioconda | ||
- defaults | ||
dependencies: | ||
- bioconda::lofreq=2.1.5 | ||
- bioconda::samtools=1.17 |
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,54 @@ | ||
process LOFREQ_VITERBI { | ||
tag "$meta.id" | ||
label 'process_single' | ||
|
||
conda "${moduleDir}/environment.yml" | ||
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? | ||
'https://depot.galaxyproject.org/singularity/lofreq:2.1.5--py310h47ef89e_10' : | ||
'biocontainers/lofreq:2.1.5--py310h47ef89e_10' }" | ||
|
||
input: | ||
tuple val(meta), path(bam) | ||
path(fasta) | ||
|
||
output: | ||
tuple val(meta), path("*.bam"), emit: bam | ||
path "versions.yml" , emit: versions | ||
|
||
when: | ||
task.ext.when == null || task.ext.when | ||
|
||
script: | ||
def args = task.ext.args ?: '' | ||
def args2 = task.ext.args2 ?: '' | ||
def prefix = task.ext.prefix ?: "${meta.id}" | ||
""" | ||
lofreq \\ | ||
viterbi \\ | ||
$args \\ | ||
-ref $fasta \\ | ||
$bam | | ||
samtools sort \\ | ||
$args2 \\ | ||
-T ${prefix} \\ | ||
--threads $task.cpus \\ | ||
-o ${prefix}.bam | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
lofreq: \$(echo \$(lofreq version 2>&1) | sed 's/^version: //; s/ *commit.*\$//') | ||
END_VERSIONS | ||
""" | ||
|
||
stub: | ||
def args = task.ext.args ?: '' | ||
def prefix = task.ext.prefix ?: "${meta.id}" | ||
""" | ||
touch ${prefix}.bam | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
lofreq: \$(echo \$(lofreq version 2>&1) | sed 's/^version: //; s/ *commit.*\$//') | ||
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,50 @@ | ||
name: "lofreq_viterbi" | ||
description: Lofreq subcommand to call low frequency variants from alignments when tumor-normal paired samples are available | ||
keywords: | ||
- variant calling | ||
- low frequency variant calling | ||
- variants | ||
- bam | ||
- probabilistic realignment | ||
tools: | ||
- "lofreq": | ||
description: "A fast and sensitive variant-caller for inferring SNVs and indels from next-generation sequencing data" | ||
homepage: https://csb5.github.io/lofreq/ | ||
documentation: https://csb5.github.io/lofreq/commands/ | ||
doi: 10.1093/nar/gks918 | ||
licence: ["MIT"] | ||
input: | ||
# Only when we have meta | ||
- meta: | ||
type: map | ||
description: | | ||
Groovy Map containing sample information | ||
e.g. `[ id:'sample1', single_end:false ]` | ||
- bam: | ||
type: file | ||
description: Sorted BAM file | ||
pattern: "*.{bam}" | ||
- fasta: | ||
type: file | ||
description: Reference genome FASTA file | ||
pattern: "*.{fasta}" | ||
output: | ||
- meta: | ||
type: map | ||
description: | | ||
Groovy Map containing sample information | ||
e.g. `[ id:'sample1', single_end:false ]` | ||
- versions: | ||
type: file | ||
description: File containing software versions | ||
pattern: "versions.yml" | ||
- bam: | ||
type: file | ||
description: Realignment and sorted BAM file | ||
pattern: "*.{bam}" | ||
|
||
authors: | ||
- "@MarieLataretu" | ||
maintainers: | ||
- "@MarieLataretu" |
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 @@ | ||
nextflow_process { | ||
|
||
name "Test Process LOFREQ_VITERBI" | ||
script "../main.nf" | ||
process "LOFREQ_VITERBI" | ||
|
||
tag "modules" | ||
tag "modules_nfcore" | ||
tag "lofreq" | ||
tag "lofreq/viterbi" | ||
|
||
test("sarscov2 - bam, fasta") { | ||
|
||
when { | ||
process { | ||
""" | ||
input[0] = [ | ||
[ id:'test', single_end:false ], // meta map | ||
file(params.test_data['sarscov2']['illumina']['test_paired_end_bam'], checkIfExists: true) | ||
] | ||
input[1] = [ | ||
file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) | ||
] | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll( | ||
{ assert process.success }, | ||
{ assert snapshot(process.out).match() } | ||
) | ||
} | ||
|
||
} | ||
|
||
test("sarscov2 - bam, fasta - stub") { | ||
|
||
options "-stub" | ||
|
||
when { | ||
process { | ||
""" | ||
input[0] = [ | ||
[ id:'test', single_end:false ], // meta map | ||
file(params.test_data['sarscov2']['illumina']['test_paired_end_bam'], checkIfExists: true) | ||
] | ||
input[1] = [ | ||
file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) | ||
] | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll( | ||
{ assert process.success }, | ||
{ assert snapshot(process.out).match() } | ||
) | ||
} | ||
|
||
} | ||
|
||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,2 @@ | ||
lofreq/viterbi: | ||
- "modules/nf-core/lofreq/viterbi/**" |