Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added module ALE #5211

Merged
merged 5 commits into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions modules/nf-core/ale/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json
name: "ale"
channels:
- conda-forge
- bioconda
- defaults
- tanghaibao
dependencies:
- "bioconda::ale=20180904"
50 changes: 50 additions & 0 deletions modules/nf-core/ale/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
process ALE {
tag "$meta.id"
label 'process_single'

// WARN: Version information not provided by tool on CLI. Please update version string below when bumping container versions.
conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/ale:20180904--py27ha92aebf_0':
'biocontainers/ale:20180904--py27ha92aebf_0' }"

input:
tuple val(meta), path(asm), path(bam)

output:
tuple val(meta), path("*_ALEoutput.txt"), emit: ale
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}"
def VERSION = '20180904' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions.
"""
ALE \\
$args \\
$bam \\
$asm \\
${prefix}_ALEoutput.txt

cat <<-END_VERSIONS > versions.yml
"${task.process}":
ale: $VERSION
END_VERSIONS
"""

stub:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def VERSION = '20180904' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions.
"""
touch ${prefix}_ALEoutput.txt

cat <<-END_VERSIONS > versions.yml
"${task.process}":
ale: $VERSION
END_VERSIONS
"""
}
51 changes: 51 additions & 0 deletions modules/nf-core/ale/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
name: "ale"
description: "ALE: assembly likelihood estimator."
keywords:
- reference-independent
- assembly
- evaluation
tools:
- "ale":
description: "ALE is a generic assembly likelihood evaluation framework for assessing the accuracy of genome and metagenome assemblies."
documentation: "https://portal.nersc.gov/dna/RD/Adv-Seq/ALE-doc/index.html#document-install"
tool_dev_url: "https://github.com/sc932/ALE"
doi: "10.1093/bioinformatics/bts723"
licence: ["NCSA"]

input:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1', single_end:false ]`

- asm:
type: file
description: Assembly in FASTA format
pattern: "*.{fasta,fa}"

- bam:
type: file
description: BAM file containing sorted read mappings
pattern: "*.{bam}"

output:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1', single_end:false ]`
- ale:
type: file
description: Output TXT file containing ALE results
pattern: "*_ALEoutput.{txt}"
- versions:
type: file
description: File containing software versions
pattern: "versions.yml"

authors:
- "@rodtheo"
maintainers:
- "@rodtheo"
108 changes: 108 additions & 0 deletions modules/nf-core/ale/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
// nf-core modules test ale
nextflow_process {

name "Test Process ALE"
script "../main.nf"
process "ALE"

tag "modules"
tag "modules_nfcore"
tag "ale"

test("sarscov2 [fasta] - paired-end sorted bam") {

when {
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true),
file(params.test_data['sarscov2']['illumina']['test_paired_end_bam'], checkIfExists: true)
]
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() },
{ assert path(process.out.ale[0][1]).readLines().first().contains("ALE_score") }
)
}

}

test("sarscov2 [fasta_gz] - paired-end sorted bam") {

when {
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
file(params.test_data['sarscov2']['genome']['genome_fasta_gz'], checkIfExists: true),
file(params.test_data['sarscov2']['illumina']['test_paired_end_bam'], checkIfExists: true)
]
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() },
{ assert path(process.out.ale[0][1]).readLines().first().contains("ALE_score") }
)
}

}

test("sarscov2 [fasta] - single-end sorted bam") {

when {
process {
"""
input[0] = [
[ id:'test', single_end:true ], // meta map
file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true),
file(params.test_data['sarscov2']['illumina']['test_single_end_bam'], checkIfExists: true)
]
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() },
{ assert path(process.out.ale[0][1]).readLines().first().contains("ALE_score") }
)
}

}

test("sarscov2 [fasta_gz] - single-end sorted bam") {

when {
process {
"""
input[0] = [
[ id:'test', single_end:true ], // meta map
file(params.test_data['sarscov2']['genome']['genome_fasta_gz'], checkIfExists: true),
file(params.test_data['sarscov2']['illumina']['test_single_end_bam'], checkIfExists: true)
]
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() },
{ assert path(process.out.ale[0][1]).readLines().first().contains("ALE_score") }
)
}

}

}
142 changes: 142 additions & 0 deletions modules/nf-core/ale/tests/main.nf.test.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions modules/nf-core/ale/tests/tags.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ale:
- "modules/nf-core/ale/**"
Loading