Skip to content

Commit

Permalink
Add additional test to sentieon/bwamem and update docs on sentieon us…
Browse files Browse the repository at this point in the history
…e for local testing (#6025)

* fix tests

* update readme

* style: Run prettier

* check for matching instead

* clean up readme

---------

Co-authored-by: Edmund Miller <[email protected]>
  • Loading branch information
FriederikeHanssen and edmundmiller authored Jul 24, 2024
1 parent d12bb6c commit 252aeec
Show file tree
Hide file tree
Showing 3 changed files with 317 additions and 158 deletions.
14 changes: 13 additions & 1 deletion modules/nf-core/sentieon/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,24 @@ The Server IP doesn't matter either because they would also need the `SENTIEON_E
## Local Testing

```bash
export SENTIEON_AUTH_MECH="GitHub Actions - token"
export SENTIEON_LICSRVR_IP=$(op read "op://Dev/Sentieon License Server/SENTIEON_LICSRVR_IP")
```

For `SENTIEON_LICSRVR_IP` you can use your own server IP.

Additionally, the following may be necessary. If you don't know either key, you probably don't need it:

<details markdown="1">
<summary>Optional configuration</summary>

```bash
export SENTIEON_AUTH_MECH="GitHub Actions - token"
SENTIEON_ENCRYPTION_KEY=$(op read "op://Dev/Sentieon License Server/GitHub Secrets/SENTIEON_ENCRYPTION_KEY")
SENTIEON_LICENSE_MESSAGE=$(op read "op://Dev/Sentieon License Server/GitHub Secrets/SENTIEON_LICENSE_MESSAGE")
nextflow secrets set SENTIEON_AUTH_DATA $(python3 tests/modules/nf-core/sentieon/license_message.py encrypt --key "$SENTIEON_ENCRYPTION_KEY" --message "$SENTIEON_LICENSE_MESSAGE")
```

> [!NOTE]
> If this fails run `op signin` to flip to nf-core account
</details>
304 changes: 163 additions & 141 deletions modules/nf-core/sentieon/bwamem/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -48,151 +48,173 @@ nextflow_process {
then {
assertAll(
{ assert process.success },
{ assert snapshot(
process.out.bam_and_bai,
process.out.versions,
file(process.out.bam_and_bai[0][1]).name
).match()
{ assert snapshot(process.out).match() }
)
}

}

test("Paired-End") {
config "./nextflow.config"

setup {
run("SENTIEON_BWAINDEX") {
script "../../bwaindex/main.nf"
process {
"""
input[0] = [
[id: 'test'],
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)
]
"""
}
}
}

when {
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
[
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true)
]
]
input[1] = SENTIEON_BWAINDEX.out.index
input[2] = [[id: 'test'],file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)]
input[3] = [[id: 'test'],file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.fai', checkIfExists: true)]
"""
}
}

when {
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
[
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true)
]
]
input[1] = SENTIEON_BWAINDEX.out.index
input[2] = [[id: 'test'],file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)]
input[3] = [[id: 'test'],file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.fai', checkIfExists: true)]
"""
}
}

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

test("Single-End - stub") {
config "./nextflow.config"
options "-stub"

setup {
run("SENTIEON_BWAINDEX") {
script "../../bwaindex/main.nf"
process {
"""
input[0] = [
[id: 'test'],
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)
]
"""
}
}
}

when {
process {
"""
input[0] = [
[ id:'test', single_end:true ], // meta map
[
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true)
]
]
input[1] = SENTIEON_BWAINDEX.out.index
input[2] = [[id: 'test'],file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)]
input[3] = [[id: 'test'],file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.fai', checkIfExists: true)]
"""
}
}

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

}

// TODO
// test("Paired-End") {

// setup {
// run("BWA_INDEX") {
// script "../../index/main.nf"
// process {
// """
// input[0] = [
// [id: 'test'],
// file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)
// ]
// """
// }
// }
// }

// when {
// process {
// """
// input[0] = [
// [ id:'test', single_end:false ], // meta map
// [
// file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true),
// file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true)
// ]
// ]
// input[1] = BWA_INDEX.out.index
// input[2] = [[id: 'test'],file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)]
// input[3] = false
// """
// }
// }

// then {
// assertAll(
// { assert process.success },
// { assert snapshot(
// process.out.cram,
// process.out.csi,
// process.out.crai,
// process.out.versions,
// file(process.out.bam[0][1]).name
// ).match()
// }
// )
// }

// }

// test("Single-end - stub") {
// options "-stub"
// setup {
// run("BWA_INDEX") {
// script "../../index/main.nf"
// process {
// """
// input[0] = [
// [id: 'test'],
// file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)
// ]
// """
// }
// }
// }
// when {
// process {
// """
// input[0] = [
// [ id:'test', single_end:true ], // meta map
// [
// file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true)
// ]
// ]
// input[1] = BWA_INDEX.out.index
// input[2] = [[id: 'test'],file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)]
// input[3] = false
// """
// }
// }

// then {
// assertAll(
// { assert process.success },
// { assert snapshot(
// file(process.out.bam[0][1]).name,
// file(process.out.csi[0][1]).name,
// process.out.versions
// ).match() }
// )
// }
// }

// test("Paired-end - stub") {
// options "-stub"
// setup {
// run("BWA_INDEX") {
// script "../../index/main.nf"
// process {
// """
// input[0] = [
// [id: 'test'],
// file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)
// ]
// """
// }
// }
// }
// when {
// process {
// """
// input[0] = [
// [ id:'test', single_end:false ], // meta map
// [
// file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true),
// file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true)
// ]
// ]
// input[1] = BWA_INDEX.out.index
// input[2] = [[id: 'test'],file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)]
// input[3] = false
// """
// }
// }

// then {
// assertAll(
// { assert process.success },
// { assert snapshot(
// file(process.out.bam[0][1]).name,
// file(process.out.csi[0][1]).name,
// process.out.versions
// ).match() }
// )
// }
// }
test("Paired-End - stub") {
config "./nextflow.config"
options "-stub"

setup {
run("SENTIEON_BWAINDEX") {
script "../../bwaindex/main.nf"
process {
"""
input[0] = [
[id: 'test'],
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)
]
"""
}
}
}

when {
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
[
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true)
]
]
input[1] = SENTIEON_BWAINDEX.out.index
input[2] = [[id: 'test'],file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)]
input[3] = [[id: 'test'],file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.fai', checkIfExists: true)]
"""
}
}

when {
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
[
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true)
]
]
input[1] = SENTIEON_BWAINDEX.out.index
input[2] = [[id: 'test'],file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)]
input[3] = [[id: 'test'],file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.fai', checkIfExists: true)]
"""
}
}

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


}
Loading

0 comments on commit 252aeec

Please sign in to comment.