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

Add additional test to sentieon/bwamem and update docs on sentieon use for local testing #6025

Merged
merged 7 commits into from
Jul 24, 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
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
Loading