-
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.
Minor fixes to overall workflow to catch failed assemblies
- Loading branch information
1 parent
62e7a34
commit 13fa50b
Showing
21 changed files
with
659 additions
and
22 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
name: medaka_variant | ||
channels: | ||
- conda-forge | ||
- bioconda | ||
- defaults | ||
dependencies: | ||
- bioconda::medaka=2.0.1 |
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,37 @@ | ||
process MEDAKA_VARIANT { | ||
tag "$meta.sample_id" | ||
label 'short_parallel' | ||
|
||
conda "${moduleDir}/environment.yml" | ||
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? | ||
'https://depot.galaxyproject.org/singularity/medaka:2.0.1--py38h8774169_0' : | ||
'quay.io/biocontainers/medaka:2.0.1--py38h8774169_0' }" | ||
|
||
input: | ||
tuple val(meta), path(reads), path(assembly) | ||
|
||
output: | ||
tuple val(meta), path("*annotated.vcf") , emit: vcf | ||
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}" | ||
""" | ||
medaka_variant \\ | ||
-t $task.cpus \\ | ||
$args \\ | ||
-i $reads \\ | ||
-r $assembly \\ | ||
-o ./ | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
medaka: \$( medaka --version 2>&1 | sed 's/medaka //g' ) | ||
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,45 @@ | ||
name: medaka | ||
description: A tool to create consensus sequences and variant calls from nanopore sequencing data | ||
keywords: | ||
- assembly | ||
- polishing | ||
- nanopore | ||
tools: | ||
- medaka: | ||
description: Neural network sequence error correction. | ||
homepage: https://nanoporetech.github.io/medaka/index.html | ||
documentation: https://nanoporetech.github.io/medaka/index.html | ||
tool_dev_url: https://github.com/nanoporetech/medaka | ||
licence: ["Mozilla Public License 2.0"] | ||
input: | ||
- meta: | ||
type: map | ||
description: | | ||
Groovy Map containing sample information | ||
e.g. [ id:'test', single_end:false ] | ||
- reads: | ||
type: file | ||
description: List of input nanopore fasta/FastQ files | ||
pattern: "*.{fasta,fa,fastq,fastq.gz,fq,fq.gz}" | ||
- assembly: | ||
type: file | ||
description: Genome assembly | ||
pattern: "*.{fasta,fa}" | ||
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" | ||
- assembly: | ||
type: file | ||
description: Polished genome assembly | ||
pattern: "*.fa.gz" | ||
authors: | ||
- "@avantonder" | ||
maintainers: | ||
- "@avantonder" |
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,37 @@ | ||
nextflow_process { | ||
|
||
name "Test Process MEDAKA" | ||
tag "modules_nfcore" | ||
tag "modules" | ||
tag "medaka" | ||
script "../main.nf" | ||
process "MEDAKA" | ||
|
||
test("Medaka") { | ||
|
||
when { | ||
process { | ||
""" | ||
input[0] = [ | ||
[ id:'test', single_end:true ], // meta map | ||
file(params.modules_testdata_base_path + 'genomics/sarscov2/nanopore/fastq/test.fastq.gz', checkIfExists: true), | ||
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) | ||
] | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll( | ||
{ assert process.success }, | ||
{ assert snapshot( | ||
path(process.out.assembly[0][1]).linesGzip.join()[0..99], | ||
process.out.versions | ||
).match() | ||
} | ||
) | ||
} | ||
|
||
} | ||
|
||
} |
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 @@ | ||
{ | ||
"Medaka": { | ||
"content": [ | ||
">MT192765.1GTTTATACCTTCCCAGGTAACAAACCAACCAACTTTCGATCTCTTGTAGATCTGTTCTCTAAACGAACTTTAAAATCTGTGTGGCTGTC", | ||
[ | ||
"versions.yml:md5,739bb00a08faba4029f9f5ab9c15275a" | ||
] | ||
], | ||
"meta": { | ||
"nf-test": "0.8.4", | ||
"nextflow": "24.04.4" | ||
}, | ||
"timestamp": "2024-08-14T12:51:51.820749" | ||
} | ||
} |
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 @@ | ||
medaka: | ||
- modules/nf-core/medaka/** |
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: tabix_bgzip | ||
channels: | ||
- conda-forge | ||
- bioconda | ||
- defaults | ||
dependencies: | ||
- bioconda::tabix=1.11 | ||
- bioconda::htslib=1.20 |
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,41 @@ | ||
process TABIX_BGZIP { | ||
tag "$meta.sample_id" | ||
label 'short_serial' | ||
|
||
conda "${moduleDir}/environment.yml" | ||
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? | ||
'https://depot.galaxyproject.org/singularity/htslib:1.20--h5efdd21_2' : | ||
'quay.io/biocontainers/htslib:1.20--h5efdd21_2' }" | ||
|
||
input: | ||
tuple val(meta), path(input) | ||
|
||
output: | ||
tuple val(meta), path("${output}") , emit: output | ||
tuple val(meta), path("${output}.gzi"), emit: gzi, optional: true | ||
path "versions.yml" , emit: versions | ||
|
||
when: | ||
task.ext.when == null || task.ext.when | ||
|
||
script: | ||
def args = task.ext.args ?: '' | ||
prefix = task.ext.prefix ?: "${meta.sample_id}" | ||
in_bgzip = ["gz", "bgz", "bgzf"].contains(input.getExtension()) | ||
extension = in_bgzip ? input.getBaseName().tokenize(".")[-1] : input.getExtension() | ||
output = in_bgzip ? "${prefix}.${extension}" : "${prefix}.${extension}.gz" | ||
command = in_bgzip ? '-d' : '' | ||
// Name the index according to $prefix, unless a name has been requested | ||
if ((args.matches("(^| )-i\\b") || args.matches("(^| )--index(\$| )")) && !args.matches("(^| )-I\\b") && !args.matches("(^| )--index-name\\b")) { | ||
args = args + " -I ${output}.gzi" | ||
} | ||
""" | ||
bgzip $command -c $args -@${task.cpus} $input > ${output} | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
tabix: \$(echo \$(tabix -h 2>&1) | sed 's/^.*Version: //; s/ .*\$//') | ||
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,52 @@ | ||
name: tabix_bgzip | ||
description: Compresses/decompresses files | ||
keywords: | ||
- compress | ||
- decompress | ||
- bgzip | ||
- tabix | ||
tools: | ||
- bgzip: | ||
description: | | ||
Bgzip compresses or decompresses files in a similar manner to, and compatible with, gzip. | ||
homepage: https://www.htslib.org/doc/tabix.html | ||
documentation: http://www.htslib.org/doc/bgzip.html | ||
doi: 10.1093/bioinformatics/btp352 | ||
licence: ["MIT"] | ||
input: | ||
- meta: | ||
type: map | ||
description: | | ||
Groovy Map containing sample information | ||
e.g. [ id:'test', single_end:false ] | ||
- input: | ||
type: file | ||
description: file to compress or to decompress | ||
output: | ||
- meta: | ||
type: map | ||
description: | | ||
Groovy Map containing sample information | ||
e.g. [ id:'test', single_end:false ] | ||
- output: | ||
type: file | ||
description: Output compressed/decompressed file | ||
pattern: "*." | ||
- gzi: | ||
type: file | ||
description: Optional gzip index file for compressed inputs | ||
pattern: "*.gzi" | ||
- versions: | ||
type: file | ||
description: File containing software versions | ||
pattern: "versions.yml" | ||
authors: | ||
- "@joseespinosa" | ||
- "@drpatelh" | ||
- "@maxulysse" | ||
- "@nvnieuwk" | ||
maintainers: | ||
- "@joseespinosa" | ||
- "@drpatelh" | ||
- "@maxulysse" | ||
- "@nvnieuwk" |
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 { | ||
withName: TABIX_BGZIP { | ||
ext.args = ' -i' | ||
} | ||
} |
Oops, something went wrong.