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

Foldseek: createdb and easysearch modules version bump + stub nf-tests added #5906

Merged
merged 4 commits into from
Jul 2, 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
3 changes: 2 additions & 1 deletion modules/nf-core/foldseek/createdb/environment.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: foldseek_createdb
channels:
- conda-forge
- bioconda
- defaults
dependencies:
- bioconda::foldseek=8.ef4e960
- bioconda::foldseek=9.427df8a
35 changes: 17 additions & 18 deletions modules/nf-core/foldseek/createdb/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ process FOLDSEEK_CREATEDB {

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/foldseek:8.ef4e960--pl5321hb365157_0':
'biocontainers/foldseek:8.ef4e960--pl5321hb365157_0' }"
'https://depot.galaxyproject.org/singularity/foldseek:9.427df8a--pl5321hb365157_0':
'biocontainers/foldseek:9.427df8a--pl5321hb365157_0' }"

input:
tuple val(meta), path(pdb)
Expand Down Expand Up @@ -39,22 +39,21 @@ process FOLDSEEK_CREATEDB {
def prefix = task.ext.prefix ?: "${meta.id}"

"""
mkdir -p targetDB
touch ${prefix}
touch ${prefix}_ca
touch ${prefix}_ca.dbtype
touch ${prefix}_ca.index
touch ${prefix}_h
touch ${prefix}_h.dbtype
touch ${prefix}_h.index
touch ${prefix}_ss
touch ${prefix}_ss.dbtype
touch ${prefix}_ss.index
touch ${prefix}.dbtype
touch ${prefix}.index
touch ${prefix}.lookup
touch ${prefix}.source
mv ${prefix}* targetDB
mkdir -p ${prefix}
touch ${prefix}/${prefix}
touch ${prefix}/${prefix}_ca
touch ${prefix}/${prefix}_ca.dbtype
touch ${prefix}/${prefix}_ca.index
touch ${prefix}/${prefix}_h
touch ${prefix}/${prefix}_h.dbtype
touch ${prefix}/${prefix}_h.index
touch ${prefix}/${prefix}_ss
touch ${prefix}/${prefix}_ss.dbtype
touch ${prefix}/${prefix}_ss.index
touch ${prefix}/${prefix}.dbtype
touch ${prefix}/${prefix}.index
touch ${prefix}/${prefix}.lookup
touch ${prefix}/${prefix}.source

cat <<-END_VERSIONS > versions.yml
"${task.process}":
Expand Down
2 changes: 1 addition & 1 deletion modules/nf-core/foldseek/createdb/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ tools:
documentation: "https://github.com/steineggerlab/foldseek"
tool_dev_url: "https://github.com/steineggerlab/foldseek"
doi: "10.1038/s41587-023-01773-0"
licence: "['GPL v3']"
licence: ["GPL v3"]
input:
- meta:
type: map
Expand Down
30 changes: 23 additions & 7 deletions modules/nf-core/foldseek/createdb/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,9 @@ nextflow_process {
tag "foldseek"
tag "foldseek/createdb"

test("Should build a protein structures database") {
test("proteomics - pdb") {

when {
params {
outdir = "$outputDir"
}
process {
"""
input[0] = [ [id:'test'], file(params.test_data['proteomics']['pdb']['tim1_pdb'], checkIfExists: true) ]
Expand All @@ -23,12 +20,31 @@ nextflow_process {

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

}

test("proteomics - pdb - stub") {

options "-stub"

when {
process {
"""
input[0] = [ [id:'test'], file(params.test_data['proteomics']['pdb']['tim1_pdb'], checkIfExists: true) ]
"""
}
}

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

}
}
134 changes: 112 additions & 22 deletions modules/nf-core/foldseek/createdb/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -1,30 +1,120 @@
{
"db": {
"proteomics - pdb": {
"content": [
[
[
{
"id": "test"
},
{
"0": [
[
"test:md5,5509f0851612be656f0659d62e290366",
"test.dbtype:md5,f1d3ff8443297732862df21dc4e57262",
"test.index:md5,e7eb45c3cbd57553ff8f024c7c83ed11",
"test.lookup:md5,bc6d0e967a6b30342597737ea862ae62",
"test.source:md5,42c68f3f5196a489d80b6d26ac8ac5f6",
"test_ca:md5,a5c5ffa9e813f7c35ed9a2737d4ef786",
"test_ca.dbtype:md5,3fd85f9ee7ca8882c8caa747d0eef0b3",
"test_ca.index:md5,4020bfeefff484c9c973a895fa76c4bd",
"test_h:md5,6420b4e4730941b10e159971f826e74b",
"test_h.dbtype:md5,740bab4f9ec8808aedb68d6b1281aeb2",
"test_h.index:md5,e194f33e47acf6d687d572a45b784550",
"test_ss:md5,88d06580a2ee6a6a81a7821a423013a9",
"test_ss.dbtype:md5,f1d3ff8443297732862df21dc4e57262",
"test_ss.index:md5,e7eb45c3cbd57553ff8f024c7c83ed11"
{
"id": "test"
},
[
"test:md5,5509f0851612be656f0659d62e290366",
"test.dbtype:md5,f1d3ff8443297732862df21dc4e57262",
"test.index:md5,e7eb45c3cbd57553ff8f024c7c83ed11",
"test.lookup:md5,3e653ea1ae44ba5404342b37c72f05f6",
"test.source:md5,1144e80754b5ba7bd85670e2be1c96db",
"test_ca:md5,a5c5ffa9e813f7c35ed9a2737d4ef786",
"test_ca.dbtype:md5,3fd85f9ee7ca8882c8caa747d0eef0b3",
"test_ca.index:md5,4020bfeefff484c9c973a895fa76c4bd",
"test_h:md5,eb1f0b213589e93fa639d3ae91bcff2f",
"test_h.dbtype:md5,740bab4f9ec8808aedb68d6b1281aeb2",
"test_h.index:md5,11940a92d3235f31b8a487c59a1ff812",
"test_ss:md5,88d06580a2ee6a6a81a7821a423013a9",
"test_ss.dbtype:md5,f1d3ff8443297732862df21dc4e57262",
"test_ss.index:md5,e7eb45c3cbd57553ff8f024c7c83ed11"
]
]
],
"1": [
"versions.yml:md5,02cfa3c3fbc560c23e27f604a55cb952"
],
"db": [
[
{
"id": "test"
},
[
"test:md5,5509f0851612be656f0659d62e290366",
"test.dbtype:md5,f1d3ff8443297732862df21dc4e57262",
"test.index:md5,e7eb45c3cbd57553ff8f024c7c83ed11",
"test.lookup:md5,3e653ea1ae44ba5404342b37c72f05f6",
"test.source:md5,1144e80754b5ba7bd85670e2be1c96db",
"test_ca:md5,a5c5ffa9e813f7c35ed9a2737d4ef786",
"test_ca.dbtype:md5,3fd85f9ee7ca8882c8caa747d0eef0b3",
"test_ca.index:md5,4020bfeefff484c9c973a895fa76c4bd",
"test_h:md5,eb1f0b213589e93fa639d3ae91bcff2f",
"test_h.dbtype:md5,740bab4f9ec8808aedb68d6b1281aeb2",
"test_h.index:md5,11940a92d3235f31b8a487c59a1ff812",
"test_ss:md5,88d06580a2ee6a6a81a7821a423013a9",
"test_ss.dbtype:md5,f1d3ff8443297732862df21dc4e57262",
"test_ss.index:md5,e7eb45c3cbd57553ff8f024c7c83ed11"
]
]
],
"versions": [
"versions.yml:md5,02cfa3c3fbc560c23e27f604a55cb952"
]
}
],
"timestamp": "2024-07-02T14:04:11.393697557"
},
"proteomics - pdb - stub": {
"content": [
{
"0": [
[
{
"id": "test"
},
[
"test:md5,d41d8cd98f00b204e9800998ecf8427e",
"test.dbtype:md5,d41d8cd98f00b204e9800998ecf8427e",
"test.index:md5,d41d8cd98f00b204e9800998ecf8427e",
"test.lookup:md5,d41d8cd98f00b204e9800998ecf8427e",
"test.source:md5,d41d8cd98f00b204e9800998ecf8427e",
"test_ca:md5,d41d8cd98f00b204e9800998ecf8427e",
"test_ca.dbtype:md5,d41d8cd98f00b204e9800998ecf8427e",
"test_ca.index:md5,d41d8cd98f00b204e9800998ecf8427e",
"test_h:md5,d41d8cd98f00b204e9800998ecf8427e",
"test_h.dbtype:md5,d41d8cd98f00b204e9800998ecf8427e",
"test_h.index:md5,d41d8cd98f00b204e9800998ecf8427e",
"test_ss:md5,d41d8cd98f00b204e9800998ecf8427e",
"test_ss.dbtype:md5,d41d8cd98f00b204e9800998ecf8427e",
"test_ss.index:md5,d41d8cd98f00b204e9800998ecf8427e"
]
]
],
"1": [
"versions.yml:md5,02cfa3c3fbc560c23e27f604a55cb952"
],
"db": [
[
{
"id": "test"
},
[
"test:md5,d41d8cd98f00b204e9800998ecf8427e",
"test.dbtype:md5,d41d8cd98f00b204e9800998ecf8427e",
"test.index:md5,d41d8cd98f00b204e9800998ecf8427e",
"test.lookup:md5,d41d8cd98f00b204e9800998ecf8427e",
"test.source:md5,d41d8cd98f00b204e9800998ecf8427e",
"test_ca:md5,d41d8cd98f00b204e9800998ecf8427e",
"test_ca.dbtype:md5,d41d8cd98f00b204e9800998ecf8427e",
"test_ca.index:md5,d41d8cd98f00b204e9800998ecf8427e",
"test_h:md5,d41d8cd98f00b204e9800998ecf8427e",
"test_h.dbtype:md5,d41d8cd98f00b204e9800998ecf8427e",
"test_h.index:md5,d41d8cd98f00b204e9800998ecf8427e",
"test_ss:md5,d41d8cd98f00b204e9800998ecf8427e",
"test_ss.dbtype:md5,d41d8cd98f00b204e9800998ecf8427e",
"test_ss.index:md5,d41d8cd98f00b204e9800998ecf8427e"
]
]
],
"versions": [
"versions.yml:md5,02cfa3c3fbc560c23e27f604a55cb952"
]
]
}
],
"timestamp": "2023-11-09T11:03:51.066468346"
"timestamp": "2024-07-02T14:04:15.995578638"
}
}
3 changes: 2 additions & 1 deletion modules/nf-core/foldseek/easysearch/environment.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: foldseek_easysearch
channels:
- conda-forge
- bioconda
- defaults
dependencies:
- bioconda::foldseek=8.ef4e960
- bioconda::foldseek=9.427df8a
4 changes: 2 additions & 2 deletions modules/nf-core/foldseek/easysearch/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ process FOLDSEEK_EASYSEARCH {

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/foldseek:8.ef4e960--pl5321hb365157_0':
'biocontainers/foldseek:8.ef4e960--pl5321hb365157_0' }"
'https://depot.galaxyproject.org/singularity/foldseek:9.427df8a--pl5321hb365157_0':
'biocontainers/foldseek:9.427df8a--pl5321hb365157_0' }"

input:
tuple val(meta) , path(pdb)
Expand Down
2 changes: 1 addition & 1 deletion modules/nf-core/foldseek/easysearch/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ tools:
documentation: "https://github.com/steineggerlab/foldseek"
tool_dev_url: "https://github.com/steineggerlab/foldseek"
doi: "10.1038/s41587-023-01773-0"
licence: "['GPL v3']"
licence: ["GPL v3"]
input:
- meta:
type: map
Expand Down
50 changes: 35 additions & 15 deletions modules/nf-core/foldseek/easysearch/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,46 @@ nextflow_process {
tag "modules"
tag "modules_nfcore"
tag "foldseek"
tag "foldseek/createdb"
tag "foldseek/easysearch"

test("Should search for protein structural hits against a protein structures database") {

setup {
run("FOLDSEEK_CREATEDB") {
script "../../createdb/main.nf"
process {
"""
input[0] = [ [ id:'test_db' ], [ file(params.test_data['proteomics']['pdb']['tim1_pdb'], checkIfExists: true) ] ]
"""
}
setup {
run("FOLDSEEK_CREATEDB") {
script "../../createdb/main.nf"
process {
"""
input[0] = [ [ id:'test_db' ], [ file(params.test_data['proteomics']['pdb']['tim1_pdb'], checkIfExists: true) ] ]
"""
}
}
}

test("proteomics - pdb") {

when {
params {
outdir = "$outputDir"
process {
"""
input[0] = [ [ id:'test_search' ], [ file(params.test_data['proteomics']['pdb']['tim8_pdb'], checkIfExists: true) ] ]
input[1] = FOLDSEEK_CREATEDB.out.db
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert path(process.out.aln.get(0).get(1)).readLines().contains("8tim_A\t1tim_A\t0.967\t247\t8\t0\t1\t247\t1\t247\t1.152E-43\t1523") },
{ assert process.out.versions }
)
}

}

test("proteomics - pdb -stub") {

options "-stub"

when {
process {
"""
input[0] = [ [ id:'test_search' ], [ file(params.test_data['proteomics']['pdb']['tim8_pdb'], checkIfExists: true) ] ]
Expand All @@ -35,9 +56,8 @@ nextflow_process {

then {
assertAll(
{ assert process.success },
{ assert path(process.out.aln.get(0).get(1)).readLines().contains("8tim.pdb_A\t1tim.pdb_A\t0.967\t247\t8\t0\t1\t247\t1\t247\t1.152E-43\t1523") },
{ assert process.out.versions }
{ assert process.success },
{ assert snapshot(process.out).match() }
)
}

Expand Down
31 changes: 31 additions & 0 deletions modules/nf-core/foldseek/easysearch/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"proteomics - pdb -stub": {
"content": [
{
"0": [
[
{
"id": "test_search"
},
"test_search.m8:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"1": [
"versions.yml:md5,ddc75b2e08b63a7082ecad353073fd3b"
],
"aln": [
[
{
"id": "test_search"
},
"test_search.m8:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"versions": [
"versions.yml:md5,ddc75b2e08b63a7082ecad353073fd3b"
]
}
],
"timestamp": "2024-07-02T13:55:57.915188646"
}
}
Loading