Skip to content

Commit

Permalink
Merge branch 'master' into das_tool
Browse files Browse the repository at this point in the history
  • Loading branch information
prototaxites authored Dec 10, 2024
2 parents f07910d + 9e13262 commit 0599b7c
Show file tree
Hide file tree
Showing 17 changed files with 358 additions and 48 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/gpu-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ env:
NXF_SINGULARITY_CACHEDIR: ${{ github.workspace }}/.singularity
NXF_SINGULARITY_LIBRARYDIR: ${{ github.workspace }}/.singularity
# renovate: datasource=github-releases depName=nextflow-io/nextflow versioning=semver
NXF_VER: "24.10.1"
NXF_VER: "24.10.2"

jobs:
nf-test-changes:
Expand Down Expand Up @@ -108,13 +108,18 @@ jobs:
needs: [nf-test-gpu]
if: always()
steps:
- name: All tests ok
if: ${{ success() || !contains(needs.*.result, 'failure') }}
run: exit 0
- name: One or more tests failed
if: ${{ contains(needs.*.result, 'failure') }}
run: exit 1

- name: One or more tests cancelled
if: ${{ contains(needs.*.result, 'cancelled') }}
run: exit 1

- name: All tests ok
if: ${{ contains(needs.*.result, 'success') }}
run: exit 0

- name: debug-print
if: always()
run: |
Expand Down
13 changes: 9 additions & 4 deletions .github/workflows/nf-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ env:
NXF_SINGULARITY_CACHEDIR: ${{ github.workspace }}/.singularity
NXF_SINGULARITY_LIBRARYDIR: ${{ github.workspace }}/.singularity
# renovate: datasource=github-releases depName=nextflow/nextflow versioning=semver
NXF_VER: "24.10.1"
NXF_VER: "24.10.2"

jobs:
nf-test-changes:
Expand Down Expand Up @@ -110,13 +110,18 @@ jobs:
needs: [nf-test]
if: always()
steps:
- name: All tests ok
if: ${{ success() || !contains(needs.*.result, 'failure') }}
run: exit 0
- name: One or more tests failed
if: ${{ contains(needs.*.result, 'failure') }}
run: exit 1

- name: One or more tests cancelled
if: ${{ contains(needs.*.result, 'cancelled') }}
run: exit 1

- name: All tests ok
if: ${{ contains(needs.*.result, 'success') }}
run: exit 0

- name: debug-print
if: always()
run: |
Expand Down
1 change: 0 additions & 1 deletion modules/nf-core/bwameth/align/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -117,5 +117,4 @@ nextflow_process {
)
}
}

}
5 changes: 5 additions & 0 deletions modules/nf-core/foldmason/msa2lddtreport/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
channels:
- conda-forge
- bioconda
dependencies:
- bioconda::foldmason=2.7bd21ed
52 changes: 52 additions & 0 deletions modules/nf-core/foldmason/msa2lddtreport/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
process FOLDMASON_MSA2LDDTREPORT {
tag "$meta.id"
label 'process_medium'

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/a8/a88d162c3f39a1518d48c3faec235e6fcde750586da868b62fc5f0a08a89aa9d/data' :
'community.wave.seqera.io/library/foldmason:2.7bd21ed--e7f739473ad6578d' }"
input:
tuple val(meta) , path(msa)
tuple val(meta2), path(db)
tuple val(meta3), path(pdbs)
tuple val(meta4), path(tree)

output:
tuple val(meta), path("${prefix}.html"), emit: html
path "versions.yml" , emit: versions

when:
task.ext.when == null || task.ext.when

script:
def args = task.ext.args ?: ''
prefix = task.ext.prefix ?: "${meta.id}"
def options_tree = tree ? "--guide-tree $tree" : ""
"""
foldmason msa2lddtreport \\
${meta.id} \\
${msa} \\
${prefix}.html \\
$args \\
${options_tree} \\
--threads $task.cpus
cat <<-END_VERSIONS > versions.yml
"${task.process}":
foldmason: \$(foldmason | grep "foldmason Version:" | cut -d":" -f 2 | awk '{\$1=\$1;print}')
END_VERSIONS
"""

stub:
def args = task.ext.args ?: ''
prefix = task.ext.prefix ?: "${meta.id}"
"""
touch ${prefix}.html
cat <<-END_VERSIONS > versions.yml
"${task.process}":
foldmason: \$(foldmason | grep "foldmason Version:" | cut -d":" -f 2 | awk '{\$1=\$1;print}')
END_VERSIONS
"""
}
74 changes: 74 additions & 0 deletions modules/nf-core/foldmason/msa2lddtreport/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: "foldmason_msa2lddtreport"
description: Renders a visualization report using foldmason
keywords:
- alignment
- MSA
- genomics
- structure
tools:
- "foldmason":
description: "Multiple Protein Structure Alignment at Scale with FoldMason"
homepage: "https://github.com/steineggerlab/foldmason"
documentation: "https://github.com/steineggerlab/foldmason"
tool_dev_url: "https://github.com/steineggerlab/foldmason"
doi: "10.1101/2024.08.01.606130"
licence: ["GPL v3"]
identifier: biotools:foldmason

input:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1', single_end:false ]`
- msa:
type: file
description: Input alignment file.
pattern: "*.{fa,fasta,aln}"
- - meta2:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1', single_end:false ]`
- db:
type: file
description: Input foldmason database.
pattern: "*"
- - meta3:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1', single_end:false ]`
- pdbs:
type: file
description: Protein structures used for the visualization.
pattern: "*.{pdb}"
- - meta4:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1', single_end:false ]`
- tree:
type: file
description: Guide tree used for the visualization .
pattern: "*.{nwk,dnd}"
output:
- html:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1', single_end:false ]`
- "${prefix}.html":
type: file
description: HTML file with the foldmason visualization
pattern: "*.{html}"
- versions:
- versions.yml:
type: file
description: File containing software versions
pattern: "versions.yml"
authors:
- "@luisas"
maintainers:
- "@luisas"
101 changes: 101 additions & 0 deletions modules/nf-core/foldmason/msa2lddtreport/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
nextflow_process {

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

tag "modules"
tag "modules_nfcore"
tag "foldmason"
tag "foldmason/msa2lddtreport"
tag "foldmason/createdb"
tag "untar"
tag "famsa/guidetree"


setup{
run("UNTAR") {
script "../../../../../modules/nf-core/untar/main.nf"
process {
"""
archive = file("https://raw.githubusercontent.com/nf-core/test-datasets/multiplesequencealign/testdata/af2_structures/seatoxin-ref.tar.gz", checkIfExists: true)
input[0] = Channel.of(tuple([id:'test'], archive))
"""
}
}

run("FAMSA_GUIDETREE") {
script "../../../../../modules/nf-core/famsa/guidetree/main.nf"
process {
"""
input[0] = [ [ id:'test_tree' ], // meta map
file(params.modules_testdata_base_path + "../../multiplesequencealign/testdata/setoxin-ref.fa", checkIfExists: true)
]
"""
}
}

run("FOLDMASON_CREATEDB") {
script "../../../../../modules/nf-core/foldmason/createdb/main.nf"
process {
"""
input[0] = UNTAR.out.untar.map { meta,dir -> [meta, file(dir).listFiles().collect()]}
"""
}
}


}

test("seatoxin") {


when {
process {
"""
input[0] =[ [ id:'test' ], // meta map
file(params.modules_testdata_base_path + "../../multiplesequencealign/testdata/setoxin.ref", checkIfExists: true)
]
input[1] = FOLDMASON_CREATEDB.out.db.collect{ meta, db -> db }.map{ db -> [[ id: 'test'], db]}
input[2] = UNTAR.out.untar.map { meta,dir -> [meta, file(dir).listFiles().collect()]}
input[3] = FAMSA_GUIDETREE.out.tree.collect{ meta, tree -> tree }.map{ tree -> [[ id: 'test_tree'], tree]}
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() }
)
}

}

test("seatixin - stub") {

options "-stub"

when {
process {
"""
input[0] =[ [ id:'test_tree' ], // meta map
file(params.modules_testdata_base_path + "../../multiplesequencealign/testdata/setoxin.ref", checkIfExists: true)
]
input[1] = FOLDMASON_CREATEDB.out.db.collect{ meta, db -> db }.map{ db -> [[ id: 'test'], db]}
input[2] = UNTAR.out.untar.map { meta,dir -> [meta, file(dir).listFiles().collect()]}
input[3] = FAMSA_GUIDETREE.out.tree.collect{ meta, tree -> tree }.map{ tree -> [[ id: 'test_tree'], tree]}
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() }
)
}

}

}
68 changes: 68 additions & 0 deletions modules/nf-core/foldmason/msa2lddtreport/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{
"seatixin - stub": {
"content": [
{
"0": [
[
{
"id": "test_tree"
},
"test_tree.html:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"1": [
"versions.yml:md5,ed922d0faa7a3e3c8171a05296939468"
],
"html": [
[
{
"id": "test_tree"
},
"test_tree.html:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"versions": [
"versions.yml:md5,ed922d0faa7a3e3c8171a05296939468"
]
}
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "24.10.2"
},
"timestamp": "2024-12-10T09:36:23.360594258"
},
"seatoxin": {
"content": [
{
"0": [
[
{
"id": "test"
},
"test.html:md5,7a90a8e674dc45ce4181498b8f53b519"
]
],
"1": [
"versions.yml:md5,ed922d0faa7a3e3c8171a05296939468"
],
"html": [
[
{
"id": "test"
},
"test.html:md5,7a90a8e674dc45ce4181498b8f53b519"
]
],
"versions": [
"versions.yml:md5,ed922d0faa7a3e3c8171a05296939468"
]
}
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "24.10.2"
},
"timestamp": "2024-12-10T09:54:03.711567262"
}
}
2 changes: 1 addition & 1 deletion modules/nf-core/megahit/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ process MEGAHIT {
def args = task.ext.args ?: ''
def args2 = task.ext.args2 ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def reads_command = meta.single_end || !reads2 ? "-r ${reads1}" : "-1 ${reads1.join(',')} -2 ${reads2.join(',')}"
def reads_command = meta.single_end || !reads2 ? "-r ${reads1.join(',')}" : "-1 ${reads1.join(',')} -2 ${reads2.join(',')}"
"""
megahit \\
${reads_command} \\
Expand Down
2 changes: 1 addition & 1 deletion modules/nf-core/ngsbits/samplegender/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ channels:
- conda-forge
- bioconda
dependencies:
- bioconda::ngs-bits=2023_02
- bioconda::ngs-bits=2024_11
Loading

0 comments on commit 0599b7c

Please sign in to comment.